Skip to main content
POST
Create coupon

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.

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

Coupon created.

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