Payments
Read about the record types payment transactions and payment methods before going through the examples below.
Payment methods are used to separate sales data and enable the data to be configured and booked to the correct account. A new “virtual” payment method can be added when needed.
Payment with a credit card
A common event sequence is when a customer places an order, pays the order to the PSP and the merchant receives the payment. In this example the customer pays the whole order with a credit card.
The example below describes an e-commerce order:
- Custom places an order at the merchant’s webshop.
- A payment authorization has been done at the Payment Service Provider (PSP). A sales has taken place and the money is reserved at the end-customers bank account but no amount have been transferred yet.
prepare
- Start a payment transaction in the integration platform. Usually the integration platform imports the information from the webshop.- The merchant prepares the order and then sends it to the customer.
- The merchants registers a shipment in the Webshop.
- The merchant notifies the PSP that the money should be withdrawn from the customers account (also called captured or finalized payment).
payment
- The previous step is registered in the integration platform as a payment event. This event indicates that the order is now paid by the customer but the merchant does not have access to the money yet. A common scenario is that the PSP apply a fee during this payment state, that fee should be registered as a fee in a separate field for this event.- The integration platform creates a voucher for the sale that took place and register it in an accounting system.
- The Payment System Provider collects the payment.
- The PSP makes a payout to the merchants bank account meaning the merchant now has the money.
deposit
- The previous step is registered in the integration platform as a deposit event. The PSP could add a fee during the deposit, if this is the case then add the fee to the same event.- The integration platform creates a voucher for the deposit that took place and register it in an accounting system.
Accounting
This example describes how the order information and payment transaction information can be used when registering the sale, payout and fees in an accounting system. The example is for a sale from a Swedish Merchant to a Swedish end customer (only 25% Vat rate is used).
Voucher for the sale in the webshop
Account | Account name | Description | Debit | Credit | Source of data |
---|---|---|---|---|---|
3001 | Sales within Sweden, 25 % VAT | The sales amount excl Vat | 80 | Order | |
2611 | Output VAT on sales in Sweden, 25 % | The VAT amount | 20 | Order | |
1510 | Accounts receivable – trade | Receivable PSP | 100 | Order (or payment event) |
Voucher for the payment from the PSP
Account | Account name | Description | Debit | Credit | Source of data |
---|---|---|---|---|---|
1510 | Accounts receivable – trade | 100 | Deposit event | ||
1930 | Business account/cheque account/current account | Payout from the PSP | 90 | Deposit event | |
6570 | Payment Cost | The fee from PSP | 8 | Fee from the deposit event | |
2611 | Output VAT on sales in Sweden, 25 % | The Vat for the PSP fee | 2 | The 25% VAT for the deposit event fee |
The information about accounting should be strictly be regarded as examples. Contact your accounting specialist for advice. Contact Sharespine for help that fits your use case before using this part of the API.
Payment with an invoice
A common event sequence is when a customer places and order, pays the order and the merchant receives the payment. In this example the customer pays the whole order with an invoice that is handled by the merchant.
- Custom places an order at the merchant’s webshop.
- The merchant prepares the order and then sends it to the customer.
- The merchants registers a shipment in the Webshop.
- The merchant send the invoice to the customer.
- The merchant updates the payment state in the webshop.
prepare
andpayment
- The integration platform use the information from the webshop to register a transaction.- A voucher for the sale is registered in the accounting system.
- The customer pays the invoice and the money reach the merchants bank account.
- The merchant updates the payment state in the webshop.
deposit
- The integration platform use the information from the webshop a deposit event.- The integration platform creates a voucher for the deposit that took place and register it in the accounting system.
Accounting
This example describes how the order information and payment transaction information can be used when registering the sale and payout in an accounting system. The example is for a sale from a Swedish Merchant to a Swedish end customer (only 25% VAT rate is used).
Sale from the webshop
Account | Account name | Description | Debit | Credit | Source of data |
---|---|---|---|---|---|
3001 | Sales within Sweden, 25 % VAT | The sales amount excl Vat | 80 | Order | |
2611 | Output VAT on sales in Sweden, 25 % | The VAT amount | 20 | Order | |
1510 | Accounts receivable – trade | Receivable PSP | 100 | Order (or payment event) |
Payment from a PSP
Account | Account name | Description | Debit | Credit | Source of data |
---|---|---|---|---|---|
1510 | Accounts receivable – trade | 100 | Deposit event | ||
1930 | Business account/cheque account/current account | Payout from the PSP | 100 | Deposit event |
The information about accounting should be strictly be regarded as examples. Contact your accounting specialist for advice. Contact Sharespine for help that fits your use case before using this part of the API.
Pay with a giftcard
- Custom places an order at the merchant’s webshop.
- The merchant prepares the order and then sends it to the customer.
- The merchants registers a shipment in the Webshop.
- The merchant updates the payment state in the webshop.
prepare
andpayment
- The integration platform use the information from the webshop to register a transaction.- A voucher for the sale is registered in the accounting system.
- The integration platform creates a voucher for the payment when using giftcard.
A giftcard does not have a deposit
-event.
Accounting
This example describes how payment transaction information can be used when registering a payment with a giftcard. The example is for a sale from a Swedish Merchant to a Swedish end customer (only 25% VAT rate is used).
This example only handles the accounting part for a sale that is paid with a giftcard. The accounting for the sale of the giftcard is not a part of this example.
Sale from the webshop
Account | Account name | Description | Debit | Credit | Source of data |
---|---|---|---|---|---|
3001 | Sales within Sweden, 25 % VAT | The sales amount excl Vat | 80 | Order | |
2611 | Output VAT on sales in Sweden, 25 % | The VAT amount | 20 | Order |
Payment from a PSP
Account | Account name | Description | Debit | Credit | Source of data |
---|---|---|---|---|---|
2421 | Unused gift vouchers | 100 | Payment event |
The information about accounting should be strictly be regarded as examples. Contact your accounting specialist for advice. Contact Sharespine for help that fits your use case before using this part of the API.
Canceled payment
A common event sequence is when a customer places and order but cancels the order before the payment have been captured. In this example the customer plans to pay the whole order with a credit card but cancels the order before any capture of the payment has occurred.
- Customer places an order at the merchant
prepare
- Payment initiated/reserved in external system, meaning a sale has taken place.- The integration platform use the information from the webshop to register a transaction.
- The customer cancels the order before the payment has been processed.
- The webshop cancels the payment in the PSP. (The reserved money is released)
cancel
- Payment canceled in the external system (possible since the payment was never paid by the customer).
Multiple payment methods
This example describes a purchase paid with both a credit card and a giftcard.
- T1 = transaction 1
- T2 = transaction 2
- Custom places an order at the merchant’s webshop.
- The giftcard have been used in the webshop. This is regarded as a special payment method.
prepare
- Start a payment transaction in the integration platform for the giftcardT1
.- A payment authorization has been done at the Payment Service Provider (PSP). A sales has taken place and the money is reserved at the end-customers bank account but no amount have been transferred yet.
prepare
- Start a payment transaction in the integration platform for the credit card.T2
- The merchant prepares the order and then sends it to the customer.
- The merchants registers a shipment in the Webshop.
- The giftcard is now registered as used as payment for a part of the order.
payment
- The integration platform use the information from the webshop to register the transaction of the giftcard.T1
- A voucher for the sale is registered in the accounting system.
T1
- The integration platform creates a voucher for the payment when using giftcard.
- The merchant notifies the PSP that the money should be withdrawn from the customers account (also called captured or finalized payment).
payment
- The previous step is registered in the integration platform as a payment event. This event indicates that the order is now paid by the customer but the merchant does not have access to the money yet.T2
A common scenario is that the PSP apply a fee during this payment state, that fee should be registered as a fee in a separate field for this event.- The integration platform creates a voucher for the sale that took place and register it in an accounting system.
T2
- The PSP collects the payment.
- The PSP makes a payout to the merchants bank account meaning the merchant now has the money.
deposit
- The previous step is registered in the integration platform as a deposit event. The PSP could add a fee during the deposit, add the fee to the same event.T2
- The integration platform creates a voucher for the deposit that took place and register it in an accounting system.
Accounting
See examples for payment with credit card and payment with giftcard for examples on how the transactions can be used for settlement. It is important to use different payment methods in the integration platform for giftcard and credit card to enable configuration for the correct accounts.
Returned payment
In this example the customer pays the whole order with one payment method e.g. credit card. The customer later returns the whole order to the merchant.
- Custom places an order at the merchant’s webshop.
- A payment authorization has been done at the Payment Service Provider (PSP). A sales has taken place and the money is reserved at the end-customers bank account but no amount have been transferred yet.
prepare
- Start a payment transaction in the integration platform.- The merchant prepares the order and then sends it to the customer.
- The merchants registers a shipment in the Webshop.
- The merchant notifies the PSP that the money should be withdrawn from the customers account (also called captured or finalized payment).
payment
- The previous step is registered in the integration platform as a payment event. This event indicates that the order is now paid by the customer but the merchant does not have access to the money yet. A common scenario is that the PSP apply a fee during this payment state, that fee should be registered as a fee in a separate field for this event.- The integration platform creates a voucher for the sale that took place and register it in an accounting system.
- The Payment System Provider collects the payment.
- The PSP makes a payout to the merchants bank account meaning the merchant now has the money.
deposit
- The previous step is registered in the integration platform as a deposit event. The PSP could add a fee during the deposit, add the fee to the same event.- The integration platform creates a voucher for the deposit that took place and register it in an accounting system.
- The customer returns the order
- The merchant updates the order and payment state in the webshop.
- The Webshop requests a customer refund from the PSP.
refund
- The integration platform use the information from the webshop to register a refund event.- A voucher can be created for the accounting system to adjust the sales accounts.
- The PSP returns the payment to the customer.
- The merchant returns the money to the PSP (uncommon scenario)
- Update payment state in the webshop.
credit
- The integration platform use information from the webshop to register a credit event.- A voucher can be created for the credit in the accounting system. A fee could be added during this stage. A negative fee would represent that the original fee is deducted from the requested amount. A positive fee would indicate that the PSP takes an additional fee for the credit process.
Events
Below is examples of events with values:
Event | Description | Amount | Fee | Accumulated fee |
---|---|---|---|---|
prepare | Auth payment: registering the payment | +100 | 0 | 0 |
payment | Capture payment | +100 | 0 | 0 |
deposit | Deposit amount: with a fee for the deposit | +90 | +10 | 10 |
refund | Refund payment | +100 | 0 | 10 |
credit | Credit amount where a part of the deposit fee is deducted | +95 | -5 | 5 |
All amounts in an event has to be in the same currency. Tax information is needed for the fees.
Accounting
Sale from the webshop
The merchant have made a sale and registered a payment at the PSP.
Account | Account name | Description | Debit | Credit | Source of data |
---|---|---|---|---|---|
3001 | Sales within Sweden, 25 % VAT | The sales amount excl Vat | 80 | Order | |
2611 | Output VAT on sales in Sweden, 25 % | The VAT amount | 20 | Order | |
1510 | Accounts receivable – trade | Receivable PSP | 100 | Order (or payment event) |
Payment from a PSP
The Merchant registers that the money have been payed out from the PSP.
Account | Account name | Description | Debit | Credit | Source of data |
---|---|---|---|---|---|
1510 | Accounts receivable – trade | 100 | Deposit event | ||
1930 | Business account/cheque account/current account | Payout from the PSP | 90 | Deposit event | |
6570 | Payment Cost | The fee from PSP | 8 | Fee from the deposit event | |
2611 | Output VAT on sales in Sweden, 25 % | The Vat for the PSP fee | 2 | The 25% VAT for the deposit event fee |
Register a full refund
The Merchant registers a full customer refund at the PSP.
Account | Account name | Description | Debit | Credit | Source of data |
---|---|---|---|---|---|
2410 | Other current liabilities to credit institutions | Liability to PSP | 100 | Refund event | |
3001 | Sales within Sweden, 25 % VAT | The sales amount excl Vat | 80 | Refund event | |
2611 | Output VAT on sales in Sweden, 25 % | The VAT amount | 20 | Refund event |
Register a full credit
The Merchant actually pays the money back to the PSP.
In this example the deposit fee is returned by the PSP i.e. a negative fee.
Account | Account name | Description | Debit | Credit | Source of data |
---|---|---|---|---|---|
2410 | Other current liabilities to credit institutions | 100 | Credit event | ||
1930 | Business account/cheque account/current account | Refund to PSP | 95 | Credit event | |
6570 | Payment Cost | The fee from PSP | 4 | Fee from the credit event | |
2611 | Output VAT on sales in Sweden, 25 % | The Vat for the PSP fee | 1 | The 25% VAT for the credit event fee |
An alternative example when an additional fee new fee is added to the credit event.
Account | Account name | Description | Debit | Credit | Source of data |
---|---|---|---|---|---|
2410 | Other current liabilities to credit institutions | 100 | Credit event | ||
1930 | Business account/cheque account/current account | Refund to PSP | 105 | Credit event | |
6570 | Payment Cost | The fee from PSP | 4 | Fee from the credit event | |
2611 | Output VAT on sales in Sweden, 25 % | The Vat for the PSP fee | 1 | The 25% VAT for the credit event fee |
The information about accounting should be strictly be regarded as examples. Contact your accounting specialist for advice. Contact Sharespine for help that fits your use case before using this part of the API.