Merchants integrate once. PayConsults routes each payment to an eligible
provider based on country, currency, payment method and what that merchant
is approved to use, then normalises the provider's statuses, errors and
webhooks into one shape.
Amounts are integers in minor units. 15000 is 150.00 BRL. Zero-decimal
currencies exist — 15000 IDR really is 15000.
Test and live are separate. A pc_test_ key reaches only the built-in
sandbox; a pc_live_ key never does.
The webhook is what proves payment, not the customer arriving back on
your return_url — anyone can visit that URL.
Recurring is explicit. A payment is a recurring charge only when it was
taken against a mandate — a standing authorisation the customer agreed to.
A customer who buys the same thing twice in two months has made two one-off
payments, and both will report is_recurring: false. Nothing is inferred
from the customer, the payment method, the amount or the interval.
Download the OpenAPI document →
Your API key: Authorization: Bearer pc_test_… or pc_live_….
curl https://api.payconsults.com/v1/payments \ -H "Authorization: Bearer pc_test_..."
Returns a redirect_url — send the customer there. Omit payment_method to use provider-hosted checkout, where the customer chooses on the provider's page and no method-specific fields are required.
| Idempotency-Key | header | Replaying a key returns the first response instead of acting twice. Reusing one with a different body is an error. 8–255 characters. |
| Field | Type | Description |
|---|---|---|
| merchant_reference required | string | Your own order id. Must be unique for you, and is echoed on every webhook. "ORDER-1001"
|
| deposit_group | string | Optional. Your id for the underlying order or deposit, shared by every attempt at it. While an attempt in the group is still in flight a new one is refused with DEPOSIT_GROUP_IN_FLIGHT and the live attempt is returned in error.detail, so you can send the customer back to the checkout they already have instead of opening a second payable one. Once every attempt is failed, expired or cancelled, a retry is allowed. Omit it and nothing changes. "DEP-99312"
|
| amount required | integer | Minor units. 15000 is 150.00 BRL. 15000
|
| currency required | string | ISO-4217. "BRL"
|
| country required | string | ISO-3166 alpha-3. "BRA"
|
| payment_method | string | Omit for provider-hosted checkout.
bank_transferboletocarddanahosted_checkoutidealmobile_moneympesaovopay_with_bankpixqrissbpshopeepaystcpaytabbyupi |
| payment_method_data | object | Fields a specific method needs that the shared model does not own, e.g. {"vpa":"customer@upi"}.
|
| provider | string | Pin to one provider. Fails rather than substituting if it cannot serve the request.
sandboxdukpaykorapay |
| return_url | string | Where the customer lands afterwards. |
| statement_descriptor | string | Shown on the checkout page and, where supported, the statement. |
| customer | Customer | |
| metadata | object | Yours. Stored and returned untouched. |
200This reference already existed, or the Idempotency-Key was replayed.
201Created.
401Missing or invalid API key.
402The provider declined the payment outright.
403This merchant is not enabled for that country or method.
409A payment for this reference is already being created.
422The request was understood but cannot be fulfilled.
429Rate limited. Obey `Retry-After`.
| limit | query | How many to return, 1–100. |
| starting_after | query | A next_cursor from a previous page. |
| status | query | Only this status. createdpendingprocessingsucceededfailedcancelledexpiredrefundedpartially_refunded |
| currency | query | ISO-4217, e.g. BRL. |
| country | query | ISO-3166 alpha-3, e.g. BRA. |
| provider | query | Only payments routed to this provider. sandboxdukpaykorapay |
| search | query | Match a merchant reference or provider transaction id. |
200A page of payments, newest first.
401Missing or invalid API key.
Looks up by your own reference. If the payment has not reached a final state, the provider is asked for the latest before answering.
| merchant_reference required | path | The reference you supplied when creating it. |
| refresh | query | Set false to skip asking the provider. |
200The payment.
404No payment with that reference.
Only a payment that has not settled. Where the provider offers no cancel operation the payment is still marked cancelled here, and provider_notified is false.
| merchant_reference required | path | The reference to cancel. |
200Cancelled.
404No payment with that reference.
422Already settled, so no longer cancellable.
Omit amount to refund whatever is left. The payment moves to partially_refunded, then refunded once nothing remains.
| Idempotency-Key | header | Replaying a key returns the first response instead of acting twice. Reusing one with a different body is an error. 8–255 characters. |
| Field | Type | Description |
|---|---|---|
| payment_reference required | string | The merchant_reference of the payment. |
| amount | integer | Minor units. Omit to refund what remains. |
| merchant_reference | string | Your id for this refund. |
| reason | string |
201Accepted.
404No payment with that reference.
422Not refundable, or more than remains.
Disburse funds to a beneficiary. The payout moves to processing, then succeeded or failed.
| Idempotency-Key | header | Replaying a key returns the first response instead of acting twice. Reusing one with a different body is an error. 8–255 characters. |
| Field | Type | Description |
|---|---|---|
| merchant_reference required | string | Your unique reference for this payout. |
| amount required | integer | Minor units (e.g. 1500 for 15.00). |
| amount_decimal | string | Human decimal string alternative (e.g. "15.00"). |
| currency required | string | Three-letter ISO code. |
| country | string | Three-letter ISO country code. |
| payment_method | string | Disbursement method (e.g. pix, bank_transfer). |
| beneficiary required | object | Recipient account and identity information. |
| provider | string | Explicit provider override if desired. |
| provider_options | object | Pass-through provider options. |
201Created.
422No capable provider or invalid payout parameters.
| limit | query | Page size, 1 to 100. |
| status | query | Filter by payout status. |
200Payouts, newest first.
| merchant_reference required | path | Your reference for the payout. |
| refresh | query | false skips asking the PSP and serves from cache. |
200The payout.
404No such payout.
Returns a redirect_url the customer must complete. Until they do, the mandate is pending and cannot be charged. This is the only way a payment ever becomes recurring.
| Field | Type | Description |
|---|---|---|
| merchant_reference required | string | Your id for this authorisation. |
| country required | string | |
| currency required | string | |
| payment_method | string |
bank_transferboletocarddanahosted_checkoutidealmobile_moneympesaovopay_with_bankpixqrissbpshopeepaystcpaytabbyupi |
| provider | string |
sandboxdukpaykorapay |
| customer | Customer | |
| metadata | object |
201Created.
422The chosen provider does not support recurring charges.
200Authorisations, newest first.
| merchant_reference required | path | Your reference for the authorisation. |
200The authorisation.
404No such authorisation.
Cancels every subscription billing against it too. Consent withdrawn must stop the money, not just the record of it.
| merchant_reference required | path | The authorisation to withdraw. |
200Cancelled.
Bills an existing mandate on a schedule. Where the provider runs its own scheduler we mirror it; otherwise PayConsults runs the clock, retries failed renewals, and gives up only after the dunning schedule is exhausted.
| Field | Type | Description |
|---|---|---|
| merchant_reference required | string | |
| mandate_id required | string | An authorisation the customer has completed. |
| amount required | integer | Minor units, charged each period. |
| currency required | string | |
| interval required | string |
dayweekmonthyear |
| interval_count | integer | e.g. interval month, count 3 = quarterly. |
| total_periods | integer | Stop after this many. Omit to run until cancelled. |
| start_now | boolean | False to bill at the end of the first period. |
| description | string | |
| metadata | object |
201Created.
404No such mandate.
422The mandate is cancelled or failed.
| status | query | Only this status. pending_mandateactivepast_duepausedcancelledcompleted |
200Subscriptions, newest first.
Includes every charge billed against it, in order.
| merchant_reference required | path | Your reference for the subscription. |
200The subscription, with its charges.
404No such subscription.
| merchant_reference required | path | The subscription to cancel. |
| Field | Type | Description |
|---|---|---|
| at_period_end | boolean | Let the paid period run out first. |
200Cancelled.
| merchant_reference required | path | The subscription to pause. |
200Paused.
422The provider runs this schedule, so it cannot be paused here.
| merchant_reference required | path | The subscription to resume. |
200Resumed.
The providers connected to this merchant, intersected with what they are approved for. Carries the limits and required fields for each, so a checkout page can be built without guessing.
| country | query | Filter by country. |
| currency | query | Filter by currency. |
200Available methods.
200Connected providers, in precedence order.
Every attempt, successful or not, for debugging your endpoint.
200Recent delivery attempts.
| Field | Type | Description |
|---|---|---|
| object | string | |
| payment_id | string | Ours. Quote this to support. "pay_9f2c…"
|
| merchant_reference | string | Yours. |
| status | string |
createdpendingprocessingsucceededfailedcancelledexpiredrefundedpartially_refunded |
| amount | integer | Minor units. |
| currency | string | |
| country | string | |
| payment_method | string | null | |
| redirect_url | string | null | Send the customer here. |
| qr_code | string | null | |
| failure_code | string | null | |
| failure_message | string | null | |
| fees | object | |
| amount_refunded | integer | Minor units returned so far. |
| deposit_group | string | null | The order or deposit this attempt belongs to, if you sent one. |
| expired_by | string | null | Set only when status is expired. provider means the PSP closed the checkout session: final, nothing more will arrive. gateway means our clock gave up without a verdict, so a late settlement can still land and will still be webhooked. Providers differ — Korapay reports expiry, DukPay has no expired status at all and emits nothing for an abandoned checkout, which is why the clock exists.
providergateway |
| expires_at | string | null | When this attempt stops being payable. Past it the status becomes expired and the deposit group reopens for a retry. expired means we stopped waiting, not that the payment was declined: a settlement arriving afterwards is still accepted and still webhooked.
|
| is_recurring | boolean | True only when this charge was billed against a subscription. A repeat purchase by the same customer, with the same method, is false. |
| mandate_id | string | null | The standing authorisation used, if any. |
| subscription_id | string | null | The subscription billed, if any. |
| initiator | string | customer when they were present; merchant when a stored authorisation was charged.
customermerchant |
| sequence | integer | null | Which period of the subscription this is. |
| reconciliation_date | string | null | YYYY-MM-DD, where the provider reports one. |
| created_at | string | |
| updated_at | string | |
| provider | object |
Every provider's own vocabulary maps into exactly these.
Branch on code. It is stable; the message may be reworded.
{
"error": {
"code": "AMOUNT_BELOW_MINIMUM",
"type": "invalid_request",
"message": "The minimum for boleto in BRA is 500 minor units.",
"param": "amount",
"request_id": "req_9f2c…"
}
}
We POST to your configured URL, signed asPayConsults-Signature: t=<unix>,v1=<hex hmac> — an HMAC-SHA256 of"<timestamp>.<raw body>" using your webhook secret. Compare in constant
time, reject anything older than five minutes, and answer 200 quickly.
Failures are retried with backoff, so make handling idempotent.
data is the same shape this API returns, so one parser handles both.
{
"id": "evt_…",
"type": "payment.succeeded",
"created_at": "2026-09-08T09:00:00.000Z",
"data": {
"object": "payment",
"payment_id": "pay_…",
"merchant_reference": "ORDER-1001",
"status": "succeeded"
}
}