Postman
The collection contains every endpoint of the Partner API, generated from the same OpenAPI document as the reference. The sandbox environment points the collection at the sandbox and holds your credentials. The collection fetches and renews the access token for you.
Import
- Download the collection and the sandbox environment with the buttons above.
- In Postman, choose Import and drop both files into the window. You get a collection called B2B Group Partner API and an environment called B2B Group Partner API - Sandbox.
- Select the sandbox environment in the environment picker in the top right corner.
Add your credentials
Open the sandbox environment and fill in clientId and clientSecret with a sandbox client. Sign in to create one. Set the secret as the current value only, so it stays on your machine and is not synced to a shared workspace.
| Variable | What it is |
|---|---|
baseUrl | The API host. The sandbox environment sets it to https://api-sandbox.b2bgroup.dk. |
clientId | The id of your sandbox client. |
clientSecret | The secret of your sandbox client. It is shown once when you create or rotate it. |
accessToken | Filled in by the collection. Leave it empty. |
accessTokenExpiresAt | Filled in by the collection. Leave it empty. |
Send your first request
Open any request in the Codes folder and send it. Before each request the collection checks whether it has a valid access token. If not, it calls POST /v1/oauth/tokenwith your client id and secret and stores the token in the environment. If the credentials are missing, Postman's console says so and the request is sent without a token.
For production, duplicate the environment, set baseUrl to https://api.b2bgroup.dk and use a production client. A client only works on the environment it belongs to.