Skip to main content

Authentication

The API uses OAuth 2.0 with the client_credentials flow and long-lived JWT tokens (12 hours).

Get a token

POST /v1/auth/login
Content-Type: application/json

{
"clientId": "your-client-id",
"clientSecret": "your-client-secret"
}

Response

{
"accessToken": "eyJhbGciOiJSUzI1NiIsInR...",
"tokenType": "Bearer",
"expiresIn": 43200,
"scope": "clients:read clients:write receivables:read receivables:write ..."
}
FieldDescription
accessTokenJWT to use in Authorization: Bearer ...
tokenTypeAlways Bearer
expiresInSeconds until expiration. Default 43200 (12 hours)
scopeSpace-separated list of enabled scopes

Use the token

Include the accessToken as a bearer token on every request:

GET /v1/me
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR...

Renewal

When the token expires, issue a new POST /v1/auth/login to obtain another one. There are no refresh tokens.

For server-to-server integrations: cache the token in memory, renew it before expiration (typically 5 minutes before), and reuse it across requests. The expiresIn field in the response indicates the lifetime in seconds.

Scopes

Each API key has a set of scopes that limit what it can do. The token returns the active scopes in the scope field.

ScopeAllows
clients:readRead clients
clients:writeCreate and update clients
associates:readRead associates
associates:writeCreate, update, and disable associates
receivable-accounts:readRead receivable accounts
receivable-accounts:writeCreate, update, and disable receivable accounts
current-accounts:readRead current accounts (MAIN/SUB)
receivables:readRead receivables
receivables:writeCreate, update, and change the status of receivables
movements:readRead movements
settlements:readRead settlements
route-settlements:readRead route settlements
route-settlements:writeCreate/update route settlements
reports:readGenerate and download reports
webhooks:adminManage webhooks

When a request requires a scope the token does not have, the response is 403 insufficient-scope.

Common errors

ScenarioHTTPcode
Incorrect credentials401invalid-credentials
Expired token401token-expired
Malformed token401invalid-token
Missing required scope403insufficient-scope
Rate limit on /auth/login429rate-limit-exceeded

GET /v1/me

Convenience resource to inspect the context of the active token. Useful when integrating, to confirm credentials, customer, and environment:

GET /v1/me
Authorization: Bearer eyJ...

200 OK
{
"customer": {
"id": 17,
"businessName": "DistribuidoraDemo S.A.",
"taxId": "30999999999",
"creationDate": "2025-11-01T10:00:00-03:00"
},
"apiKey": {
"id": 88,
"name": "ERP Producción",
"scopes": [
"clients:read", "clients:write",
"associates:read", "associates:write",
"receivable-accounts:read", "receivable-accounts:write",
"receivables:read", "receivables:write",
"movements:read", "settlements:read", "reports:read",
"webhooks:admin"
],
"environment": "PRODUCTION",
"rateLimitTier": "STANDARD"
}
}

Credential rotation

The clientSecret can be rotated by contacting the Max Pay team. A self-service endpoint will be exposed in an upcoming release.