Query amount to charge
This endpoint contains the logic for variable charges (TOTAL_BALANCE or MINIMUM_BALANCE). Before attempting any transaction, AutoPay will query this service to know how much to charge at that specific moment.
Merchant endpoint: The base URL ({{baseURL}}) corresponds to your own server.
You must expose this service on your infrastructure and provide the base URL during the AutoPay onboarding process.
Authentication (Basic Authentication): This endpoint requires authentication via the Authorization header.
The merchant must validate the credentials configured for AutoPay on each incoming request. See more at Contract authentication.
Business rules
- Currency: The currency (
currency) you respond with must match the one configured in the original autopay. - Zero Balance: If you respond with a
totalof0, AutoPay will understand there is no pending debt and will not perform any charge. - Amount Selection: AutoPay will read the corresponding field based on the autopay configuration:
- If
TOTAL_BALANCE, it will take the value fromamount. - If
MINIMUM_BALANCE, it will take the value frommin_amount.
- If
Request
- Name
reference- Type
- string
- is Required
- REQUIRED
- Description
AutoPay reference provided by the client/merchant. This reference must be unique and active per merchant.
Example:ACC00012345Max length:32
- Name
id- Type
- string
- is Required
- REQUIRED
- Description
Unique identifier of the confirmed AutoPay registered in the notification record.
Example:2972c13d-6315-4da3-80d7-64c24eb232adFormat:uuidMax length:36Min length:36
Solicitud
curl -X "POST" {{baseURl}}/autopay/balance \
-H "Content-Type: application/json" \
-H "Authorization: Basic <base64(username:password)>" \
-d '{
"reference": "ACC00012345",
"id": "2972c13d-6315-4da3-80d7-64c24eb232ad"
}'
Response
Successful response with the amount to be charged to the user
- Name
status- Type
- Status
- is Required
- REQUIRED
- Description
Structure used to define response statuses.
- Name
id- Type
- string
- is Required
- REQUIRED
- Description
Unique identifier of the confirmed AutoPay registered in the notification record.
Example:2972c13d-6315-4da3-80d7-64c24eb232adFormat:uuidMax length:36Min length:36
- Name
amount- Type
- Amount
- is Required
- REQUIRED
- Description
Structure that contains the information about the payment of the transaction required to the web service
- Name
min_amount- Type
- Amount
- is optional
- Description
Structure that contains the information about the payment of the transaction required to the web service
Respuesta
{
"status": {
"status": "OK",
"reason": "00",
"message": "Successful response",
"date": "2025-09-29T17:09:29-05:00"
},
"id": "2972c13d-6315-4da3-80d7-64c24eb232ad",
"amount": {
"currency": "USD",
"total": 10
},
"min_amount": {
"currency": "USD",
"total": 5
}
}