Ask for an invitation
Menu

Endpoint

Update a payment link

PATCH/v1/payment_links/{id}

Changes apply to orders created afterwards. currency, amount_type and line_items cannot change.

Scope a restricted key needs
payment_links: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 payment link
ParameterType and placeMeaning
idrequiredstringpathThe id of the link.
Orrerie-VersionstringheaderAPI version date. Default: the version the key was created with. Example 2026-10-11.

Request body

A JSON object. The body is required. A field the call does not list is refused with parameter_unknown.

Request body of Update a payment link
FieldTypeMeaning
namestringShown as the page title. Up to 200 characters.
min_amountstringFor open. Default the equivalent of US$1.00. Pattern ^\d+(\.\d+)?$.
max_amountstringFor open. Default and ceiling: the tier's per-order maximum. Pattern ^\d+(\.\d+)?$.
collectobjectAs on a checkout session.
success_urlstringDefault: the receipt page.
allow_publishable_keybooleanLets the embeddable button create sessions for this link with a pk_ key. Default true.
order_expiry_secondsinteger900 to 604,800. Default 3,600.
max_usesintegerStop after this many paid orders.
expires_atstring (date-time)Stop creating orders after this time.
metadataobjectYour own key-value data (rules in Metadata).
activebooleanfalse pauses the link: its page shows "This link is paused. Try again later or contact <merchant>."

Example request

curl

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

JavaScript

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

Example response, 200

{
  "id": "plink_gg6as78pk82ndt25m36vjeey",
  "object": "payment_link",
  "livemode": true,
  "created": "2026-09-10T10:05:00.000Z",
  "updated": "2026-09-10T10:05:00.000Z",
  "active": false,
  "name": "Ethiopia Yirgacheffe, 1 kg",
  "url": "https://pay.orrerie.com/l/plink_gg6as78pk82ndt25m36vjeey",
  "amount_type": "fixed",
  "amount": "21.99",
  "currency": "USD",
  "min_amount": null,
  "max_amount": null,
  "line_items": [
    {
      "price": "price_mbk5s5r45kwheaq89dbmk2gz",
      "quantity": 1,
      "adjustable_quantity": {
        "enabled": true,
        "minimum": 1,
        "maximum": 10
      }
    }
  ],
  "collect": {
    "email": "required",
    "name": "optional",
    "shipping_address": "hidden"
  },
  "success_url": "https://acme.example/thanks",
  "allow_publishable_key": true,
  "order_expiry_seconds": 3600,
  "max_uses": null,
  "uses": 17,
  "paid_uses": 14,
  "expires_at": null,
  "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.