Skip to content

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, a rpe_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: sandbox or X-Enterprise-Mode: live (a GET may 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 than sandbox or live answers 400 INVALID_MODE. A key ignores ?mode=.
  • live before Live is unlocked answers 403 LIVE_LOCKED. So does a Live request after RekberPay locked Live again (live_staff_locked: true on 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":

bash
curl https://api.rekberpay.com/v1/enterprise/me \
  -b cookies.txt \
  -H "X-Enterprise-Account: $WORKSPACE_ID"
js
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();
python
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
<?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

json
{
    "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 finance member funds a milestone with POST .../fund. No money moves. Use method: "sandbox" and your own reference.
  • 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.
bash
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"
  }'
js
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();
python
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
<?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

json
{
    "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

json
{
    "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 SandboxDetail
DealsEvery deal is a test deal (is_test: true) forever. It stays in Sandbox after Live unlocks
FundingPOST .../fund records test money. The method you send is ignored and stored as sandbox
Payout instructionsVerified at once, usable for test payouts only
ReleasesThe payout is settled immediately and never reaches a bank
FeesCalculated as in live, never collected
Linking partnersA 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)
InvitesIn the dashboard and by email, as in Live
WebhooksSent only to Sandbox endpoints, with livemode: false. Point your staging receiver at a Sandbox endpoint
DisputesOpen 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 KYBThe 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 modeShared by both modes
Deals, milestones, payouts, payout instructions, events, overview and reportsMembers, 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:

ScenarioHowExpected answer
Deliverer approves own milestoneOn a Live deal, decide with the same user or key that delivered409 SUBMITTER_CANNOT_APPROVE. In Sandbox the same call succeeds on a test deal
Release before the second approvalRelease a four-eyes milestone after one approval409 NOT_APPROVED
Splits do not add upRelease with a total that differs from the milestone payout400 SPLITS_MISMATCH
Activate before the partner agrees the feeLink two workspaces, create a deal in Sandbox, activate it before the partner answers409 FEE_NOT_AGREED
Key and header disagreeSend X-Enterprise-Mode: live with a rpe_test_ key403 KEY_MODE_MISMATCH
Two changes at onceSend two writes to the same deal at the same momentOne may answer 409 CONCURRENT_MODIFICATION. Read the deal and retry
Read-only key writesUse a read key on a POST403 SCOPE_REQUIRED
Key on a dashboard routeCall /v1/enterprise/api-keys with a key403 KEY_NOT_ALLOWED
Idempotent retrySend the same write twice with the same keySame answer, Idempotent-Replay: true
Webhook signatureChange one byte of a delivery body in your receiver testYour verifier rejects it

Real answers for two of them:

400 Bad Request

json
{
    "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

json
{
    "success": false,
    "error": {
        "code": "SCOPE_REQUIRED",
        "message": "This API key is read-only. Create a key with the write scope."
    }
}

Consumer escrows have no sandbox flag. Test with small amounts and your own test accounts, and cover these cases:

ScenarioExpected answer
A signed link with one character of sig changed422 SIG_MISMATCH
expires in the past, or more than 30 days ahead422 LINK_EXPIRED, 422 EXPIRES_TOO_FAR
A signed amount below 1,000422 INVALID_AMOUNT
A body amount that differs from the signed one422 AMOUNT_MISMATCH
The seller tries to pay403 NOT_BUYER
Polling before checkout started404 NO_PAYMENT, keep polling

422 Unprocessable Entity

json
{
    "success": false,
    "error": {
        "code": "SIG_MISMATCH",
        "message": "Signature verification failed."
    }
}

403 Forbidden

json
{
    "success": false,
    "error": {
        "code": "NOT_BUYER",
        "message": "Hanya pembeli di rekber ini yang bisa membayar."
    }
}

Going live ​

Enterprise workspaces

  1. 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.
  2. Switch to Live in the dashboard, make a rpe_live_ key and a Live webhook endpoint, and add your live payout instructions.
  3. Put the rpe_live_ key in production and keep the rpe_test_ key in staging. Each receives only its own mode's events (livemode is the mode of the endpoint).
  4. Run one small real deal first, paying with Fund a live deal.

Signed escrow links

  1. Email [email protected] with your test results.
  2. Receive the production link signing secret.
  3. Run one small real transaction first.

Next steps ​

Escrow, payment services and B2B deals for Indonesian businesses.