Skip to main content
This service is available in v3 only, and in Brazil only.

What is Accounts Payable?

The Accounts Payable API lets you initiate and track Pix payments from your Clara digital account. Payments created through the API go through the same authorization, validation, and audit controls as payments made in the Clara web app. You can use this API to:
  • Pay to a Pix key, a QR code, or bank details
  • Pay immediately or schedule a payment for a later date
  • Cancel a scheduled payment before it runs
  • Track each payment until it settles, and list payments with filters

Available Endpoints

Creating and cancelling payments requires the write:accounts-payable/pix grant on your API credential. Getting and listing payments requires read:digital-account.

How payment creation works

Creating a payment is asynchronous. The API answers 202 Accepted as soon as it accepts the request. It does not wait for the money to move.
A 202 means accepted for processing, never paid. Always poll the payment to learn its real outcome.
  • Observe the outcome by polling GET /v3/accounts-payable/{externalId}.
  • Every payment reaches a terminal status (PAID, FAILED, or CANCELLED) within 3 hours at worst.

Idempotency with externalId

You generate the externalId (a UUID) yourself. It must be unique within your company.
  • Sending the same externalId again answers 202 without creating a second payment. It is safe to retry a create that timed out.
  • A new payment always needs a new externalId.
If a create times out or returns 503, poll the payment by its externalId before you send it again. It may already exist.

Choosing the destination

There is no destination type field. The API infers the destination from which fields you populate: dictKey and qrCode are mutually exclusive. Sending both, or no destination at all, is rejected with INVALID_REQUEST. amount sits at the root of the request:
  • Required for Pix-key and bank-details payments.
  • Optional for QR payments, where the QR itself can define the amount.
dictKeyType is required whenever you send dictKey: CPF, CNPJ, EMAIL, PHONE, or EVP. CPF and CNPJ keys are both digit strings, so the type cannot be inferred from the value. For a Pix-key or QR payment you can optionally send beneficiary.documentNumber as an owner assertion. For a bank-details payment the full beneficiary is required, and accountType uses the ISO 20022 values:

Scheduling

Add paymentMethod.desiredPaymentDate (YYYY-MM-DD, America/Sao_Paulo) to schedule a payment. Omit it to pay immediately.
  • The earliest date you can schedule is D+1.
  • The payment provider decides how weekends and Brazilian bank holidays are handled.
  • A dynamic immediate (cob) QR cannot be scheduled.

Create a Pix payment

Endpoint

POST /v3/accounts-payable/pix
cURL

Sample JSON Response — 202 Accepted

JSON
amount is null while an amount-less QR is still being resolved.

Synchronous errors


Cancel a scheduled payment

Only scheduled payments that have not started executing can be cancelled.

Endpoint

DELETE /v3/accounts-payable/pix/{externalId}

cURL Request

cURL
A successful cancellation returns 204 No Content.
A cancellation can lose a race against execution. If the payment started settling first, you get NOT_CANCELLABLE. Poll the payment to see its final status.

Get a payment

Endpoint

GET /v3/accounts-payable/{externalId}

cURL Request

cURL

Sample JSON Response

JSON

Statuses

Refunds are not exposed at launch. A refunded payment remains PAID.

When a payment fails

A FAILED payment carries an error object:
JSON
Integrate against code, not message. The code is the stable contract. The message is informational: it may be reworded without a version change, and it is English-only at launch.

List payments

Endpoint

GET /v3/accounts-payable

Query Parameters (Optional)

Dates are YYYY-MM-DD in America/Sao_Paulo, and range bounds are inclusive. Sorting: one key per request. Allowed fields are creationDate, amount, and status; direction is asc or desc. The default is creationDate,desc.
paymentDate can be filtered on (through paidFrom/paidTo) and is returned on every payment, but it is not sortable.

cURL Request

cURL

Sample JSON Response

JSON

Rate limits and outages

  • A 429 comes from the gateway with no body. The X-RateLimit-Remaining, X-RateLimit-Replenish-Rate, X-RateLimit-Burst-Capacity, and X-RateLimit-Requested-Tokens headers carry the quota state. There is no Retry-After header.
  • A 503 means the payment service could not be reached or answered outside its contract. Retry later, and poll the payment by externalId before you submit it again.
⚠️ Note: The sample data shown is for illustration only and does not represent real payments or account details.