Accounts & Integrations
API Reference
Payments

Payments API

Use the Payments API to record inbound payments and monitor balances for individual accounts.

Payments are always tied to a specific account and can affect the account’s collection status.

Endpoints

MethodPathScopeDescription
POST/accounts/{account_id}/paymentaccounts:writeRecord a payment against an account.
GET/accounts/{account_id}/payment-statusaccounts:readGet payments and current outstanding balance.
GET/accounts/{account_id}/statusaccounts:readCheck collection status with overdue state.

Payment fields

FieldTypeDescription
amountnumberPayment amount. Must not exceed the outstanding balance.
payment_methodstringMethod such as check, ach, or card.
payment_referencestringExternal reference from your system (for example, check ID).
notesstringOptional notes stored on the account activity timeline.

Payment statuses

Payment records use the following statuses:

  • PENDING
  • PROCESSING
  • COMPLETED
  • FAILED
  • REFUNDED

Computed payment tags

Tags are computed at runtime (not stored):

  • partially_paid when paid_amount > 0 and paid_amount < invoice.amount
  • past_due
  • paid_in_full
  • write_off

Record a payment

cURL

curl --request POST \
  --url https://api.agilereceivables.com/api/v1/external/accounts/uuid/payment \
  --header 'X-Api-Key: sk_live_xxxxxxxxxxxxxxxxxxxx' \
  --header 'Content-Type: application/json' \
  --data '{
  "amount": 500,
  "payment_method": "check",
  "payment_reference": "CHK-2026-001"
}'

Response

{
  "success": true,
  "status_code": 200,
  "message": "Payment recorded",
  "data": {
    "invoice_id": "uuid",
    "new_status": "in_progress",
    "outstanding_amount": 1000.0
  }
}

Refunds and chargebacks

  • Refunds are represented by payment records transitioning to REFUNDED.
  • Chargebacks do not have a dedicated status; they are represented as FAILED payments.

Settlement trigger

Settlement is automatic. When new_paid_amount >= invoice.amount, the system:

  1. Sets invoice status to SETTLED.
  2. Sets paid_at to current UTC timestamp.