Get access token to checkout APIs using your ClientID and Secret provided by Avarda. Access token can/should be reused for all your checkout requests until it expires after one hour. Access token reuse is for performance reasons and will decrease the load time of the checkout.
Initialize the checkout session by calling API Purchase - PurchaseID and JWT token is returned. Use AccessToken as bearer in your header request to authenticate.
Load the checkout form via Avarda Javascript using the JWT token from API Purchase. Detail described in How to embed checkout form. During the time when the checkout form is active it can be updated with changes from the shopping cart (updateItems) or eventual delivery address updates from parent page. Parent page can also receive events for validating delivery address or order status before purchase is completed.
Complete payment. When the user completes the payment, checkout form triggers the java script event CompletePurchaseCallback which notifies the parent page to check status and if status is completed load the confirmation page.
Payment status should be checked after purchase is completed. Merchant calls checkout API purchases with the purchaseid as a key and receives a full data object back with all information that has been generated during the checkout.
Backend notification Optional – Avarda tiggers a backed notification to merchant to notify that the purchase is completed. Merchant is expected to query payment status via API Payments.
GetAccessToken using your ClientId and Secret. Reuse token for 1h and send it as Bearer in http header for api authentication.
PurchaseOrder. On delivery Avarda expects a message with all delivered products – This message is the base for when merchant gets paid for orders and when the end customer is invoiced. Part delivery is allowed. Discounts can be sent in same call using negative amount.
GetAccessToken using your ClientId and Secret. Reuse token for 1h and send it as Bearer in http header for api authentication.
ReturnOrder. If merchant gets some goods in return or need to credit the end customer this message is expected. End customer will be credited on their invoice or amount refunded for prepaid card or direct bank payments.
GetAccessToken using your ClientId and Secret. Reuse token for 1h and send it as Bearer in http header for api authentication.
Cancel. If order cant be delivered and needs to be cancelled. Refund of the total authorized amount will be performed to end customer if prepaid, credit reservation on invoice will be removed.
GetAccessToken using your ClientId and Secret. Reuse token for 1h and send it as Bearer in http header for api authentication.
Refund. If prepaid order is not fully delivered, refund to end customer is required. Refund specific amount.
Refund Remaining. Refunds all not yet debited (purchaseOrder) amount to end customer.
Initialize
Get access token to checkout APIs using your ClientID and Secret provided by Avarda. The access token can/should be reused for all your checkout requests until it expires after one hour. Access token reuse is for performance reasons and will decrease the load time of the checkout.
Initialize the checkout session by calling API Purchase – PurchaseID and JWT token is returned. Use AccessToken as bearer in your header request to authenticate.
Update (optional)
Load the checkout form via Avarda Javascript using the JWT token from API Purchase. Details described in how to embed checkout form. During the time when the checkout form is active, it can be updated with changes from the shopping cart (updateItems) or eventual delivery address updates from a parent page. Parent page can also receive events for validating delivery address or order status before purchase is completed.
Finalize Purchase
Complete payment. When the user completes the payment, checkout form triggers the java script event CompletePurchaseCallback which notifies the parent page to check status and if status is completed load the confirmation page.
Payment status should be checked after the purchase is completed. Merchant calls checkout API purchases with the purchaseid as a key and receives a full data object back with all information that has been generated during the checkout.
Order Management
Delivery
GetAccessToken using your ClientId and Secret. Reuse token for 1h and send it as Bearer in http header for api authentication.
PurchaseOrder. On delivery Avarda expects a message with all delivered products – This message is the base for when merchant gets paid for orders and when the end customer is invoiced. Part delivery is allowed. Discounts can be sent in same call using negative amount.
Return
GetAccessToken using your ClientId and Secret. Reuse token for 1h and send it as Bearer in http header for api authentication.
ReturnOrder. If merchant gets some goods in return or need to credit the end customer this message is expected. End customer will be credited on their invoice or amount refunded for prepaid card or direct bank payments.
Cancel
GetAccessToken using your ClientId and Secret. Reuse token for 1h and send it as Bearer in http header for api authentication.
Cancel. If the order cant is delivered and needs to be cancelled. A refund of the total authorized amount will be performed to the end customer if prepaid, credit reservation on invoice will be removed.
Refund
GetAccessToken using your ClientId and Secret. Reuse token for 1h and send it as Bearer in HTTP header for API authentication.
Refund. If the prepaid order is not fully delivered, a refund to the end customer is required. Refund specific amount.
Refund Remaining. Refunds all not yet debited (purchaseOrder) amount to the end customer.