Creates a new coupon.
When creating a coupon, the specification
object must contain values for name
, code
, startTime
,
and either scope
or minimumSubtotal
. The exception is for a freeShipping
coupon type, for which you cannot apply
a scope
and minimumSubtotal
is optional.
The coupon scope
defines the items a coupon applies to. A coupon can apply to all items in a specific Wix application,
a group within the application, or a single item within a group.
See valid scope values.
The specification
object must also contain a value for exactly 1 of the following coupon properties.
This defines the coupon type.
"moneyOffAmount"
"percentOffRate"
"freeShipping"
"fixedPriceAmount"
"buyXGetY"
You can only call this method when authenticated as a Wix app or Wix user identity.
Coupon to create.
ID of the newly created coupon.
curl 'https://www.wixapis.com/stores/v2/coupons' \
--data-binary '{
"specification": {
"name": "BuyXGetY",
"code": "ABC",
"active": true,
"startTime": 1554066000000,
"usageLimit": 10,
"expirationTime": 1554325199999,
"scope": {
"namespace": "stores"
},
"limitedToOneItem": true,
"buyXGetY": {
"x": 3,
"y": 2
}
}
}' \
-H 'Content-Type: application/json' \
-H 'Authorization: <AUTH>'
{
"id": "d4974fa7-58e3-4140-a263-a6c08b7f2438"
}
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.