Skip to main content

Authentication and Authorization

Capricorn APIs use header-based authentication and authorization. Include the following headers with each Capricorn API request:

  • client_id
  • client_secret
  • x-captoken
important

API authentication

Each Capricorn API request must include the following authentication headers:

  • client_id
  • client_secret
  • x-captoken

These credentials are provided directly with each request. No separate token acquisition request is required. Store all credentials securely.

important

API authorization

Capricorn provides your x-captoken alongside your client_id and client_secret during onboarding. It is a long-lived token with no defined expiration period and remains valid unless Capricorn revokes it.

Authentication​

The client_id identifies the calling application and the client_secret authenticates it. Capricorn issues both during onboarding.

Authorization​

The x-captoken authorises the authenticated application to access the approved Capricorn API services for its supplier context.

Example request headers​

GET [documented Direct Integration endpoint]
Host: [Capricorn API Host]
client_id: 0123456789ABCDEF0123456789ABCDEF
client_secret: ABCDEF0123456789ABCDEF0123456789
x-captoken: opaque-token

Error Responses​

When authentication or authorization fails, you receive:

{
"error": "Unauthorized",
"message": "Invalid or missing authentication credentials"
}

HTTP Status: 401 Unauthorized

Common causes:

  • Missing x-captoken or client_id header
  • x-captoken has been revoked
  • client_id does not match the x-captoken's associated client
  • The supplierId provided in the request path or body does not match the supplier associated with the token x-captoken