On this page, you will find information about how to authenticate with the Checkout 3.0 Backend API, construct the authentication header and how to Initialize payment.
API Authentication
Base URLs
Avarda base URLs for Checkout 3.0 Backend API:
Stage environment: https://stage.checkout-api.avarda.com (opens in a new tab)
Production environment: https://checkout-api.avarda.com (opens in a new tab)
Obtain Partner access token
“Partner access token” is used as authentication for all further communication with the Checkout 3.0 Backend API. This token should never be displayed to the user or sent to the frontend of the application.
To obtain the token send POST
request with clientId
and clientSecret
as a JSON
to /api/partner/tokens
.
# Obtain Partner access token
curl -X "POST ${api_url}/api/partner/tokens" \
-H 'Content-type: application/json' \
-H 'Accept: application/json' \
-d '{ "clientId": "659e57c9-d970-4db8-b003-8ba04cc157f9", "clientSecret": "4~{x*6%gvBt(:aD" }'
Payload:
Property | Data type |
---|---|
clientId | string |
clientSecret | string |
Example
Return Value
Payload:
Property | Data type | Description |
---|---|---|
token | string | JWT token in string format – “Partner Access Token” |
tokenExpirationUtc | string | DateTime in string format – easy access to expiration date of “Partner Access Token”. More information about handling of the token in Handling Partner access token |
Initialize payment
Initialize payment and set up initial parameters such as: language; items list; etc. Please check the full list of options below.
Send a POST
request with “Partner access token” as authorization with JSON
data. Successful initialization returns a unique “Purchase JWT token” and “PurchaseId”. “Purchase JWT token” is used to display Checkout 3.0 form on the frontend of your application. “PurchaseId” is used in other Checkout 3.0 Backend API calls.
Payload
Property | Data type | Description |
---|---|---|
Items | [ Item ] | List of item objects |
CheckoutSetup | CheckoutSetup | Setup for checkout payment |
B2C | B2CInfo | Business to customer checkout setup |
B2B | B2BInfo | Business to business checkout setup |
ExtraIdentifiers | ExtraIdentifiers | Partner’s checkout session identifiers |
Example
Return Value