FAQ
Credentials
What is the difference between app credentials and merchant credentials?
These are two pairs of client_id and client_secret: the app pair is used only for the installation flow (1 per app), and the merchant pair, returned by /app/client/generate (1 per merchant that installed the app), is used for transactional operations. Both use the same POST /oauth2/token, but the generated token has different permissions, and a 401 when creating customers or orders is usually the wrong pair.
Comparison table in Authentication.
Can I use app credentials to create orders?
No. To create customers, orders, and payments, use the merchant credentials, generated at the end of the installation flow via POST /app/client/generate. See Authentication.
Authentication and tokens
What is the JWT token's validity period?
The API access token (JWT) is valid for 1 hour; to renew it, repeat the request with the same credentials (Obtaining the token). The credentials (client_id and client_secret) do not expire: they change on a reinstall of the app (new pair), on uninstall (deactivated), and on the panel's API screen, which lets you generate a new secret or revoke the pair.
What should I do when a 403 error occurs on the /oauth2/token route?
The call is going to the wrong endpoint: the authentication route is separate from the API. In the sandbox, it is https://auth.sandboxappmax.com.br/oauth2/token (the API is https://api.sandboxappmax.com.br). See the full example in Obtaining the token and the URLs for each environment in Environments.
I received a 401 when calling the API. What could it be?
The most common causes are swapped credentials (app instead of merchant, or the reverse) and a JWT token older than 1 hour (generate a new one with the same credentials). See the common errors table for quick diagnosis.
What should I do when a 401 error occurs when creating a customer?
Confirm that the token has not expired (it is valid for 1 hour) and that it was generated with the merchant credentials, not the app credentials, after the installation. See the common errors table.
App installation
What should I do when a 500 error occurs during app authentication?
Usually the installation flow was not followed in full, especially the merchant redirect to the authorization step (step 3). Follow the 4 steps in order: app token, /app/authorize, redirect with the hash, and /app/client/generate. See App installation.
How does the integration identify the store performing the installation?
Identification occurs through the user's login on the external platform. When clicking "Install", the hash is generated via POST /app/authorize and the merchant is redirected to the Appmax panel, where they enter the store name and select the registered company; after authorization, the hash generates the credentials via POST /app/client/generate. The hash can only be used once, and the generated credentials are valid until the app is uninstalled (App installation).
What is the difference between external_key and external_id?
| Field | Who defines it | Usage | Can repeat? |
|---|---|---|---|
external_key | External platform / merchant's system | Identify the origin of the installation | Yes |
external_id | Generated by the integrator on the validation URL health check | UUID that binds the installation to the store; later used as external-id on CDN calls | No |
They cannot be the same, as each field has a distinct purpose:
external_key: identifies the origin in the platform/client context.external_id: confirmation of the app installation.
For the use of external_id after installation (header external-id on CDN calls, parameter of AppmaxScripts.init), see external-id.
Webhooks
How do I know a webhook was sent by Appmax?
Register a webhook secret (in the app configuration, or when registering a panel webhook). With it, every delivery carries the Signature header: the HMAC-SHA256 of the raw request body, computed with the secret. Redo the calculation on your endpoint and compare; if it does not match, reject it. Step by step and code samples in Webhook signature.
I forgot the webhook secret. How do I see it again?
You can't: for security, once saved the secret is never shown. Generate a new one, update your system and save. During the rotation, also accept the old secret until pending retries are over.