Ask for an invitation
Menu

Endpoint

Update a price

PATCH/v1/prices/{id}

Changes the fields you send of a price and leaves the others as they are; sending null clears an optional field. Returns the price object as it is after the change.

Scope a restricted key needs
products:write
Publishable key
Not allowed: secret or restricted key only
Idempotency-Key
Not used. A PATCH is already safe to repeat.

Parameters

Parameters of Update a price
ParameterType and placeMeaning
idrequiredstringpathThe id of the price.
Orrerie-VersionstringheaderAPI version date. Default: the version the key was created with. Example 2026-10-11.

Request body

A JSON object. The body may be left out. A field the call does not list is refused with parameter_unknown.

Request body of Update a price
FieldTypeMeaning
activebooleanfalse archives the price; it cannot be used again.
nicknamestringYour own name for the price; null clears it.
metadataobjectYour own key-value data (rules in Metadata).

Example request

curl

curl -X PATCH https://api.orrerie.com/v1/prices/price_mbk5s5r45kwheaq89dbmk2gz \
  -H "Authorization: Bearer $ORRERIE_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "active": false
}'

JavaScript

const response = await fetch("https://api.orrerie.com/v1/prices/price_mbk5s5r45kwheaq89dbmk2gz", {
  method: "PATCH",
  headers: {
    Authorization: `Bearer ${process.env.ORRERIE_SECRET_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "active": false
  }),
});
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.patch(
    "https://api.orrerie.com/v1/prices/price_mbk5s5r45kwheaq89dbmk2gz",
    headers={"Authorization": f"Bearer {os.environ['ORRERIE_SECRET_KEY']}"},
    json={
        "active": False,
    },
    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/price_mbk5s5r45kwheaq89dbmk2gz');
curl_setopt_array($request, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'PATCH',
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('ORRERIE_SECRET_KEY'),
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => json_encode([
        'active' => false,
    ]),
]);
$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 price object. Headers: Orrerie-Request-Id.

Example response, 200

{
  "id": "price_mbk5s5r45kwheaq89dbmk2gz",
  "object": "price",
  "livemode": true,
  "created": "2026-09-10T10:01:00.000Z",
  "product": "prod_9cct573e5ewmrj7f6hyjsqap",
  "active": false,
  "type": "one_time",
  "amount": "21.99",
  "currency": "USD",
  "recurring": null,
  "nickname": "Retail",
  "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

This call has no error of its own. It answers with the errors every call can answer with: a bad key, a missing scope, an object that does not exist, the rate limit. Every error code has its own entry.