Endpoint
Cancel a payout batch
POST
/v1/payout_batches/{id}/cancelCancels a payout batch that is waiting for approval, so none of its payouts is sent.
Allowed while awaiting_approval.
- 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
| Parameter | Type and place | Meaning |
|---|---|---|
idrequired | stringpath | The id of the batch. |
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.
Example request
curl
curl https://api.orrerie.com/v1/payout_batches/pob_b1xkj45rqwdaf7j2bc94pef3/cancel \
-H "Authorization: Bearer $ORRERIE_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{}'JavaScript
const response = await fetch("https://api.orrerie.com/v1/payout_batches/pob_b1xkj45rqwdaf7j2bc94pef3/cancel", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.ORRERIE_SECRET_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({}),
});
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/payout_batches/pob_b1xkj45rqwdaf7j2bc94pef3/cancel",
headers={"Authorization": f"Bearer {os.environ['ORRERIE_SECRET_KEY']}"},
json={},
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/payout_batches/pob_b1xkj45rqwdaf7j2bc94pef3/cancel');
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(new stdClass()),
]);
$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_batch object. Headers: Orrerie-Request-Id.
Example response, 200
{
"id": "pob_b1xkj45rqwdaf7j2bc94pef3",
"object": "payout_batch",
"livemode": true,
"created": "2026-10-12T09:40:00.000Z",
"status": "cancelled",
"description": "October contractor payments",
"row_count": 2,
"total_value": {
"amount": "1700.00",
"currency": "USD"
},
"counts": {
"draft": 0,
"awaiting_approval": 0,
"signed": 0,
"sent": 0,
"confirmed": 0,
"failed": 0,
"unknown": 0,
"cancelled": 2
},
"payouts": [
"po_crs9tp390f2yjremph9m0npb",
"po_kyrcy0h8t43wvedbxe5v40bp"
],
"requested_by": {
"type": "api_key",
"id": "key_6e3gg2c6ea176xxdek2nar6v"
},
"approved_by": null,
"approval_url": null,
"approval_expires_at": "2026-10-19T09:40:00.000Z",
"approved_at": null,
"completed_at": null,
"cancellation_reason": "cancelled_by_api",
"metadata": {}
}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 |
|---|---|---|
money_out_not_cancellable | 409 | The request is signed or later. A signed transaction cannot be withdrawn. |