Update coupon

Updates an existing coupon. The redemption code itself is immutable. Requires the COUPONS_WRITE scope.

PATCH https://api.pandabase.io/v2/core/stores/{storeId}/coupons/{couponId}

Authentication

Requires a bearer token (sk_…) or an API key in the header Authorization.

Path parameters

storeId string required

(length 12–48)

couponId string required

(length 12–48)

Header parameters

idempotency-key string

(length 8–32)

Body parameters

code string

(pattern ^[A-Za-z0-9_\-]+$, length 2–64)

displayName string or null

No description.

description string or null

No description.

type enum

No description.

value integer

(range 1–∞)

minimumPurchase integer or null

No description.

maxUses integer or null

No description.

maxUsesPerCustomer integer or null

No description.

firstPurchaseOnly boolean

No description.

startsAt date-time or null

No description.

expiresAt date-time or null

No description.

enabled boolean

No description.

productIds array of string or null

No description.

Response 200

Default Response

ok enum required

(one of true)

data object required

No description.

Response 400

Default Response

ok enum required

(one of false)

error string required

No description.

Request
curl -X PATCH https://api.pandabase.io/v2/core/stores/:storeId/coupons/:couponId \  -H "Content-Type: application/json" \  -d '{"code":"string","displayName":"string","description":"string","type":"FIXED","value":0,"minimumPurchase":0,"maxUses":0,"maxUsesPerCustomer":0,"firstPurchaseOnly":true,"startsAt":"2024-01-01T00:00:00Z","expiresAt":"2024-01-01T00:00:00Z","enabled":true,"productIds":["string"]}'
Response
{  "ok": true,  "data": {    "id": "cpn_p2v8q1mzj0kxw5h7n4tr3bcf",    "code": "LAUNCH20",    "displayName": "Launch week 20% off",    "description": "Limited-time launch discount.",    "type": "PERCENTAGE",    "value": 20,    "minimumPurchase": 1000,    "maxUses": 500,    "maxUsesPerCustomer": 1,    "firstPurchaseOnly": false,    "startsAt": "2026-05-01T00:00:00.000Z",    "expiresAt": "2026-06-01T00:00:00.000Z",    "enabled": true,    "timesUsed": 42,    "productIds": [],    "createdAt": "2026-04-28T08:30:00.000Z",    "updatedAt": "2026-05-12T11:15:00.000Z"  }}