POST/autopay/balance

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.

Business rules

  1. Currency: The currency (currency) you respond with must match the one configured in the original autopay.
  2. Zero Balance: If you respond with a total of 0, AutoPay will understand there is no pending debt and will not perform any charge.
  3. Amount Selection: AutoPay will read the corresponding field based on the autopay configuration:
    • If TOTAL_BALANCE, it will take the value from amount.
    • If MINIMUM_BALANCE, it will take the value from min_amount.

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:ACC00012345
    Max 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-64c24eb232ad
    Format:uuid
    Max length:36
    Min length:36

Solicitud

POST
/autopay/balance
       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-64c24eb232ad
    Format:uuid
    Max length:36
    Min 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

POST
/autopay/balance
{
  "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
  }
}