Transaction Modeling
Read about how you can model transactions using the API.
The API is designed to allow you to include transactional information where needed to suit your implementation. For example, you might choose the send the buyer's details in a Calculate Tax request or you may decide to send it in a Confirm Transaction request.
To facilitate this, the same structure is used for the JSON that is attached to all requests. Fields like currency_code
are used to represent information like the currency. For a full list of the available fields, see Fields Reference Overview.
Some fields are generated by the API so these are known as response-only fields. For more information, see Response-Only and Inactive Fields.
You can include information at transaction and transaction line-item level. For more information, see Transaction Details.
Note
If a Confirm Transaction fails, for example due to a network error, you should send a Confirm Transaction request again using the same Transaction Key to ensure it is completed successfully. If you create a new transaction with a Store Transaction request, this may cause a duplicate to be created.
Transaction Processing
The following graphic shows an example of how you can use the requests to integrate with your marketplace:
The steps are as follows:
- The Buyer places some goods in their basked and clicks Pay.
- A Store Transaction request is sent. All the relevant information is modelled in the body of this request.
- The Store Transaction request returns tax and other information.
- A Confirm Transaction request is sent. The Transaction Key is specified in the request's URL.
- The Confirm Transaction request returns the final transaction details.
- Invoice is sent.
- Details displayed in on the UI. Invoice sent to the buyer.
In this Section
Topic | Description |
---|---|
Deprecated Fields and Requests | Read about fields and requests that have been deprecated. |
Transaction Details | Transaction details are modelled at the transaction and line level. |
Product Classes | The Product Class is used to indicate whether your transaction is modelling are physical goods or shipping or other charges. |
Buyers' Details | You need to model information about the buyer such as their name and email address. |
Identifiers and Classifications | You can add various identifiers and classifications to your requests. |
Payment Amounts | You can specify amounts as tax inclusive or exclusive. |
Shipping and Other Charges | You may want to create a method that allows buyers to include shipping or other charges in their transactions. |
Addresses | You may want to model addresses for shipping or payments or billing. |
Multiple Goods | You may want to model multiple goods in a transaction. |
Currencies | Currency conversion is an important feature of any e-commerce business or marketplace. |
Transaction Keys | You use the Transaction Key to confirm a stored transaction. |
Discounts | Discounts are reductions that are applied to a transaction. |
Vouchers | Vouchers can be used to reduce the amount of a transaction. |
e-Commerce or Order IDs | You can add the ID from your order or e-commerce software to your requests to help correlate transactions in the service and in your systems. |
Refunds | Refunds are issues to remunerate already collected amounts for a number of reasons. |
Returned Tax Information | The service returns information about tax and liability in the API responses. |
Updated 20 days ago