Ask for an invitation
Menu

Endpoint

Create a price

POST/v1/prices

Creates 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

Parameters of Create a price
ParameterType and placeMeaning
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 is required. A field the call does not list is refused with parameter_unknown.

Request body of Create a price
FieldTypeMeaning
productrequiredstringA prod_ id.
amountrequiredstringPattern ^\d+(\.\d+)?$.
currencyrequiredstringAn ISO 4217 code (USD) or an asset id. It never changes.
typestringDefault one_time. One of one_time, recurring.
recurringobject{interval: day|week|month|year, interval_count: 1..12}. Required for recurring.
nicknamestringYour own name for the price.
metadataobjectYour 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:

Errors of Create a price
CodeHTTPMeaning
product_limit_reached403The 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.