Skip to main content

Access tokens

Exchange your client credentials for a bearer token.

Get an access token

POST https://api.dawatrack.com/partner-api/v1/oauth/token/

Exchange a client_id and client_secret for a bearer token, using the OAuth2 client credentials grant.

No credentials needed Limit 20 per hour per IP address

The token lasts one hour and carries your credential's scopes. Send it as Authorization: Bearer <token> on every other call.

The token is opaque, not a JWT, so don't try to decode it. There is no refresh token: request a new one when it expires.

OAuth 2.0 (RFC 6749): grant_type, if sent, is client_credentials; the credentials may come with HTTP Basic instead of the body. Errors carry error (invalid_client 401, invalid_request or unsupported_grant_type 400) and error_description. Every response has Cache-Control: no-store.

Request body

JSON. Send Content-Type: application/json.

  • grant_type string Optional

    Optional; when sent, client_credentials (RFC 6749 §4.4).

  • client_id string Required

    Or send client_id and client_secret with HTTP Basic (RFC 6749 §2.3.1) instead of in the body.

  • client_secret string Required

    Your credential's secret.

Example request

curl -X POST https://api.dawatrack.com/partner-api/v1/oauth/token/ \
  -H "Content-Type: application/json" \
  -d '{
    "client_id": "dtpk_...",
    "client_secret": "..."
  }'
import requests

response = requests.post(
    "https://api.dawatrack.com/partner-api/v1/oauth/token/",
    json={
      "client_id": "dtpk_...",
      "client_secret": "..."
    },
)
response.raise_for_status()
print(response.json())
const response = await fetch("https://api.dawatrack.com/partner-api/v1/oauth/token/", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "client_id": "dtpk_...",
    "client_secret": "..."
  }),
});
console.log(await response.json());

Response fields

  • access_token string

    The bearer token to send on other calls.

  • token_type string

    Always Bearer.

  • expires_in integer

    Seconds until this token expires.

  • scope string

    Space-separated scopes granted to this token.

  • environment string

    SANDBOX or PRODUCTION - inherited from the credential used.

Example response

JSON
{
  "access_token": "AbC123...",
  "token_type": "Bearer",
  "expires_in": 3600,
  "scope": "products:read batches:read recalls:read",
  "environment": "SANDBOX"
}

Status codes

200OK
400The request is invalid, for example a malformed GTIN or a missing field
401No valid access token
429Rate limit exceeded

Partner API v1. The API reference is generated from the API's own code.