ZapAPI Docs
Get StartedConceptsAI GatewayGuidesPayment GatewaySDKAPI ReferenceResources
ApiDiscounts

Create a discount (coupon or automatic offer)

POST
/api/v1/discounts

Authorization

bearer

Header Parameters

X-API-Version?string

API version for header-based versioning

Default"1"
Value in"1""2"

Request Body

application/json
  1. body
projectId*string

Project the discount applies to

mode?string

"coupon" = customer enters the code at checkout · "offer" = applied automatically in its validity window

Default"coupon"
Value in"coupon""offer"
code*string

Code (uppercased; unique per project)

type*string

"percent" or "amount" (fixed sats off)

Value in"percent""amount"
percentOff?number

1–99 (when type=percent)

amountOffSats?number

Fixed sats off (when type=amount)

startsAt?string

Validity start (ISO; empty = from now)

endsAt?string

Validity end (ISO; empty = no expiry)

maxRedemptions?number

Max total redemptions (empty = unlimited)

Response Body

Example Request
curl -X POST 'http://localhost:3001/api/v1/discounts' \  -H 'Content-Type: application/json' \  -d '{  "projectId": "string",  "code": "LAUNCH20",  "type": "percent"}'
Example Response201
Empty