Search.../
  1. Home
  2. Getting Started
  3. Overview
Generate a test token to explore our APIs

Create a Coupon

Create a new coupon.

Authorization

This endpoint requires an authorization header - pass the access token from the OAuth installation flow.

Permissions

This endpoint requires the Manage Coupons permission scope.

POST

https://www.wixapis.com/stores/v2/coupons

Body Params

NAME
TYPE
DESCRIPTION
specification

object

Coupon meta data. ID is ignored and created by the server

Response Object

NAME
TYPE
DESCRIPTION
id

string

ID of the created coupon, if the call is successful

Status/Error Codes

The response will include an HTTP status code.

Was this helpful?

Request

curl

Copy Code
1curl 'https://www.wixapis.com/stores/v2/coupons' \
2 --data-binary '{
3 "specification": {
4 "name": "BuyXGetY",
5 "code": "ABC",
6 "active": true,
7 "startTime": 1554066000000,
8 "usageLimit": 10,
9 "expirationTime": 1554325199999,
10 "scope": {
11 "namespace": "stores"
12 },
13 "limitedToOneItem": true,
14 "buyXGetY": {
15 "x": 3,
16 "y": 2
17 }
18 }
19 }' \
20 -H 'Content-Type: application/json' \
21 -H 'Authorization: <AUTH>'

Response

json

1
2{"id": "1758"}