Skip to main content
POST
/
stores
/
{storeId}
/
coupons
Create a coupon
curl --request POST \
  --url https://api.pandabase.io/v2/core/stores/{storeId}/coupons \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "code": "<string>",
  "type": "FIXED",
  "value": 2,
  "displayName": "<string>",
  "description": "<string>",
  "minimumPurchase": 1,
  "maxUses": 2,
  "maxUsesPerCustomer": 2,
  "firstPurchaseOnly": false,
  "startsAt": "2023-11-07T05:31:56Z",
  "expiresAt": "2023-11-07T05:31:56Z",
  "enabled": true
}
'
{
  "ok": true,
  "data": "<unknown>"
}

Authorizations

Authorization
string
header
required

Store API token. Use the sk_ prefixed secret key as the Bearer token.

Path Parameters

storeId
string
required

Store ID (shp_ prefix)

Required string length: 12 - 48

Body

application/json
code
string
required
Required string length: 2 - 64
Pattern: ^[A-Za-z0-9_\-]+$
type
enum<string>
required
Available options:
FIXED,
PERCENTAGE
value
integer
required
Required range: x >= 1
displayName
string
Maximum string length: 128
description
string
Maximum string length: 500
minimumPurchase
integer
Required range: x >= 0
maxUses
integer
Required range: x >= 1
maxUsesPerCustomer
integer
Required range: x >= 1
firstPurchaseOnly
boolean
default:false
startsAt
string<date-time>
expiresAt
string<date-time>
enabled
boolean
default:true

Response

Successful operation

ok
boolean
required
data
any
required