Skip to content

API Introduction

Base URLs

Appmax provides two environments for integration:

EnvironmentAuthenticationAPI
Sandboxhttps://auth.sandboxappmax.com.brhttps://api.sandboxappmax.com.br
Productionhttps://auth.appmax.com.brhttps://api.appmax.com.br

Authentication

All API requests (except token retrieval) must include the Authorization header with a valid Bearer token.

bash
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6Ikp...

To obtain a token, send a POST request to the authentication endpoint:

bash
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:

json
{
  "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

HeaderValue
AuthorizationBearer {TOKEN}
Content-Typeapplication/json
Acceptapplication/json

Response format

All API responses follow an envelope format with the data field:

json
{
  "data": {
    // response content
  }
}

HTTP status codes

CodeDescription
200Request successful
201Resource created successfully
400Bad request (e.g., order already paid)
401Invalid or expired token
404Resource not found
422Data validation error
500Internal server error

Error handling

Error responses follow an envelope format with the error or errors field:

json
{
  "error": {
    "message": "Order not found"
  }
}

For validation errors (422), details for each field are returned:

json
{
  "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.