Skip to content
extensions / Commerce extension
POST/api/projects/{project_id}/sales/coupons

Create Coupon

Creates a coupon for a project from the submitted coupon payload and dispatches a coupon-created event.

GETPOST

Authentication

Requirement
Required
Credential type
Bearer API key
Scopes
Not specified

Permissions

  • Requests are scoped to the target project_id. API-key requests must use a key with an active connection to that project.

Headers

NameRequiredTypeDetails
AuthorizationYesNot specified
Description: Bearer credential used to authenticate the request.

Path Parameters

NameRequiredTypeDetails
project_idYesNot specified
Description: Target project identifier.

Query Parameters

Request Body

Schema: CouponPayload

FieldRequiredTypeDetails
codeYesstring
Description: Text value.
discount_typeNostring
Description: Text value.
amountYesnumber
Description: Numeric amount.
target_scopeNostring
Description: Text value.
allow_stackNoboolean
Description: Boolean flag.
max_usesNointeger
Description: Integer value.
max_uses_per_customerNointeger
Description: Integer value.
starts_atNostring
Description: Text value.
ends_atNostring
Description: Text value.
is_activeNoboolean
Description: Boolean flag.

Response Body

Example 201 response

json
{
  "id": 1,
  "project_id": 1,
  "code": "string",
  "discount_type": "string",
  "amount": "string",
  "target_scope": "string",
  "allow_stack": 1,
  "max_uses": 1,
  "uses": 1,
  "max_uses_per_customer": 1,
  "starts_at": "2026-01-01T00:00:00Z",
  "ends_at": "2026-01-01T00:00:00Z",
  "is_active": 1,
  "created_at": "2026-01-01T00:00:00Z",
  "updated_at": "2026-01-01T00:00:00Z"
}

Errors

400 bad_request

Availability

Available in
v0.1.0
Available since
v0.1.0
Implementation
Available
Deprecation
Not specified
Rate limits
Not specified