curl --request POST \
--url https://api.komerza.com/stores/{storeId}/coupons \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"code": "<string>",
"maximumUses": 49999999,
"isEnabled": true,
"percentageDecrease": 50.5,
"amountDecrease": 50000.005,
"variantIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
'{
"success": true,
"message": "<string>",
"code": "<string>",
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dateCreated": "2023-11-07T05:31:56Z",
"code": "<string>",
"uses": 123,
"maximumUses": 50000000,
"isEnabled": true,
"storeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"percentageDecrease": 50,
"amountDecrease": 50000,
"variantIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"expirationDate": "2023-11-07T05:31:56Z"
}
}Creates a new coupon in the store.
Requires the stores.coupons.create permission.
curl --request POST \
--url https://api.komerza.com/stores/{storeId}/coupons \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"code": "<string>",
"maximumUses": 49999999,
"isEnabled": true,
"percentageDecrease": 50.5,
"amountDecrease": 50000.005,
"variantIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
'{
"success": true,
"message": "<string>",
"code": "<string>",
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dateCreated": "2023-11-07T05:31:56Z",
"code": "<string>",
"uses": 123,
"maximumUses": 50000000,
"isEnabled": true,
"storeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"percentageDecrease": 50,
"amountDecrease": 50000,
"variantIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"expirationDate": "2023-11-07T05:31:56Z"
}
}Your API key goes here
The ID of the store to create the coupon in
The form containing the details of the new coupon
The data-transfer object for a coupon, used for creating or updating a coupon and returned by the API.
The case-insensitive code the customer will enter to redeem the coupon.
3 - 32The maximum number of times the coupon may be used. Set to –1 for unlimited uses.
-1 <= x <= 100000000Whether the coupon is active and may be used at checkout.
The percentage to subtract from the order total when the coupon is applied.
1 <= x <= 100A fixed amount to subtract from the order total when the coupon is applied.
0.01 <= x <= 100000The list of variant IDs this coupon applies to; null or empty for all variants.
The object was successfully created.
Represents a default generic response for API endpoints.
Indicates whether the operation or response was successful.
A descriptive message providing additional context or information about the response.
The error code (if there was an error) to use when referencing the error
A coupon code can be used to reduce the cost of an order with a store for a specified percentage
Show child attributes
Was this page helpful?