Skip to main content
PATCH
/
plans
/
{id}
Partial update plan (mutable fields)
curl --request PATCH \
  --url https://api.piriod.com/plans/{id}/ \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --header 'x-simple-workspace: <x-simple-workspace>' \
  --data '
{
  "name": "<string>",
  "description": "<string>",
  "sku": "<string>",
  "unit_label": "<string>",
  "metadata": {}
}
'
{
  "product": "<string>",
  "name": "<string>",
  "description": "<string>",
  "frequency": "<string>",
  "currency": "<string>",
  "amount": 123,
  "id": "<string>",
  "sku": "<string>",
  "exempt": false,
  "usage_scheme": "licensed",
  "usage_aggregation": "last_record",
  "tiers_mode": "package",
  "tiers": [
    {
      "amount": 123,
      "quantity_from": 123,
      "amount_scheme": "flat",
      "quantity_to": 123,
      "unit_scheme": "all_units"
    }
  ],
  "unit_label": "<string>",
  "status": "active",
  "archived": "2023-11-07T05:31:56Z",
  "created": "2023-11-07T05:31:56Z",
  "updated": "2023-11-07T05:31:56Z"
}

Documentation Index

Fetch the complete documentation index at: https://piriod-d406ac55.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Use header Authorization: Token <api_token>. API tokens are obtained from the Piriod dashboard.

Headers

x-simple-workspace
string
required

Workspace (account) identifier. Required for every request.

x-piriod-test-mode
boolean
default:false

Whether to operate against test-mode data. Defaults to false.

Path Parameters

id
string
required

Resource identifier.

Body

application/json

Schema for PATCH/PUT /plans/{id}/ (only mutable fields).

name
string
Maximum string length: 56
description
string
Maximum string length: 200
sku
string | null
Maximum string length: 32
unit_label
string | null
Maximum string length: 4
metadata
object

Response

200 - application/json

Updated plan.

product
string
required

Product ID.

name
string
required
Maximum string length: 56
description
string
required
Maximum string length: 200
frequency
string
required

Frequency ID (e.g. monthly).

currency
string
required

ISO currency code.

amount
number
required
id
string
read-only
sku
string | null
Maximum string length: 32
exempt
boolean
default:false
usage_scheme
enum<string>
default:licensed
Available options:
licensed,
metered
usage_aggregation
enum<string> | null
Available options:
last_record,
max,
sum
tiers_mode
enum<string> | null

Pricing mode for tiered plans. unit and range are deprecated aliases of volume and package respectively.

Available options:
package,
volume,
graduated,
package_overage,
unit,
range
tiers
object[]
unit_label
string | null
Maximum string length: 4
status
enum<string>
default:active
Available options:
active,
archived
archived
string<date-time> | null
read-only
created
string<date-time>
read-only
updated
string<date-time>
read-only