Useful APIs

Learn about the most useful APIs when managing a private store.

To manage a private store effectively, obtaining an access token is critical. Access tokens are key to authenticating and authorizing users and applications, enabling them to interact securely with the store's API. This authentication process ensures that only authorized users can perform sensitive operations such as viewing private products, making purchases, or accessing user-specific data. Consequently, access tokens play a vital role in protecting the store from unauthorized access and potential security breaches, maintaining the integrity and privacy of the store's data and transactions.

Getting an access token by session token

To facilitate secure interactions with the API from a private store, you can convert an existing session token into an access token. This process involves making a simple GET request to the API's authentication endpoint. Below, we'll outline the steps to obtain an access token using a session token.

To get an access token by session token, follow these steps:

  1. Send a GET /v1/shoppers/token.json?apiKey={client_id}&session_token={session_token} request.

    • Replace {client_id} with your client ID.

    • Replace {session_token} with your session token.

    • Replace {apikey_secret_authr} with your API key secret for authorization.

curl --location --request GET 'https://api.digitalriver.com/v1/shoppers/token.json?apiKey={client_id}&session_token={session_token}' \
--header 'authorization: bearer {apikey_secret_authr}\
...

Verifying the access token is authenticated

To verify that the access token is authenticated, follow these steps:

  1. Send a GET /oauth20/access-tokens.json?token={access_token} request.

    • Replace {access_token} with your access token.

    • Replace {apikey_secret_authr} with your API key secret for authorization.

    This will validate the access token and ensure it is authenticated for further use.

curl --location --request GET 'https://api.digitalriver.com/oauth20/access-tokens.json?token={access_token}' \
--header 'authorization: bearer {apikey_secret_authr}\
...

Searching for a private store

When you search for a Private Store, the id for purchasePlanAuthorize and the targetMarketId appears in the response. When you search for a Private Store, you need to provide id for the purchasePlanAuthorize and the targetMarketId in the request. This step is not required unless you frequently create and edit private stores. You should store or cache these attributes on your side.

    "purchasePlanAuthorize":{
        "id":"4912758700",
        "targetMarketId":"4897371800",
    }
}

Last updated