API Introduction
Base URLs
Appmax provides two environments for integration:
| Environment | Authentication | API |
|---|---|---|
| Sandbox | https://auth.sandboxappmax.com.br | https://api.sandboxappmax.com.br |
| Production | https://auth.appmax.com.br | https://api.appmax.com.br |
Authentication
All API requests (except token retrieval) must include the Authorization header with a valid Bearer token.
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6Ikp...To obtain a token, send a POST request to the authentication endpoint:
curl --location 'https://auth.appmax.com.br/oauth2/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'client_id=SEU_CLIENT_ID' \
--data-urlencode 'client_secret=SEU_CLIENT_SECRET'Response:
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6Ikp...",
"token_type": "Bearer",
"expires_in": 3600
}INFO
The token is valid for 1 hour. After it expires, obtain a new token using the same process. The API does not use refresh tokens.
Required headers
| Header | Value |
|---|---|
Authorization | Bearer {TOKEN} |
Content-Type | application/json |
Accept | application/json |
Response format
All API responses follow an envelope format with the data field:
{
"data": {
// response content
}
}HTTP status codes
| Code | Description |
|---|---|
200 | Request successful |
201 | Resource created successfully |
400 | Bad request (e.g., order already paid) |
401 | Invalid or expired token |
404 | Resource not found |
422 | Data validation error |
500 | Internal server error |
Error handling
Error responses follow an envelope format with the error or errors field:
{
"error": {
"message": "Order not found"
}
}For validation errors (422), details for each field are returned:
{
"message": "The given data failed to pass validation.",
"errors": {
"message": {
"campo": ["Mensagem de validação"]
}
}
}TIP
Always check the HTTP status code before processing the response body. For 401 errors, obtain a new token and retry the request.
Monetary values
WARNING
All monetary values in the API are represented in cents (integers). For example, R$ 123.00 must be sent as 12300.