Skip to main content
POST
Create link-type coupon

Authorizations

X-API-Key
string
header
required

Path Parameters

organization_id
string<shortuuid>
required

UUID of the organization that owns the records.

Required string length: 22
Pattern: ^[23456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{22}$

Body

application/json

Payload to create a GCN coupon.

gcn
string
required

Global Coupon Number (AI 255), 13 to 25 digits. Unique across Closient.

Maximum string length: 25
Pattern: ^[^\x00]{0,25}$
title
string
required

Display title of the coupon (max 255 characters).

Maximum string length: 255
Pattern: ^[^\x00]{0,255}$
terms
string
default:""

The coupon's terms.

Pattern: ^[^\x00]{0,}$
redemption_url
string | null

Where a shopper redeems the coupon: an absolute http(s) URL of at most 2048 characters.

Maximum string length: 2048
Pattern: ^[Hh][Tt][Tt][Pp][Ss]?://[^\x00-\x20\x7f/?#][^\x00-\x20\x7f]{0,2039}$
valid_from
string<date-time> | null

When the coupon becomes valid (ISO-8601).

valid_until
string<date-time> | null

When the coupon stops being valid (ISO-8601).

Response

Created

A GCN coupon as read from the API.

id
string<shortuuid>
required

URL-safe 22-character shortuuid encoding of the row's UUID primary key. Stable across the row's lifetime; suitable for sharing in URLs, log lines, and external SDK clients. Accepted on input as either the shortuuid form or the canonical UUID form (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).

Required string length: 22
Pattern: ^[23456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{22}$
gcn
string
required

Global Coupon Number (AI 255), 13 to 25 digits. Unique across Closient.

title
string
required

Display title of the coupon (max 255 characters).

terms
string
required

The coupon's terms; empty when none were given.

organization_id
string<shortuuid>
required

UUID of the organization that owns the coupon.

Required string length: 22
Pattern: ^[23456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{22}$
created
string<date-time>
required

ISO-8601 creation timestamp.

modified
string<date-time>
required

ISO-8601 last-modified timestamp.

redemption_url
string | null

Where a shopper redeems the coupon.

valid_from
string<date-time> | null

When the coupon becomes valid, or null.

valid_until
string<date-time> | null

When the coupon stops being valid, or null.