Endpoint
Simulate a payment
POST
/v1/test/orders/{id}/simulate_paymentCreates a simulated payment on the order and walks it through seen, then confirmed, then settled over about 6 seconds (or instantly with instant: true). If the order has no live instruction one is created for asset.
- Scope a restricted key needs
orders:write- Publishable key
- Not allowed: secret or restricted key only
- Idempotency-Key
- Recommended. It makes a retry safe.
Parameters
| Parameter | Type and place | Meaning |
|---|---|---|
idrequired | stringpath | The id of the order. |
Orrerie-Version | stringheader | API version date. Default: the version the key was created with. Example 2026-10-11. |
Idempotency-Key | stringheader | Makes a retry safe. Kept 24 hours. 1 to 255 characters. |
Request body
A JSON object. The body may be left out. A field the call does not list is refused with parameter_unknown.
| Field | Type | Meaning |
|---|---|---|
scenario | string | Default exact. underpaid pays 90%, overpaid pays 110%, unless amount is given. late pays after the instruction is expired. provider_refund ends the instruction refunded_by_provider. reverted confirms and then reverts. unmatched creates a payment that matches no order. One of exact, underpaid, overpaid, late, provider_refund, reverted, unmatched. |
asset | string | Default base:usdc. |
rail | string | Default relay where the asset has it. One of orrerie_app, relay, direct. |
amount | string | Exact amount of asset to simulate. Pattern ^\d+(\.\d+)?$. |
instant | boolean | Default false. |
Example request
curl
curl https://api.orrerie.com/v1/test/orders/ord_0zymngngvf12b8b2cra7tb8e/simulate_payment \
-H "Authorization: Bearer $ORRERIE_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{
"scenario": "exact",
"asset": "ethereum:usdc"
}'JavaScript
const response = await fetch("https://api.orrerie.com/v1/test/orders/ord_0zymngngvf12b8b2cra7tb8e/simulate_payment", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.ORRERIE_SECRET_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"scenario": "exact",
"asset": "ethereum:usdc"
}),
});
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/orders/ord_0zymngngvf12b8b2cra7tb8e/simulate_payment",
headers={"Authorization": f"Bearer {os.environ['ORRERIE_SECRET_KEY']}"},
json={
"scenario": "exact",
"asset": "ethereum:usdc",
},
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/orders/ord_0zymngngvf12b8b2cra7tb8e/simulate_payment');
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([
'scenario' => 'exact',
'asset' => 'ethereum:usdc',
]),
]);
$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
201 Created
The answer is the payment object. Headers: Orrerie-Request-Id.
Example response, 201
{
"id": "pay_2pe50hae6w2jk4sp1rcq5pae",
"object": "payment",
"livemode": false,
"created": "2026-10-11T14:06:41.117Z",
"order": "ord_0zymngngvf12b8b2cra7tb8e",
"instruction": "pin_h73hkjr8dyp4zymaet5e2gbv",
"status": "seen",
"rail": "relay",
"asset": "ethereum:usdc",
"network": "ethereum",
"amount": "22.410000",
"value": {
"amount": "22.41",
"currency": "USD"
},
"transaction_hash": "0x709b55bd3da0f5a838125bd0ee20c5bfdd7caba173912d4281cae816b79a201b",
"from_address": "0xdbF03B407c01E7cD3CBea99509d93f8DDDC8C6FB",
"to_address": "0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359",
"confirmations": 0,
"confirmations_required": 12,
"unmatched": false,
"unmatched_reason": null,
"late": false,
"ignored": false,
"finalized": true,
"screening": {
"id": "scr_268aypc7xxt8g1bkbweajv0m",
"status": "clear",
"checked_at": "2026-10-11T14:06:41.117Z"
},
"settlement": null,
"seen_at": "2026-10-11T14:06:41.117Z",
"confirmed_at": null,
"settled_at": null,
"reverted_at": null
}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:
| Code | HTTP | Meaning |
|---|---|---|
test_helper_in_live_mode | 403 | A /v1/test/... endpoint was called with a live key. |
order_not_payable | 409 | The order is cancelled, or already paid/overpaid. |
amount_invalid | 400 | Not a decimal string, negative, zero, or more decimal places than the currency has. |
asset_unsupported | 400 | Not an asset id from GET /v1/assets, or not usable for this purpose. |