Skip to main content

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

  1. Join an AppDirect marketplace and ensure that you have the Marketplace Manager user role.

  2. Ensure that the products required for purchase are already set up in the marketplace. .

  3. Create API clients.

  4. Fetch the access token.

  5. 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.

  6. Assign users to an account/company. For more information on how to use user and account management functions, refer to the help.

  7. 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?

  1. Log in to an AppDirect Marketplace with the Marketplace Manager role.
  2. Go to Manage > Marketplace > Settings > Integration|API Clients. The API Clients page opens.

  1. Click Create API Client. The API Client Settings dialog opens.

  1. Enter a name for the API client. Fill out other information as shown in the image below.
  2. Under Client Type, select Non-interactive application.
  3. Under Allowed scopes, in the System-level scopes field, select Read and write.

  1. 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?