Associate transactions with a buyer
A Buyer allows transactions to be linked with customers as well as send buyer-specific information such asname, email, address and tax ID, etc.
See Buyers for further details.
Set a unique reference ID for each transaction
A unique transaction reference ID helps link transactions to orders (see step 2). A unique reference ID can either be set as an external identifier or metadata on the transaction. This is available when using Embed, Secure Fields, or the API directly. Embed is sometimes displayed at checkout before an order is created by the system. After all, creating an order every time a customer loads a checkout page is not desired. AnonBeforeTransaction callback in Embed has been introduced that can be used to set the externalIdentifier or metadata right before a transaction is created. This allows a unique reference ID to be created just-in-time before a transaction is created by Embed.
Update the external identifier
Update the metadata
Use webhooks to listen for transaction updates
It is recommended to listen for updates to transactions by using webhooks. As a unique reference ID has been set (see preceding section), this can be used to listen to webhook events, which notify of a transaction completing, failing, or being declined. Please reach out to the team to set up the webhook URL.Use idempotent requests
Sometimes transactions fail, either because of bad input or because of some kind of network or other system error. In the case of an error where the response was not received by the buyer’s browser (or the system), a transaction can be retried using a special header.Idempotency-Key header is used to uniquely identify a transaction when retrying the same transaction after a network error or some kind of timeout. The second request is matched using this key against the original request, and rather than creating a new transaction the original response is returned.
See Idempotent Requests for further details.
If Embed is being used then idempotent requests are already in use.
Transaction request information
Some payment methods require specific ‘non-standard’ information to process. For example, some Buy Now Pay Later (BNPL) methods require cart items to successfully process payments. Therefore to future-proof the integration, integrating as much information in the transaction request as possible is recommended. This allows new additional methods of payment to be added without having to update the integration. Here are a few examples of optional request information to include.buyerinformationcart_itemsshippinginformationconnection_options(where applicable)payment_sourceis_subsequent_paymentmerchant_initiated