Authentication and Authorization
Capricorn APIs use header-based authentication and authorization. Include the following headers with each Capricorn API request:
client_idclient_secretx-captoken
API authentication
Each Capricorn API request must include the following authentication headers:
client_idclient_secretx-captoken
These credentials are provided directly with each request. No separate token acquisition request is required. Store all credentials securely.
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-captokenorclient_idheader x-captokenhas been revokedclient_iddoes not match thex-captoken's associated client- The
supplierIdprovided in the request path or body does not match the supplier associated with the tokenx-captoken