Getting started
Before you can get started with Checkout APIs to manage carts and create a personalized checkout experience, you must ensure that the following prerequisites are in place.
Prerequisites
-
Join an AppDirect marketplace and ensure that you have the Marketplace Manager user role.
-
Ensure that the products required for purchase are already set up in the marketplace. .
-
Create API clients.
-
Create a new user and an account/company. Fetch the userId and accountId subsequently.
Or
Use queries for existing user and account details to call Checkout APIs.
-
Assign users to an account/company. For more information on how to use user and account management functions, refer to the help.
-
Obtain a new access token or use one that is already generated (please see step 4). This access token is included in the header section of each query and mutation as defined below:
Authorization:Bearer access_token
Checkout authentication
As part of the authentication process for checkout, you have to first generate a client Id and secret.
How to generate a Client Id and secret?
- Log in to an AppDirect Marketplace with the Marketplace Manager role.
- Go to Manage > Marketplace > Settings > Integration|API Clients. The API Clients page opens.
- Click Create API Client. The API Client Settings dialog opens.
- Enter a name for the API client. Fill out other information as shown in the image below.
- Under Client Type, select Non-interactive application.
- Under Allowed scopes, in the System-level scopes field, select Read and write.
- Click Save settings to generate the Client Id and secret. These are used to fetch the access token that is required to call Checkout APIs.
How to fetch the access token using a Client Id and secret?
Use the Client Id and secret to retrieve an access token. Send a POST request with the Client id and secret as parameters.
See request details below:
Method: POST
URL: https://marketplace-url/oauth2/token
Query parameters:
grant_type:client_credentials
client_id:<client_id>
client_secret:<client_secret>
scope:ROLE_PARTNER
Response:
{
"access_token": "oGbdEBNJ6vKQip5RTQ0mgXGj48kvxjTMWNRPc6r-kRfYig",
"token_type": "bearer",
"expires_in": 43199,
"scope": "ROLE_PARTNER"
}
Was this page helpful?
Tell us more…
Help us improve our content. Responses are anonymous.
Thanks
We appreciate your feedback!