Endpoint
Create a price
POST
/v1/pricesCreates a price and returns the price object. Send an Idempotency-Key: a retry with the same key and body gets the first answer again, so it never creates a second price.
- Scope a restricted key needs
products:write- Publishable key
- Not allowed: secret or restricted key only
- Idempotency-Key
- Recommended. It makes a retry safe.
Parameters
| Parameter | Type and place | Meaning |
|---|---|---|
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 is required. A field the call does not list is refused with parameter_unknown.
| Field | Type | Meaning |
|---|---|---|
productrequired | string | A prod_ id. |
amountrequired | string | Pattern ^\d+(\.\d+)?$. |
currencyrequired | string | An ISO 4217 code (USD) or an asset id. It never changes. |
type | string | Default one_time. One of one_time, recurring. |
recurring | object | {interval: day|week|month|year, interval_. Required for recurring. |
nickname | string | Your own name for the price. |
metadata | object | Your own key-value data (rules in Metadata). |
Example request
curl
curl https://api.orrerie.com/v1/prices \
-H "Authorization: Bearer $ORRERIE_SECRET_KEY" \
-H "Idempotency-Key: 8f14e45f-ceea-467f-a9d2-6f1c2b3d4e5a" \
-H "Content-Type: application/json" \
-d '{
"product": "prod_9cct573e5ewmrj7f6hyjsqap",
"amount": "18.00",
"currency": "USD",
"type": "recurring",
"recurring": {
"interval": "month",
"interval_count": 1
},
"nickname": "Monthly bag"
}'JavaScript
const response = await fetch("https://api.orrerie.com/v1/prices", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.ORRERIE_SECRET_KEY}`,
"Idempotency-Key": "8f14e45f-ceea-467f-a9d2-6f1c2b3d4e5a",
"Content-Type": "application/json",
},
body: JSON.stringify({
"product": "prod_9cct573e5ewmrj7f6hyjsqap",
"amount": "18.00",
"currency": "USD",
"type": "recurring",
"recurring": {
"interval": "month",
"interval_count": 1
},
"nickname": "Monthly bag"
}),
});
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/prices",
headers={"Authorization": f"Bearer {os.environ['ORRERIE_SECRET_KEY']}", "Idempotency-Key": "8f14e45f-ceea-467f-a9d2-6f1c2b3d4e5a"},
json={
"product": "prod_9cct573e5ewmrj7f6hyjsqap",
"amount": "18.00",
"currency": "USD",
"type": "recurring",
"recurring": {
"interval": "month",
"interval_count": 1,
},
"nickname": "Monthly bag",
},
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/prices');
curl_setopt_array($request, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('ORRERIE_SECRET_KEY'),
'Idempotency-Key: 8f14e45f-ceea-467f-a9d2-6f1c2b3d4e5a',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'product' => 'prod_9cct573e5ewmrj7f6hyjsqap',
'amount' => '18.00',
'currency' => 'USD',
'type' => 'recurring',
'recurring' => [
'interval' => 'month',
'interval_count' => 1,
],
'nickname' => 'Monthly bag',
]),
]);
$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 price object. Headers: Orrerie-Request-Id.
Example response, 201
{
"id": "price_s5n6hhtmyv5erqb81efqgjy6",
"object": "price",
"livemode": true,
"created": "2026-09-10T10:01:00.000Z",
"product": "prod_9cct573e5ewmrj7f6hyjsqap",
"active": true,
"type": "recurring",
"amount": "18.00",
"currency": "USD",
"recurring": {
"interval": "month",
"interval_count": 1
},
"nickname": "Monthly bag",
"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 |
|---|---|---|
product_limit_reached | 403 | The account has 500 products that are not archived, or this product has 20 prices that are not archived; see reason and limit. Archive one first. |