Webhooks
If the concept of webhook is unfamiliar, we recommend you to research it first. A good introductory explanation in Spanish can be read here.
The method used is POST. The body of the request will be in JSON format. You can choose the URL you want, but you must communicate it to the aCuotaz team.
The body format is as follows:
{
"order_id": "123",
"event": "approved"
}
The " order_id "
parameter uniquely identifies purchase orders.
The " event "
parameter is predefined to be one of the possible request states listed below.
Authentication
For security, we include the following header:
Apurata-Auth: Bearer [secret_token]
You can ignore this header and use the body shown above, but we recommend validating the token for security. If you do not validate this token, you will be accepting requests from any source.
Order statuses
- initial: The order is created (We do not notify this via the webhook, but it is the first status when the order is created).
- created: The customer selected the number of installments and initiated his credit request.
- approved: Successful credit evaluation.
- onhold: The initial payment was successful. If there is no down payment, the identity validation photos were uploaded successfully.
- validated: Successful identity validation.
- funded: Disbursement made.
- canceled: Credit request canceled.
The names of the states are in English because they are used directly in the code.
Important! aCuotaz process flow
To know more about the process customers have to follow when using aCuotaz and event details, check the following link. flow tutorial
In case of errors
If there is an error, Webhooks will be resent up to 5 times. The retry N will be done 2 ^ (N-1) seconds after the previous attempt failed. In other words, the retries will be made after 1, 2, 4, 8 and 16 seconds.
Apurata will save webhooks logs from the last 7 days only.