Create coupon​
POST
/coupons
Creates a new coupon with the provided rules and validity window.
Authorizations​
bearerToken|siteContext +
bearerToken
Personal access token tied to a user account. Requires the X-Nimbu-Site header to scope requests.
TypeHTTP (bearer)
siteContext
Identifier of the site context when authenticating with a personal access token.
TypeAPI Key (header: X-Nimbu-Site)
or
siteToken
Site-scoped API token that already encodes the site context.
TypeHTTP (bearer)
Request Body​
application/json
JSON
{
"name": "string",
"description": "string",
"reason": "string",
"code": "string",
"coupon_type": "string",
"coupon_percentage": 0,
"coupon_amount": 0,
"lifespan": "string",
"lifespan_amount": 0,
"lifespan_time": "string",
"customer_specific": true,
"start": "string",
"start_type": "string",
"constraints": "string",
"requirements": "string",
"required_value": 0,
"required_amount": 0,
"collection_ids": [
"string"
],
"product_type_ids": [
"string"
],
"reusable": true,
"include_free_shipping": true
}
Responses​
coupon created
application/json
JSON
{
"id": "string",
"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": "string",
"start": "string",
"start_type": "string",
"constraints": "string",
"requirements": "string",
"required_value": 0,
"required_amount": 0,
"collection_ids": [
"string"
],
"product_type_ids": [
"string"
],
"customers": [
{
}
],
"redemptions": [
{
"created_at": "string",
"customer": {
},
"order": {
}
}
],
"referral": {
},
"referrer": {
},
"created_at": "string"
}