Skip to main content
PATCH
/
coupons
/
{id}
Partial update coupon
curl --request PATCH \
  --url https://api.piriod.com/coupons/{id}/ \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --header 'x-simple-workspace: <x-simple-workspace>' \
  --data '
{
  "name": "<string>",
  "amount": 123,
  "currency": "<string>",
  "discount_scheme": "%",
  "duration_scheme": "one_time",
  "duration_times": 123,
  "valid_until": "2023-12-25",
  "apply_on": "invoice",
  "status": "active"
}
'
{
  "name": "<string>",
  "amount": 123,
  "currency": "<string>",
  "id": "<string>",
  "discount_scheme": "%",
  "duration_scheme": "one_time",
  "duration_times": 123,
  "valid_until": "2023-12-25",
  "apply_on": "invoice",
  "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
name
string
required
Maximum string length: 56
amount
number
required
currency
string
required
discount_scheme
enum<string>
default:%
Available options:
%,
$
duration_scheme
enum<string>
default:one_time
Available options:
one_time,
forever,
limited
duration_times
integer | null

Required when duration_scheme=limited. Number of billing cycles.

valid_until
string<date> | null
apply_on
enum<string>
default:invoice
Available options:
line,
invoice
status
enum<string>
default:active
Available options:
active,
archived

Response

200 - application/json

Updated coupon.

name
string
required
Maximum string length: 56
amount
number
required
currency
string
required
id
string
read-only
discount_scheme
enum<string>
default:%
Available options:
%,
$
duration_scheme
enum<string>
default:one_time
Available options:
one_time,
forever,
limited
duration_times
integer | null

Required when duration_scheme=limited. Number of billing cycles.

valid_until
string<date> | null
apply_on
enum<string>
default:invoice
Available options:
line,
invoice
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