Testing in Sandbox
There is no separate test server. You call the normal base URL, https://api.rekberpay.com/v1, and the mode of the request decides whether money is real. Never put a production secret or key in a test environment, and never commit either.
Enterprise: Sandbox and Live
Every workspace has two modes. Sandbox uses test money and is open from the first day. Live moves real money and unlocks when RekberPay approves your business verification. After that you can work in both, side by side: approving your business never cancels or removes anything you made in Sandbox.
How a request picks its mode:
- A workspace API key belongs to one mode. A
rpe_test_key always acts in Sandbox, arpe_live_key always acts in Live. Keys made before the switch (rpe_with no mode in the name) act in Live if the workspace was live then, and in Sandbox otherwise. Make a key in each mode from the dashboard (Developers, with the switch on Sandbox or Live). - The dashboard and a personal key send
X-Enterprise-Mode: sandboxorX-Enterprise-Mode: live(aGETmay use?mode=instead, for downloads). Without it a request acts in Live once Live is unlocked, and in Sandbox before. - A workspace key may send the same header, but it must name the key's own mode. The other mode answers
403 KEY_MODE_MISMATCH, and a value other thansandboxorliveanswers400 INVALID_MODE. A key ignores?mode=. livebefore Live is unlocked answers403 LIVE_LOCKED. So does a Live request after RekberPay locked Live again (live_staff_locked: trueon the workspace).
mode and live_unlocked on the workspace tell you where a request landed and whether Live is open. is_sandbox is still sent as a deprecated copy of mode === "sandbox":
curl https://api.rekberpay.com/v1/enterprise/me \
-b cookies.txt \
-H "X-Enterprise-Account: $WORKSPACE_ID"const res = await fetch('https://api.rekberpay.com/v1/enterprise/me', {
headers: {
Cookie: process.env.REKBERPAY_SESSION_COOKIE, // '__Host-rekber_session=...' from POST /v1/auth/login
'X-Enterprise-Account': process.env.WORKSPACE_ID,
},
});
const data = await res.json();import os
import requests
session = requests.Session()
# The session cookie from POST /v1/auth/login
session.cookies.set("__Host-rekber_session", os.environ["REKBERPAY_SESSION"], domain="api.rekberpay.com")
resp = session.get(
"https://api.rekberpay.com/v1/enterprise/me",
headers={
"X-Enterprise-Account": os.environ["WORKSPACE_ID"],
},
timeout=30,
)
print(resp.status_code, resp.json())<?php
$ch = curl_init('https://api.rekberpay.com/v1/enterprise/me');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_COOKIEJAR => 'cookies.txt',
CURLOPT_COOKIEFILE => 'cookies.txt',
CURLOPT_HTTPHEADER => [
'X-Enterprise-Account: ' . getenv('WORKSPACE_ID'),
],
]);
$response = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);200 OK
{
"success": true,
"data": {
"account": {
"id": "4444444b-4444-4444-8444-444444444444",
"display_name": "Northline Trading",
"legal_name": "PT Northline Trading Indonesia",
"country_code": "ID",
"kyb_status": "verified",
"risk_tier": "standard",
"mode": "sandbox",
"live_unlocked": true,
"live_staff_locked": false,
"is_sandbox": true,
"settings": {
"four_eyes_threshold": 100000000,
"dispute_sla_hours": 24,
"watchlist": [
"Blacklisted Supplier"
],
"account_manager": {
"name": "Maya Patel",
"email": "[email protected]"
}
}
},
"membership": {
"id": "5555555b-5555-4555-8555-555555555555",
"role": "finance",
"joined_at": "2026-09-29T15:03:58.313Z",
"notify": {
"email": true,
"approvals": true,
"money": true,
"reminders": true,
"deals": true,
"funding": true,
"disputes": true,
"messages": true
}
},
"memberships": [
{
"account_id": "4444444b-4444-4444-8444-444444444444",
"display_name": "Northline Trading",
"role": "finance"
}
],
"invites": [],
"deal_room_enabled": true,
"preferred_locale": null
}
}In Sandbox:
- A
financemember funds a milestone withPOST .../fund. No money moves. Usemethod: "sandbox"and your ownreference. - Approvals, releases, payouts, events and webhooks work exactly as in Live, so you can test your whole integration.
- Other emails about Sandbox go to workspace members only, tagged
[Sandbox]. A counterparty never gets a test email. Team invites are sent as usual.
curl -X POST https://api.rekberpay.com/v1/enterprise/deals/eeeeeee4-eeee-4eee-8eee-eeeeeeeeeeee/milestones/fffffff4-ffff-4fff-8fff-ffffffffffff/fund \
-H "Authorization: Bearer $REKBERPAY_WORKSPACE_KEY" \
-H "Idempotency-Key: 77777775-7777-4777-8777-777777777777" \
-H "Content-Type: application/json" \
-d '{
"method": "sandbox",
"reference": "SANDBOX-TOPUP-0001"
}'const res = await fetch('https://api.rekberpay.com/v1/enterprise/deals/eeeeeee4-eeee-4eee-8eee-eeeeeeeeeeee/milestones/fffffff4-ffff-4fff-8fff-ffffffffffff/fund', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.REKBERPAY_WORKSPACE_KEY}`,
'Content-Type': 'application/json',
'Idempotency-Key': '77777775-7777-4777-8777-777777777777',
},
body: JSON.stringify({
method: "sandbox",
reference: "SANDBOX-TOPUP-0001"
}),
});
const data = await res.json();import os
import requests
resp = requests.post(
"https://api.rekberpay.com/v1/enterprise/deals/eeeeeee4-eeee-4eee-8eee-eeeeeeeeeeee/milestones/fffffff4-ffff-4fff-8fff-ffffffffffff/fund",
headers={
"Authorization": f"Bearer {os.environ['REKBERPAY_WORKSPACE_KEY']}",
"Idempotency-Key": "77777775-7777-4777-8777-777777777777",
},
json={
"method": "sandbox",
"reference": "SANDBOX-TOPUP-0001",
},
timeout=30,
)
print(resp.status_code, resp.json())<?php
$ch = curl_init('https://api.rekberpay.com/v1/enterprise/deals/eeeeeee4-eeee-4eee-8eee-eeeeeeeeeeee/milestones/fffffff4-ffff-4fff-8fff-ffffffffffff/fund');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('REKBERPAY_WORKSPACE_KEY'),
'Content-Type: application/json',
'Idempotency-Key: 77777775-7777-4777-8777-777777777777',
],
CURLOPT_POSTFIELDS => json_encode([
'method' => 'sandbox',
'reference' => 'SANDBOX-TOPUP-0001',
]),
]);
$response = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);200 OK
{
"success": true,
"data": {
"milestone": {
"id": "fffffff4-ffff-4fff-8fff-ffffffffffff",
"deal_id": "eeeeeee4-eeee-4eee-8eee-eeeeeeeeeeee",
"status": "funded",
"amount": 30000000,
"funding_method": "sandbox"
},
"deal_status": "funded"
}
}In Live the same call is refused, because the payer pays real money and RekberPay confirms it (see Fund a live deal):
409 Conflict
{
"success": false,
"error": {
"code": "LIVE_FUNDING_IS_PLATFORM_CONFIRMED",
"message": "In Live, funding is confirmed by RekberPay once the money arrives."
}
}Live unlocks when RekberPay approves your business verification. Your code does not change for deals, approvals, releases and webhooks: the same URLs and calls work with a rpe_live_ key. Only funding differs, because live money is paid with POST .../pay instead of POST .../fund.
What Sandbox does and does not do
| In Sandbox | Detail |
|---|---|
| Deals | Every deal is a test deal (is_test: true) forever. It stays in Sandbox after Live unlocks |
| Funding | POST .../fund records test money. The method you send is ignored and stored as sandbox |
| Payout instructions | Verified at once, usable for test payouts only |
| Releases | The payout is settled immediately and never reaches a bank |
| Fees | Calculated as in live, never collected |
| Linking partners | A link made in Live serves both modes; a link made in Sandbox serves Sandbox only. A Sandbox deal works with any linked partner. A Live deal needs a partner whose Live is unlocked (409 COUNTERPARTY_LIVE_LOCKED) |
| Invites | In the dashboard and by email, as in Live |
| Webhooks | Sent only to Sandbox endpoints, with livemode: false. Point your staging receiver at a Sandbox endpoint |
| Disputes | Open as usual, with files and later evidence. RekberPay resolves them. A cancellation refund is marked settled at once with is_test: true and never reaches a bank |
| Counterparty KYB | The check before a payout applies to live deals only. A sandbox release is never held for it |
What changes when Live unlocks
Nothing in Sandbox changes. Your test deals, payouts, payout instructions, keys and webhook endpoints stay as they are, and you can keep testing there. Live starts empty: make a rpe_live_ key, add a Live webhook endpoint, add live payout instructions (they wait for RekberPay's verification) and create live deals. A test deal can never release real money (409 TEST_DEAL), and a live deal is not reachable from Sandbox (404, or 409 LIVE_DEAL_IN_SANDBOX on a release). The details are in Verify your business.
What each mode keeps for itself, and what both share:
| Per mode | Shared by both modes |
|---|---|
| Deals, milestones, payouts, payout instructions, events, overview and reports | Members, counterparties, templates, settings and the default fee split |
| API keys (10 active keys per mode) and webhook endpoints (10 per mode) | Business verification, and a partner link made in Live (one made in Sandbox serves Sandbox only) |
A shared setting that also applies to Live can only be changed in Live once Live is unlocked (409 LIVE_SETTING_SANDBOX from Sandbox). In the same way, Sandbox cannot change a partner link that serves Live or a counterparty's details while that partner has live deals (409 LINK_HAS_LIVE_DEALS, 409 COUNTERPARTY_HAS_LIVE_DEALS), nor rename a counterparty that Live relies on (409 COUNTERPARTY_LIVE_VERIFIED).
Scenarios to cover
Run the happy path first (the Milestone deal end to end guide is a full script), then make each of these fail on purpose:
| Scenario | How | Expected answer |
|---|---|---|
| Deliverer approves own milestone | On a Live deal, decide with the same user or key that delivered | 409 SUBMITTER_CANNOT_APPROVE. In Sandbox the same call succeeds on a test deal |
| Release before the second approval | Release a four-eyes milestone after one approval | 409 NOT_APPROVED |
| Splits do not add up | Release with a total that differs from the milestone payout | 400 SPLITS_MISMATCH |
| Activate before the partner agrees the fee | Link two workspaces, create a deal in Sandbox, activate it before the partner answers | 409 FEE_NOT_AGREED |
| Key and header disagree | Send X-Enterprise-Mode: live with a rpe_test_ key | 403 KEY_MODE_MISMATCH |
| Two changes at once | Send two writes to the same deal at the same moment | One may answer 409 CONCURRENT_MODIFICATION. Read the deal and retry |
| Read-only key writes | Use a read key on a POST | 403 SCOPE_REQUIRED |
| Key on a dashboard route | Call /v1/enterprise/api-keys with a key | 403 KEY_NOT_ALLOWED |
| Idempotent retry | Send the same write twice with the same key | Same answer, Idempotent-Replay: true |
| Webhook signature | Change one byte of a delivery body in your receiver test | Your verifier rejects it |
Real answers for two of them:
400 Bad Request
{
"success": false,
"error": {
"code": "SPLITS_MISMATCH",
"message": "Splits must add up to the milestone amount."
}
}When the counterparty pays part of the platform fee, the message names the payout instead: "Splits must add up to the milestone payout (... amount ... minus the seller fee ...)".
403 Forbidden
{
"success": false,
"error": {
"code": "SCOPE_REQUIRED",
"message": "This API key is read-only. Create a key with the write scope."
}
}Escrows and signed links
Consumer escrows have no sandbox flag. Test with small amounts and your own test accounts, and cover these cases:
| Scenario | Expected answer |
|---|---|
A signed link with one character of sig changed | 422 SIG_MISMATCH |
expires in the past, or more than 30 days ahead | 422 LINK_EXPIRED, 422 EXPIRES_TOO_FAR |
A signed amount below 1,000 | 422 INVALID_AMOUNT |
A body amount that differs from the signed one | 422 AMOUNT_MISMATCH |
| The seller tries to pay | 403 NOT_BUYER |
| Polling before checkout started | 404 NO_PAYMENT, keep polling |
422 Unprocessable Entity
{
"success": false,
"error": {
"code": "SIG_MISMATCH",
"message": "Signature verification failed."
}
}403 Forbidden
{
"success": false,
"error": {
"code": "NOT_BUYER",
"message": "Hanya pembeli di rekber ini yang bisa membayar."
}
}Going live
Enterprise workspaces
- Submit your business verification. RekberPay reviews it in 1 to 3 business days. When it is approved, Live unlocks and your Sandbox stays as it is.
- Switch to Live in the dashboard, make a
rpe_live_key and a Live webhook endpoint, and add your live payout instructions. - Put the
rpe_live_key in production and keep therpe_test_key in staging. Each receives only its own mode's events (livemodeis the mode of the endpoint). - Run one small real deal first, paying with Fund a live deal.
Signed escrow links
- Email [email protected] with your test results.
- Receive the production link signing secret.
- Run one small real transaction first.
Next steps
- Platform mode in Sandbox: the four simulate calls for checkout, KYC, release time and bank account cooling-off
- Errors and rate limits
- Idempotency and retries