Docs

Billpay · Guides

Look up a balance and pay

Find a payee, check what a reference owes and pay it.

This guide covers the full flow: find the payee, check the balance, pay, and check the payment later.

1. Find the payee

Call List Payees. You can combine these filters. When you send more than one, all of them apply.

Query parameter Filter
page Page number, starting at 1
name Case-insensitive match anywhere in the display name
category Exact match on the category
connection_mode online or batch
has_balance true for payees that support balance lookups, false for payees that do not
accepts_expired true for payees that accept payments on expired bills, false for payees that do not
curl "https://dev-api.finco.lat/api/v1/payees?category=Electricity&has_balance=true" \
  -H 'Authorization: Bearer your_api_key'

Before you continue, check the reference against reference_config.regex and the amount against financial_rules. See Concepts for what each field means.

2. Look up the balance

Only for payees with has_balance: true. This step is optional.

curl https://dev-api.finco.lat/api/v1/balances \
  -H 'Authorization: Bearer your_api_key' \
  -H 'Content-Type: application/json' \
  --data '{
    "payee_id": "0d93acf6-b63d-46e8-aa5f-6f2520462608",
    "payer_account": "041837057079959114"
  }'

Show the amount and due_date to your user. To read the same lookup again, call Retrieve Balance with the balance_id.

3. Pay

Send the payee_id, payer_account, amount and currency. idempotency_key is optional.

curl https://dev-api.finco.lat/api/v1/payments \
  -H 'Authorization: Bearer your_api_key' \
  -H 'Content-Type: application/json' \
  --data '{
    "payee_id": "0d93acf6-b63d-46e8-aa5f-6f2520462608",
    "payer_account": "U0000-19",
    "amount": 1000,
    "currency": "MXN",
    "idempotency_key": "client_side_idempotency_key"
  }'

Store the payment_id and the auth_number. If the payment fails, you get a 422 with an error_type and an error_message. See Error codes.

4. Check a payment later

Call Retrieve Payment with the payment_id. It returns 404 if the payment does not exist.

Retrieve a payment
curl https://dev-api.finco.lat/api/v1/payments/429ee7cb-6eee-4fd2-8bb3-ad22f7f3c88e \
  -H 'Authorization: Bearer your_api_key'

The API also has a Verify Payment endpoint. It takes the same fields as a payment, with idempotency_key required.

Top-ups

For Topup payees, pick one of the payee’s bundles and call Create Topup with the payee_id, the amount and the phone_number. idempotency_key is optional.