Nimbu Developer Docs
ReferenceCoupons

Create coupon

POST
/coupons

Creates a new coupon with the provided rules and validity window.

Authorization

AuthorizationBearer <token>

Personal access token tied to a user account. Requires the X-Nimbu-Site header to scope requests.

In: header

X-Nimbu-Site<token>

Identifier of the site context when authenticating with a personal access token.

In: header

Request Body

application/json

Coupon payload

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/coupons" \  -H "Content-Type: application/json" \  -d '{}'
{
  "id": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "name": "string",
  "description": "string",
  "reason": "string",
  "state": "string",
  "coupon_type": "string",
  "coupon_percentage": 0,
  "coupon_amount": 0,
  "customer_specific": true,
  "code": "string",
  "lifespan": "string",
  "lifespan_amount": 0,
  "lifespan_time": "2019-08-24T14:15:22Z",
  "start": "2019-08-24T14:15:22Z",
  "start_type": "string",
  "constraints": "string",
  "requirements": "string",
  "required_value": 0,
  "required_amount": 0,
  "collection_ids": [
    "string"
  ],
  "product_type_ids": [
    "string"
  ],
  "customers": [
    {}
  ],
  "redemptions": [
    {}
  ],
  "referral": {},
  "referrer": {}
}
Empty