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 coupon's start as a UTC instant. Kept for compatibility: render from startDate/startTime. On writes, send either this field or the twins; a coupon that carries start or end is read as instant-based and its twins are ignored.

date-time | null

The coupon's expiry as a UTC instant (the coupon stops applying at this instant). Kept for compatibility: render from endDate/endTime. Same write rule as start.

date | null

The calendar day the coupon becomes valid (yyyy-MM-dd) in the church's time zone. On writes, used with startTime when the coupon is sent without start/end; null clears the start. Null when the coupon is not restricted.

string | null

Wall-clock time on startDate in the church's time zone (HH:mm); 00:00 when omitted. Ignored without startDate.

date | null

The calendar day the coupon expires (yyyy-MM-dd) in the church's time zone; the coupon stops applying at endTime on this day. On writes, used with endTime when the coupon is sent without start/end; null clears the end.

string | null

Wall-clock time on endDate in the church's time zone (HH:mm); 00:00 when omitted, i.e. the coupon stops applying at the start of endDate. Ignored without endDate.

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