Create coupon

Create a discount coupon for the given form's paid items.

Required permission: Full Write Forms

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Path Params
int32
required
≥ 1

The id of the form.

Body Params

The coupon to create

string | null
required

The coupon's display name.

type
object | null
required

The discount type: 1 = percentage, 2 = flat amount. Only the id is used on writes.

double | null
required

The discount amount or percentage. Must be greater than 0.

criteria
object | null
required

The eligibility criteria: 1 = all items, 2 = any item from a given list, 3 = all items from a given list. Only the id is used on writes.

string | null

The coupon's description.

string | null

The code customers enter to apply the coupon. Null when the coupon applies automatically.

boolean | null

True when the coupon applies automatically rather than via a code.

boolean | null

True when the coupon is currently active.

date-time | null

The date the coupon becomes valid (UTC), when restricted.

date-time | null

The date the coupon expires (UTC), when restricted.

items
array of objects | null

The specific items the coupon applies to, when the criteria uses a list. Only the id of each item is used on writes; the items must belong to the form.

items
Headers
string
enum
Defaults to application/json

Generated from available response content types

Allowed:
Responses

401

Authentication is required, or the Ocs-Api-Key header is missing or invalid.

Language
Credentials
Header
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
text/plain
application/json
text/json