Ask for an invitation
Menu

Endpoint

Accept an underpaid order as paid

POST/v1/orders/{id}/accept_underpayment

Moves an underpaid order to paid with accepted_short: true. amount_due stays as the shortfall for your books. In live mode a key cannot accept a short payment: it answers passkey_approval_required with reason accept_short_dashboard_only, and the dashboard accepts it with a passkey. Test mode is unchanged. The top-up offer to the payer closes 24 hours after the order became underpaid (or at expires_at if later); after that this call or a refund are the two ways to close it.

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

Parameters of Accept an underpaid order as paid
ParameterType and placeMeaning
idrequiredstringpathThe id of the order.
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 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/orders/ord_0zymngngvf12b8b2cra7tb8e/accept_underpayment \
  -H "Authorization: Bearer $ORRERIE_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

JavaScript

const response = await fetch("https://api.orrerie.com/v1/orders/ord_0zymngngvf12b8b2cra7tb8e/accept_underpayment", {
  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/orders/ord_0zymngngvf12b8b2cra7tb8e/accept_underpayment",
    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/orders/ord_0zymngngvf12b8b2cra7tb8e/accept_underpayment');
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 order object. Headers: Orrerie-Request-Id.

Example response, 200

{
  "id": "ord_0zymngngvf12b8b2cra7tb8e",
  "object": "order",
  "livemode": true,
  "created": "2026-10-11T14:03:22.418Z",
  "updated": "2026-10-11T14:09:55.764Z",
  "status": "paid",
  "source": "checkout",
  "amount": "21.99",
  "currency": "USD",
  "value": {
    "amount": "21.99",
    "currency": "USD"
  },
  "fx": null,
  "description": "Order #1042",
  "reference": "1042",
  "customer": "cus_8ea07c40qsvv19f7rgmeb8ha",
  "customer_email": "jane@example.com",
  "line_items": [
    {
      "name": "Ethiopia Yirgacheffe, 1 kg",
      "quantity": 1,
      "unit_amount": "21.99",
      "amount": "21.99",
      "price": "price_mbk5s5r45kwheaq89dbmk2gz"
    }
  ],
  "settlement": {
    "mode": "convert",
    "asset": "base:usdc",
    "amount_expected": "21.990000",
    "amount_received": "21.990000",
    "wallet": "wal_bsfw07hymawmda7gg8jsyy3g"
  },
  "fee_bearer": "payer",
  "amount_paid": "20.10",
  "amount_due": "1.89",
  "amount_refunded": "0.00",
  "paid_late": false,
  "accepted_short": true,
  "refunded": false,
  "partially_refunded": false,
  "finalized": true,
  "has_unconfirmed": false,
  "screening_hold": false,
  "screening": {
    "status": "clear"
  },
  "provider_refund_received": false,
  "overpayment": null,
  "rails_allowed": [
    "orrerie_app",
    "relay",
    "direct"
  ],
  "accept": [],
  "app_pay_allowed": true,
  "active_instruction": null,
  "instructions": [
    "pin_h73hkjr8dyp4zymaet5e2gbv"
  ],
  "payments": [
    "pay_2pe50hae6w2jk4sp1rcq5pae"
  ],
  "checkout_session": "cs_z7ek5wj68fyz80j7bz1eq4e0",
  "payment_link": null,
  "invoice": null,
  "subscription": null,
  "pos_device": null,
  "receipt": "rcpt_ppaxx20nbqv0kqgkwcxcc5xh",
  "expires_at": "2026-10-11T15:03:22.418Z",
  "paid_at": "2026-10-11T14:09:55.764Z",
  "cancelled_at": null,
  "metadata": {
    "cart_id": "c_7781"
  }
}

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 Accept an underpaid order as paid
CodeHTTPMeaning
order_not_underpaid409Only an underpaid order can be accepted as paid.
passkey_approval_required403The action can only be done by a signed-in member in the dashboard (settlement asset, key-holding roles, approvals). No API key can do it.