Endpoint
Email a receipt
/v1/receipts/{id}/sendAt most 5 sends per receipt per 24 hours. In this release payer email is off: the call answers 403 payer_email_off (a permission_error: do not retry) after its own checks, and nothing is sent.
- 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 receipt. |
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 |
|---|---|---|
to | string | Default: the order's email. |
Example request
Refused in this release
Every request to this call is answered 403 with payer_email_off. Payer email is off in this release: give the customer the receipt's link yourself. Retrying does not change this.
curl
curl https://api.orrerie.com/v1/receipts/rcpt_ppaxx20nbqv0kqgkwcxcc5xh/send \
-H "Authorization: Bearer $ORRERIE_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "jane@example.com"
}'JavaScript
const response = await fetch("https://api.orrerie.com/v1/receipts/rcpt_ppaxx20nbqv0kqgkwcxcc5xh/send", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.ORRERIE_SECRET_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"to": "jane@example.com"
}),
});
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/receipts/rcpt_ppaxx20nbqv0kqgkwcxcc5xh/send",
headers={"Authorization": f"Bearer {os.environ['ORRERIE_SECRET_KEY']}"},
json={
"to": "jane@example.com",
},
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/receipts/rcpt_ppaxx20nbqv0kqgkwcxcc5xh/send');
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' => 'jane@example.com',
]),
]);
$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 receipt object. Headers: Orrerie-Request-Id.
Example response, 200
{
"id": "rcpt_ppaxx20nbqv0kqgkwcxcc5xh",
"object": "receipt",
"livemode": true,
"created": "2026-10-11T14:09:55.764Z",
"number": "R-000913",
"order": "ord_0zymngngvf12b8b2cra7tb8e",
"url": "https://pay.orrerie.com/r/rcpt_ppaxx20nbqv0kqgkwcxcc5xh",
"pdf": "file_bged6qxyg8ntsnnaajz3gjsw",
"sent_to": "jane@example.com",
"sent_at": "2026-10-12T08:00:00.000Z"
}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 |
|---|---|---|
email_limit_reached | 429 | More than 5 sends of the same invoice or receipt in 24 hours. |
customer_email_required | 409 | The customer or order has no email address. |
payer_email_off | 403 | Orrerie does not email payers in this release, so nothing was sent. Give the customer the link yourself; retrying does not change this. Answered by POST /, POST / and an invoice's finalize with send: true. |