Ask for an invitation
Menu

Endpoint

Resume a subscription

POST/v1/subscriptions/{id}/resume

Resumes a paused subscription and returns the subscription object. A subscription in any other state is refused with subscription_not_paused.

Scope a restricted key needs
subscriptions:write
Publishable key
Not allowed: secret or restricted key only
Idempotency-Key
Recommended. It makes a retry safe.

Parameters

Parameters of Resume a subscription
ParameterType and placeMeaning
idrequiredstringpathThe id of the subscription.
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 may be left out. A field the call does not list is refused with parameter_unknown.

Example request

curl

curl https://api.orrerie.com/v1/subscriptions/sub_9q5v9rq2naessbxsrec2tsw0/resume \
  -H "Authorization: Bearer $ORRERIE_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

JavaScript

const response = await fetch("https://api.orrerie.com/v1/subscriptions/sub_9q5v9rq2naessbxsrec2tsw0/resume", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.ORRERIE_SECRET_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({}),
});
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/subscriptions/sub_9q5v9rq2naessbxsrec2tsw0/resume",
    headers={"Authorization": f"Bearer {os.environ['ORRERIE_SECRET_KEY']}"},
    json={},
    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/subscriptions/sub_9q5v9rq2naessbxsrec2tsw0/resume');
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(new stdClass()),
]);
$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 subscription object. Headers: Orrerie-Request-Id.

Example response, 200

{
  "id": "sub_9q5v9rq2naessbxsrec2tsw0",
  "object": "subscription",
  "livemode": true,
  "created": "2026-10-01T08:05:00.000Z",
  "updated": "2026-10-01T08:09:00.000Z",
  "status": "active",
  "customer": "cus_8ea07c40qsvv19f7rgmeb8ha",
  "items": [
    {
      "price": "price_s5n6hhtmyv5erqb81efqgjy6",
      "quantity": 1
    }
  ],
  "amount": "18.00",
  "currency": "USD",
  "interval": "month",
  "interval_count": 1,
  "reminder_days": [
    7,
    3,
    1
  ],
  "grace_days": 3,
  "prepaid_periods_allowed": [
    1,
    3,
    6,
    12
  ],
  "proration": "none",
  "current_period_start": "2026-10-01T08:09:00.000Z",
  "current_period_end": "2026-11-01T08:09:00.000Z",
  "prepaid_until": "2026-11-01T08:09:00.000Z",
  "latest_order": "ord_ayyh1f26ajmj807xjy6ezyfd",
  "renewal": {
    "order": null,
    "checkout_url": null,
    "opens_at": "2026-10-25T08:09:00.000Z",
    "due_at": "2026-11-01T08:09:00.000Z",
    "grace_ends_at": "2026-11-04T08:09:00.000Z"
  },
  "cancel_at_period_end": false,
  "cancelled_at": null,
  "paused_at": null,
  "ended_at": null,
  "cancellation_reason": 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

Beside the errors every call can answer with (a bad key, a missing scope, the rate limit), this call answers with:

Errors of Resume a subscription
CodeHTTPMeaning
subscription_not_paused409Only a paused subscription can be resumed.