Skip to main content
POST
/
coupons
Create a coupon
curl --request POST \
  --url https://api.salesive.com/api/v1/coupons \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "code": "SUMMER20",
  "type": "percentage",
  "discount": 20,
  "usageLimit": 100,
  "usagePerUser": 1,
  "minimumOrderAmount": 5000,
  "startDate": "2026-06-01T00:00:00.000Z",
  "endDate": "2026-08-31T23:59:59.000Z",
  "active": true
}
'
{
  "status": 201,
  "success": true,
  "message": "Coupon created successfully",
  "data": {
    "_id": "66b1f2a9c4d5e6f7a8b9c0d1",
    "code": "SUMMER20",
    "user": "66a0e1b2c3d4e5f6a7b8c9d0",
    "shop": "66a0d1c2b3a4958677564738",
    "type": "percentage",
    "discount": 20,
    "usageLimit": 100,
    "usageCount": 0,
    "usagePerUser": 1,
    "minimumOrderAmount": 5000,
    "startDate": "2026-06-01T00:00:00.000Z",
    "endDate": "2026-08-31T23:59:59.000Z",
    "active": true,
    "createdAt": "2026-06-28T12:00:00.000Z",
    "updatedAt": "2026-06-28T12:00:00.000Z"
  }
}
Creates a coupon; the code is uppercased automatically and must be unique within the store. The owning store and user are set server-side — never send a shop id.

Authorizations

Authorization
string
header
required

Installed-app access token (prefix app_), issued by the OAuth install flow. The store is bound to the token server-side — never send a shop id.

Body

application/json

Fields accepted when creating a coupon.

code
string
required

Coupon code (alphanumeric only). Stored uppercase; must be unique within the store.

type
enum<string>
required

Discount type: fixed or percentage.

Available options:
fixed,
percentage
discount
number
required

Discount amount. For percentage this is a percent value; for fixed it is an amount. Must be greater than 0.

startDate
string<date-time>
required

Date the coupon becomes valid (ISO 8601).

endDate
string<date-time>
required

Date the coupon expires (ISO 8601). Must be on or after startDate.

usageLimit
integer
default:1

Maximum total redemptions across all customers. Minimum 1. Defaults to 1.

Required range: x >= 1
usagePerUser
integer
default:1

Maximum redemptions per customer. Minimum 1. Defaults to 1.

Required range: x >= 1
minimumOrderAmount
number
default:0

Minimum order subtotal required to apply the coupon. Cannot be negative. Defaults to 0.

Required range: x >= 0
active
boolean
default:true

Whether the coupon is active. Defaults to true.

Response

The created coupon.

Standard Salesive response envelope. The operation-specific payload is carried in data.

status
integer
required

HTTP status code, echoed in the body.

success
boolean
required

Whether the request succeeded.

message
string
required

Human-readable result message.

data
object

A store-scoped discount coupon.