Reccurs Merchant API
The Reccurs Merchant API lets your server take one-time payments in Indonesian rupiah. You create an order, send your customer to the order's payment page, and Reccurs tells your server when the order is paid. Reccurs collects the payment and pays it out to you.
The API follows conventions you may know from Stripe: JSON with snake_case fields, typed objects with prefixed IDs, cursor pagination, metadata, idempotency keys and signed webhooks. It is not Stripe-compatible, and Stripe client libraries will not work with it.
The machine-readable contract is an OpenAPI 3.1 document at https://api.reccurs.com/v1/openapi.json.
Environments
| Live | Test | |
|---|---|---|
| API | https://api.reccurs.com |
https://sandbox-api.reccurs.com |
| API keys | rk_live_… |
rk_test_… |
| Order payment pages | https://pay.reccurs.com |
https://sandbox-pay.reccurs.com |
| Dashboard | https://www.reccurs.com |
https://sandbox.reccurs.com |
The two environments are separate: test keys, orders, customers and webhook settings never appear in live, and test payments move no money. Build and test against the test environment, then switch the base URL and key.
Get access
To start, tell us about your business. Reccurs sets up each account with you, one environment at a time.
- Sign up on the test dashboard at
https://sandbox.reccurs.comand complete onboarding. Then tell your Reccurs contact, who approves the test account and turns on one-time payments. - On the test dashboard's Developers page, a Super Admin creates an
rk_test_key and sets the test webhook endpoint. Build and test your integration. - Sign up on the live dashboard at
https://www.reccurs.comand complete onboarding, including the bank account you want payouts sent to. Reccurs verifies the bank account, approves the live account and turns on one-time payments. - Create an
rk_live_key and the live webhook endpoint, then work through the checklist before going live.
Until one-time payments are on for an account, order requests return 403 with merchant_not_enabled.
Quick start
Create an order from your server:
curl https://sandbox-api.reccurs.com/v1/orders \
-H "Authorization: Bearer $RECCURS_API_KEY" \
-H "Idempotency-Key: order-INV-1042" \
-H "Content-Type: application/json" \
-d '{
"amount": 15000000,
"currency": "IDR",
"description": "Kemeja batik, size M",
"external_reference": "INV-1042",
"return_url": "https://shop.example.com/thanks?order={ORDER_ID}"
}'
15000000 is Rp150.000; see Amounts. The response is the new order:
{
"id": "ord_3f2a9c1e7b6d4e0f8a1b2c3d4e5f6a7b",
"object": "order",
"status": "open",
"amount": 15000000,
"currency": "IDR",
"url": "https://sandbox-pay.reccurs.com/o/7Hq2Xc…",
"…": "…"
}
Then:
- Send your customer to
url, by redirect or as a link in chat or email. - Wait for the signed
order.paidwebhook. - Fulfil the purchase once.
Authentication
Send your secret key as a bearer token on every request:
Authorization: Bearer rk_test_…
A Super Admin of your Reccurs account creates and revokes keys on the dashboard's Developers page. The secret is shown once, when the key is created.
- A key reaches every Merchant API resource of its account, including resources added later. It cannot reach payouts, bank details or team management, which stay in the dashboard.
- Keep keys on your server. Never put them in a browser, a mobile app or a public repository. Keys have a fixed
rk_live_orrk_test_prefix, so secret scanners can recognize them. - To rotate a key, create the new key, deploy it, then revoke the old one.
A missing, malformed or revoked key returns 401 with api_key_invalid. A key from the other environment returns 401 with api_key_wrong_environment; its message names the host the key belongs to.
Conventions
- Requests and responses are JSON. Field names are
snake_case. Timestamps are ISO 8601 strings in UTC. - Objects. Each object carries an
objectfield, such as"object": "order". Single objects are returned unwrapped. - IDs are opaque strings of up to 255 characters with a type prefix:
ord_for orders,cus_for customers andevt_for events. Store them as strings and never parse them. - Unknown request fields are rejected with
parameter_unknown, so a misspelled field never passes silently. - Responses are private. Successful API responses carry
Cache-Control: private, no-store. Do not cache any API response.
Amounts
amount is an integer in the currency's smallest unit, as defined by ISO 4217. Rupiah has two decimal places, so amount is in hundredths of a rupiah: Rp150.000 is 15000000. This is the convention Stripe and most money libraries use.
- IDR amounts must be multiples of
100, because rupiah payments are made in whole rupiah. - The allowed range is
100000to100000000, which is Rp1.000 to Rp1.000.000. Reccurs may raise these limits. amountis the total your customer pays, including any tax. Reccurs fees are deducted from it before payout.currencyis the uppercase ISO code. OnlyIDRis accepted.
The order object
An order is one payment of a fixed amount. It has one payment page for its whole life.
{
"id": "ord_3f2a9c1e7b6d4e0f8a1b2c3d4e5f6a7b",
"object": "order",
"status": "paid",
"amount": 15000000,
"currency": "IDR",
"description": "Kemeja batik, size M",
"external_reference": "INV-1042",
"metadata": { "channel": "whatsapp" },
"customer": "cus_9b1d0000000040008000000000000001",
"customer_details": {
"external_reference": "C-77",
"name": "Sari",
"email": "sari@example.com",
"phone": "+6281234567890"
},
"url": "https://pay.reccurs.com/o/7Hq2Xc…",
"return_url": "https://shop.example.com/thanks?order={ORDER_ID}",
"expires_at": "2026-10-16T08:00:00.000Z",
"paid_at": "2026-10-15T08:03:12.000Z",
"created_at": "2026-10-15T08:00:00.000Z"
}
| Field | Description |
|---|---|
id |
The order ID. |
status |
open, paid, expired or canceled. See Order status. |
amount, currency |
The total the customer pays. See Amounts. |
description |
Shown to the customer on the payment page. |
external_reference |
Your own reference, or null. Reccurs shows it on statements and in the dashboard. It does not have to be unique. |
metadata |
Your key-value strings, returned as you sent them. An empty object when you sent none. |
customer |
The customer ID, or null. See Customers. |
customer_details |
The customer's reference, name, email and phone as given for this order, or null. |
url |
The order's payment page. It never changes, in any status. |
return_url |
Where the payment page sends the customer after payment, or null. |
expires_at |
When the order stops accepting new payments, or null. |
paid_at |
When the payment was made, or null. |
created_at |
When the order was created. |
Order status
status |
Meaning |
|---|---|
open |
The customer can pay through url. |
paid |
Paid in full. Fulfil the purchase. |
expired |
expires_at passed without payment. Release reserved stock. |
canceled |
You canceled the order before it was paid. Release the stock. |
paid, expired and canceled are final and never change. You can fulfil on paid, or release stock on expired or canceled, without ever having to undo it. Money that reaches an order after it expired or was canceled never makes it paid; Reccurs returns that money to the customer.
Create an order
POST /v1/orders with an Idempotency-Key header. It returns 200 with the order.
| Field | Rules |
|---|---|
amount |
Required. See Amounts. |
currency |
Required. IDR. |
description |
Required. Up to 2,000 characters. |
external_reference |
Optional. Up to 120 characters. Not unique: listing by it returns every match. |
return_url |
Optional. An https URL of up to 2,048 characters, without credentials. A literal {ORDER_ID} in it is replaced with the order ID when the customer is sent there. |
expires_at |
Optional. An ISO 8601 timestamp with a time zone, from 30 minutes to 7 days after creation. The default is 24 hours after creation. |
metadata |
Optional. Up to 50 keys of up to 40 characters, each with a string value of up to 500 characters. Not searchable. |
customer |
Optional. An existing customer ID. Send customer or customer_details, not both. |
customer_details |
Optional. See Customers. |
Customers
Customers are optional. They let you see one customer's orders together in the dashboard.
customer_details.external_reference, required withincustomer_details, is your own ID for the customer, up to 120 characters. Reccurs finds the customer with that reference or creates one, and returns its ID incustomer.customer_details.name(up to 200 characters),email(a valid address) andphone(E.164, for example+6281234567890) are optional and stored on this order only.- To reuse a customer without sending details, send its ID as
customer.
Idempotency and retries
POST /v1/orders requires an Idempotency-Key header of 1 to 200 visible ASCII characters, with no spaces.
- Sending the same key with the same body returns the same order, in its current state. This holds even when the first request's response was lost.
- Sending the same key with a different body returns
409withidempotency_key_reused. - Reccurs honors a key for at least 24 hours.
Derive the key from your own order ID, for example order-INV-1042, and save it with the request body before you send it. A random key per attempt defeats the protection: after a timeout or crash your retry would create a second order.
If a request times out or returns a 5xx status, retry it with the same key and body. Read requests and POST /v1/orders/{id}/cancel are safe to repeat and take no key.
Send the customer to the payment page
url is the order's payment page. It works the same whether you redirect your customer to it or send it as a link, and it stays the same for the order's whole life.
- The page leads with your business name, then the amount and the
description. One small line says the payment is processed by Reccurs, because the payment provider's screens and the customer's payment history show Reccurs. Tell customers to expect that name. - Opening the page starts nothing. Chat apps and email scanners that preview links are safe. A payment starts only when the customer chooses Pay.
- If a payment attempt runs out of time or the customer leaves it, they can return to the same page and pay again. You never need a new link.
- After payment the page shows a confirmation, which the customer can keep as a receipt. With a
return_url, it then offers a button back to your site and forwards the customer there after a few seconds. - An order that is expired or canceled shows "This payment link is no longer active". A paid order keeps showing its confirmation. Pages keep working for at least 90 days after the order ends.
The live payment methods are currently GoPay, QRIS, OVO, and Danamon and SeaBank virtual accounts. The methods may change; your integration does not depend on them.
Do not fulfil on the redirect. A customer reaching your return_url does not prove payment, since anyone can open that URL. Fulfil on a verified order.paid webhook, or after GET /v1/orders/{id} returns status: paid.
Retrieve and list orders
GET /v1/orders/{id} returns one order. An unknown ID, or an order of another account, returns 404 with resource_missing.
GET /v1/orders returns orders newest first:
{ "object": "list", "data": [{ "id": "ord_…", "object": "order", "…": "…" }], "has_more": true }
| Parameter | Description |
|---|---|
limit |
1 to 100, default 20. |
starting_after |
An order ID. Returns the page of older orders after it. |
ending_before |
An order ID. Returns the page of newer orders before it. |
status |
open, paid, expired or canceled. |
external_reference |
Exact match. |
To read every page, pass the last order's id as starting_after until has_more is false. Send starting_after or ending_before, not both. Lists have no total count.
Expiry and cancellation
Expiry. No new payment can start after expires_at. A customer who started paying just before then can finish. Once any payment in progress has ended, the order becomes expired and Reccurs sends order.expired, typically within 20 minutes of expires_at. If that last payment succeeds, the order becomes paid instead.
Cancellation. POST /v1/orders/{id}/cancel stops the payment link at once.
- If no payment is in progress, the order becomes
canceled. The response is200with the order, and Reccurs sendsorder.canceled. - If a payment may still be in progress, Reccurs closes it with the payment provider. When that cannot be confirmed yet, the response is
409withorder_cancel_pending. No new payment can start, and the order becomescanceled, withorder.canceled, once the payment has ended. If the customer completes that payment first, the order becomespaidand you receiveorder.paidinstead. - Canceling a canceled order returns
200with the order. A paid or expired order returns409withorder_not_cancelable.
Webhooks
A Super Admin sets your webhook endpoint on the dashboard's Developers page, which shows its signing secret (whsec_…). The endpoint must be a public https URL on port 443. Each environment has its own endpoint and secret.
Events
| Type | Sent when |
|---|---|
order.paid |
The order was paid in full. |
order.expired |
The order expired without payment. |
order.canceled |
The order was canceled without payment. |
Each order produces at most one of these events, because its final status never changes.
{
"id": "evt_8c0e5a2b1d3f4a6b9c8d7e6f5a4b3c2d",
"object": "event",
"type": "order.paid",
"api_version": "v1",
"created_at": "2026-10-15T08:03:13.000Z",
"data": {
"object": {
"id": "ord_3f2a9c1e7b6d4e0f8a1b2c3d4e5f6a7b",
"object": "order",
"status": "paid",
"…": "…"
}
}
}
data.object is the full order as of the event, in the same shape GET /v1/orders/{id} returns. You can parse both with one parser. Before fulfilling, check that the order's ID, amount and currency match the purchase you saved.
Verify the signature
Webhooks are signed with Standard Webhooks. Libraries that verify them exist for most languages, or you can verify them yourself:
- Read the
webhook-id,webhook-timestampandwebhook-signatureheaders. - Reject the request if
webhook-timestamp(Unix seconds) is more than 5 minutes from your clock. - Compute HMAC-SHA256 over
{webhook-id}.{webhook-timestamp}.{raw body}. The key is the secret's text afterwhsec_, base64-decoded. webhook-signatureholds one or more space-separated values of the formv1,{base64 signature}. Accept the request if any of them equals your result, using a constant-time comparison.
Verify against the raw request body, before any JSON parsing; re-serialized JSON will not match. Then check that the body's id equals webhook-id.
import { createHmac, timingSafeEqual } from 'node:crypto';
function verify(secret, headers, rawBody) {
const id = headers['webhook-id'];
const timestamp = headers['webhook-timestamp'];
if (Math.abs(Date.now() / 1000 - Number(timestamp)) > 300) return false;
const key = Buffer.from(secret.slice('whsec_'.length), 'base64');
const expected = createHmac('sha256', key).update(`${id}.${timestamp}.${rawBody}`).digest();
return headers['webhook-signature'].split(' ').some(value => {
const given = Buffer.from(value.replace(/^v1,/, ''), 'base64');
return (
value.startsWith('v1,') &&
given.length === expected.length &&
timingSafeEqual(given, expected)
);
});
}
Delivery
- Respond with any
2xxstatus within 5 seconds. Any other status, a timeout or a redirect counts as a failure; Reccurs does not follow redirects. - Delivery is at least once, so the same event can arrive more than once. Store each event
idyou process, and ignore repeats. - Events can arrive in any order. When order matters, fetch the order.
- Failed deliveries are retried with increasing delays for at least 2 hours. After that, a Super Admin can resend an event from the delivery history on the Developers page. A resent event keeps its
idand body. - Changing the endpoint or its secret pauses deliveries still queued for the old one. Resend them from the delivery history if you need them.
- Requests come with
Content-Type: application/jsonandUser-Agent: Reccurs-Webhooks/1.
Record the event and queue your fulfilment in one database transaction before you respond. The same order must never be fulfilled twice, even if a webhook and a status check both report it as paid.
Fees and payouts
Fees and payouts are handled on the dashboard. API keys cannot reach them.
- Fees. Reccurs deducts its fee from each paid order at your agreed rate. The dashboard's page for each payment shows the amount paid, the Reccurs fee and your net earnings.
- When money becomes available. Net earnings stay pending until the payment provider settles the payment. Danamon virtual account payments become available two business days after payment, GoPay, QRIS and SeaBank virtual account payments three, and OVO payments four, counting Monday to Friday. Each payment shows the date its money becomes available.
- Payout method. During onboarding you choose automatic or manual payouts. You can change this until Reccurs approves your account.
- Automatic payouts. A Super Admin withdraws from the available balance on the Withdraw funds page, and Reccurs sends the transfer to your verified bank account automatically. The page shows the minimum and fee.
- Manual payouts. A Super Admin requests a withdrawal from the available balance on the Withdraw funds page, and the amount is reserved at once. Reccurs transfers it to your verified bank account and marks the withdrawal paid. A request can be canceled until Reccurs starts processing it.
- Statements. The Money pages show your balance and money history, and export it as CSV.
Refunds
Reccurs does not support refunds. A paid order cannot be refunded, through the API or by contacting Reccurs.
Errors
Errors use HTTP status codes and a JSON body:
{
"error": {
"code": "parameter_invalid",
"message": "amount must be an integer multiple of 100 from 100000 to 100000000",
"param": "amount",
"request_id": "8f6e1c2a-5b7d-4e3f-9a1b-0c2d3e4f5a6b"
}
}
code is stable, and your code can branch on it. message is for people and may change. param names the field at fault, when there is one. Include request_id when you contact Reccurs about an error.
| Status | code |
Meaning |
|---|---|---|
| 400 | parameter_missing |
A required field or header is missing. |
| 400 | parameter_invalid |
A field or header has an invalid value. |
| 400 | parameter_unknown |
The request has a field the API does not accept. |
| 401 | api_key_invalid |
The key is missing, malformed or revoked. |
| 401 | api_key_wrong_environment |
The key belongs to the other environment. |
| 403 | merchant_not_enabled |
Your account is not enabled for one-time payments. |
| 404 | resource_missing |
No such order in your account. |
| 409 | idempotency_key_reused |
The Idempotency-Key was used with a different body. |
| 409 | order_not_cancelable |
The order is paid or expired. |
| 409 | order_cancel_pending |
A payment in progress is being closed; the order is canceled once it ends. |
| 409 | state_conflict |
The request conflicts with the current state of your account or the order. |
| 429 | rate_limited |
Too many requests. Wait for the number of seconds in Retry-After. |
| 500 | internal_error |
Something failed at Reccurs. Retry with the same idempotency key. |
| 503 | service_unavailable |
The API or a payment provider is temporarily unavailable. Retry with backoff. |
Rate limits
Limits apply per API key. A request over the limit returns 429 with rate_limited and a Retry-After header in seconds. Wait that long before retrying. The limits are generous for normal use, and Reccurs may change them.
Compatibility policy
The v1 API changes only in ways that keep working integrations working. Reccurs may make these changes without notice:
- add fields to responses and to event payloads;
- add event types;
- add values to enumerations, including
status; - add error codes;
- add optional request parameters;
- change the format or length of IDs, payment page tokens and URLs, within 255 characters.
Your integration must therefore:
- ignore response and event fields it does not know;
- acknowledge event types it does not handle with a
2xxresponse; - handle an unknown
statusor errorcodewithout failing; - treat IDs and URLs as opaque strings.
Request validation stays strict: an unknown request field is rejected, never ignored. A change that breaks this policy ships as a new version, /v2, alongside /v1.
The numbers in this guide are minimums or typical values: idempotency keys are honored for at least 24 hours, failed webhooks are retried for at least 2 hours, payment pages work for at least 90 days after the order ends, and orders typically expire within 20 minutes of expires_at.
Testing
Use an rk_test_ key from the test dashboard at https://sandbox.reccurs.com against https://sandbox-api.reccurs.com. Test orders open test payment pages on https://sandbox-pay.reccurs.com, where payments are simulated.
To pay a test order, open its url, choose Pay and select BCA virtual account. Copy the account number into the BCA virtual account simulator, inquire, then pay. A test payment attempt times out after a few minutes; open the order's url again to start a new one.
The test checkout offers BCA virtual account, while live offers GoPay, QRIS, OVO, and Danamon and SeaBank virtual accounts. Orders, statuses and webhooks behave the same whichever method pays, so nothing in your integration depends on it. Never pay a test order with real money.
Other cases to test:
- Expiry: create an order with
expires_at30 minutes ahead and do not pay it. It becomesexpiredand you receiveorder.expired. - Cancellation: cancel an open order and expect
200, or409withorder_cancel_pendingif you started paying it. - Retries: send the same create request twice with the same
Idempotency-Key, then once with a changed body. - Webhook failures: return
500from your endpoint once, and check that the retried event is processed exactly once.
To receive test webhooks on your own machine, expose your local endpoint through an HTTPS tunnel and set the tunnel URL as the test endpoint.
Checklist before going live
- Reccurs has approved your live account and turned on one-time payments.
- Your API key and webhook secret are stored on your server only.
- You save each purchase and its idempotency key before calling
POST /v1/orders, and retry with the same key. - You fulfil only on a verified
order.paidevent or apaidorder read, and at most once per order. - You release reserved stock on
order.expiredandorder.canceled. - Your webhook handler verifies signatures, deduplicates by event
id, and acknowledges unknown event types. - Your code ignores unknown fields and handles unknown
statusand errorcodevalues. - You log
request_idfrom error responses. - You switched to
https://api.reccurs.com, anrk_live_key and the live webhook secret.