Ask for an invitation
Menu

Endpoint

Approve or advance a test refund, payout or conversion

POST/v1/test/money_out/{id}/advance

Test mode has no wallets and no funds, so there is nothing for a passkey to sign. This helper stands in for the approver and the chain. {id} is an rf_, po_, pob_ or cv_ id. Besides payouts:write, a restricted key needs the write scope of the object it acts on (04 Scopes): refunds:write for a refund, conversions:write for a conversion; without it the call answers insufficient_scope naming that scope and nothing changes.

Scope a restricted key needs
payouts:write
Publishable key
Not allowed: secret or restricted key only
Idempotency-Key
Recommended. It makes a retry safe.

Parameters

Parameters of Approve or advance a test refund, payout or conversion
ParameterType and placeMeaning
idrequiredstringpathThe id of the refund, payout, batch or conversion.
Orrerie-VersionstringheaderAPI version date. Default: the version the key was created with. Example 2026-10-11.
Idempotency-KeystringheaderMakes a retry safe. Kept 24 hours. 1 to 255 characters.

Request body

A JSON object. The body is required. A field the call does not list is refused with parameter_unknown.

Request body of Approve or advance a test refund, payout or conversion
FieldTypeMeaning
torequiredstringThe state to move to. Skipped states are passed through, each with its event. awaiting_approval stands in for the payer using the claim link; cancelled for a member rejecting; draft for the 7-day lapse. One of awaiting_approval, signed, sent, confirmed, failed, unknown, cancelled, draft.
failure_codestringWith failed: any failure code from the failure codes of money out.

Example request

curl

curl https://api.orrerie.com/v1/test/money_out/po_351ggq5kz6kxwpfrhp5qh3b0/advance \
  -H "Authorization: Bearer $ORRERIE_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "to": "confirmed"
}'

JavaScript

const response = await fetch("https://api.orrerie.com/v1/test/money_out/po_351ggq5kz6kxwpfrhp5qh3b0/advance", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.ORRERIE_SECRET_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "to": "confirmed"
  }),
});
const result = await response.json();
if (!response.ok) throw new Error(`${result.error.code}: ${result.error.message}`);
console.log(result);

Python

import os
import requests

response = requests.post(
    "https://api.orrerie.com/v1/test/money_out/po_351ggq5kz6kxwpfrhp5qh3b0/advance",
    headers={"Authorization": f"Bearer {os.environ['ORRERIE_SECRET_KEY']}"},
    json={
        "to": "confirmed",
    },
    timeout=30,
)
result = response.json()
if not response.ok:
    raise RuntimeError(f"{result['error']['code']}: {result['error']['message']}")
print(result)

PHP

<?php
$request = curl_init('https://api.orrerie.com/v1/test/money_out/po_351ggq5kz6kxwpfrhp5qh3b0/advance');
curl_setopt_array($request, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('ORRERIE_SECRET_KEY'),
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => json_encode([
        'to' => 'confirmed',
    ]),
]);
$body = curl_exec($request);
if ($body === false) {
    throw new RuntimeException(curl_error($request));
}
$result = json_decode($body, true);
if (curl_getinfo($request, CURLINFO_HTTP_CODE) >= 400) {
    throw new RuntimeException($result['error']['code'] . ': ' . $result['error']['message']);
}
print_r($result);

Responses

200 OK

The answer is the payout object. Headers: Orrerie-Request-Id.

Example response, 200

{
  "id": "po_351ggq5kz6kxwpfrhp5qh3b0",
  "object": "payout",
  "livemode": false,
  "created": "2026-10-12T09:30:00.000Z",
  "updated": "2026-10-12T09:30:00.000Z",
  "kind": "payout",
  "status": "confirmed",
  "pending_reason": null,
  "batch": null,
  "source": {
    "wallet": "wal_bsfw07hymawmda7gg8jsyy3g",
    "asset": "base:usdc",
    "amount": "250.000000"
  },
  "destination": {
    "saved_address": "dst_92jw0br3z1bzkk45ddjqcm6q",
    "address": "0xD1220A0cf47c7B9Be7A2E6BA89F429762e7b9aDb",
    "network": "base",
    "asset": "base:usdc"
  },
  "delivery": {
    "rail": "direct",
    "amount_estimated": "250.000000",
    "route_fee": null,
    "fee_bearer": null
  },
  "value": {
    "amount": "250.00",
    "currency": "USD"
  },
  "description": "October green beans",
  "reference": "PO-2210",
  "network_fee": null,
  "requested_by": {
    "type": "api_key",
    "id": "key_6e3gg2c6ea176xxdek2nar6v"
  },
  "approved_by": null,
  "approval_url": "https://merchant.orrerie.com/approve/po_351ggq5kz6kxwpfrhp5qh3b0",
  "approval_expires_at": "2026-10-19T09:30:00.000Z",
  "transaction_hash": "0xa8c0cce8bb067e91cf2766c26be4e5d7cfba3d3323dc19d08a834391a1ce5acf",
  "failure_code": null,
  "cancellation_reason": null,
  "approved_at": "2026-10-12T09:41:00.000Z",
  "sent_at": "2026-10-12T09:41:00.000Z",
  "confirmed_at": "2026-10-12T09:41:00.000Z",
  "metadata": {
    "supplier_id": "s_19"
  }
}

Any other status: an error

A status of 400 or above answers with the error object. Branch on its code, never on its message.

Errors

Beside the errors every call can answer with (a bad key, a missing scope, the rate limit), this call answers with:

Errors of Approve or advance a test refund, payout or conversion
CodeHTTPMeaning
test_helper_in_live_mode403A /v1/test/... endpoint was called with a live key.