Update coupon
curl --request PUT \
--url https://staging.api.commercengine.io/api/v1/{store_id}/admin/offer/coupons/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"can_be_used_with_promotion": false,
"starts_at": "2023-11-07T05:31:56Z",
"details": {
"discount_type": "percentage",
"discount_percent": 123,
"maximum_discount_amount": 123,
"products": [
{
"product_id": "<string>",
"variant_id": "<string>",
"minimum_quantity": 123,
"maximum_quantity": 123,
"minimum_value": 123,
"maximum_value": 123
}
],
"category_id": [
"<string>"
]
},
"coupon_code": [
"<string>"
],
"description": "<string>",
"tags": [
"<string>"
],
"customer_id": [
"<string>"
],
"segment_id": [
"<string>"
],
"customer_group_id": [
"<string>"
],
"redemption_limits": {
"total_redemptions": 123,
"per_customer_redemptions": 123,
"per_coupon_code_redemptions": 123
},
"minimum_order_total": 0,
"for_first_time_customer_only": false,
"can_earn_loyalty_points": true,
"can_redeem_loyalty_points": true,
"expires_at": "2023-11-07T05:31:56Z",
"application_rules": {
"max_applicable_items": 123
},
"visibility_scope": "public"
}
'import requests
url = "https://staging.api.commercengine.io/api/v1/{store_id}/admin/offer/coupons/{id}"
payload = {
"name": "<string>",
"can_be_used_with_promotion": False,
"starts_at": "2023-11-07T05:31:56Z",
"details": {
"discount_type": "percentage",
"discount_percent": 123,
"maximum_discount_amount": 123,
"products": [
{
"product_id": "<string>",
"variant_id": "<string>",
"minimum_quantity": 123,
"maximum_quantity": 123,
"minimum_value": 123,
"maximum_value": 123
}
],
"category_id": ["<string>"]
},
"coupon_code": ["<string>"],
"description": "<string>",
"tags": ["<string>"],
"customer_id": ["<string>"],
"segment_id": ["<string>"],
"customer_group_id": ["<string>"],
"redemption_limits": {
"total_redemptions": 123,
"per_customer_redemptions": 123,
"per_coupon_code_redemptions": 123
},
"minimum_order_total": 0,
"for_first_time_customer_only": False,
"can_earn_loyalty_points": True,
"can_redeem_loyalty_points": True,
"expires_at": "2023-11-07T05:31:56Z",
"application_rules": { "max_applicable_items": 123 },
"visibility_scope": "public"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
can_be_used_with_promotion: false,
starts_at: '2023-11-07T05:31:56Z',
details: {
discount_type: 'percentage',
discount_percent: 123,
maximum_discount_amount: 123,
products: [
{
product_id: '<string>',
variant_id: '<string>',
minimum_quantity: 123,
maximum_quantity: 123,
minimum_value: 123,
maximum_value: 123
}
],
category_id: ['<string>']
},
coupon_code: ['<string>'],
description: '<string>',
tags: ['<string>'],
customer_id: ['<string>'],
segment_id: ['<string>'],
customer_group_id: ['<string>'],
redemption_limits: {
total_redemptions: 123,
per_customer_redemptions: 123,
per_coupon_code_redemptions: 123
},
minimum_order_total: 0,
for_first_time_customer_only: false,
can_earn_loyalty_points: true,
can_redeem_loyalty_points: true,
expires_at: '2023-11-07T05:31:56Z',
application_rules: {max_applicable_items: 123},
visibility_scope: 'public'
})
};
fetch('https://staging.api.commercengine.io/api/v1/{store_id}/admin/offer/coupons/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://staging.api.commercengine.io/api/v1/{store_id}/admin/offer/coupons/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'can_be_used_with_promotion' => false,
'starts_at' => '2023-11-07T05:31:56Z',
'details' => [
'discount_type' => 'percentage',
'discount_percent' => 123,
'maximum_discount_amount' => 123,
'products' => [
[
'product_id' => '<string>',
'variant_id' => '<string>',
'minimum_quantity' => 123,
'maximum_quantity' => 123,
'minimum_value' => 123,
'maximum_value' => 123
]
],
'category_id' => [
'<string>'
]
],
'coupon_code' => [
'<string>'
],
'description' => '<string>',
'tags' => [
'<string>'
],
'customer_id' => [
'<string>'
],
'segment_id' => [
'<string>'
],
'customer_group_id' => [
'<string>'
],
'redemption_limits' => [
'total_redemptions' => 123,
'per_customer_redemptions' => 123,
'per_coupon_code_redemptions' => 123
],
'minimum_order_total' => 0,
'for_first_time_customer_only' => false,
'can_earn_loyalty_points' => true,
'can_redeem_loyalty_points' => true,
'expires_at' => '2023-11-07T05:31:56Z',
'application_rules' => [
'max_applicable_items' => 123
],
'visibility_scope' => 'public'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://staging.api.commercengine.io/api/v1/{store_id}/admin/offer/coupons/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"can_be_used_with_promotion\": false,\n \"starts_at\": \"2023-11-07T05:31:56Z\",\n \"details\": {\n \"discount_type\": \"percentage\",\n \"discount_percent\": 123,\n \"maximum_discount_amount\": 123,\n \"products\": [\n {\n \"product_id\": \"<string>\",\n \"variant_id\": \"<string>\",\n \"minimum_quantity\": 123,\n \"maximum_quantity\": 123,\n \"minimum_value\": 123,\n \"maximum_value\": 123\n }\n ],\n \"category_id\": [\n \"<string>\"\n ]\n },\n \"coupon_code\": [\n \"<string>\"\n ],\n \"description\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"customer_id\": [\n \"<string>\"\n ],\n \"segment_id\": [\n \"<string>\"\n ],\n \"customer_group_id\": [\n \"<string>\"\n ],\n \"redemption_limits\": {\n \"total_redemptions\": 123,\n \"per_customer_redemptions\": 123,\n \"per_coupon_code_redemptions\": 123\n },\n \"minimum_order_total\": 0,\n \"for_first_time_customer_only\": false,\n \"can_earn_loyalty_points\": true,\n \"can_redeem_loyalty_points\": true,\n \"expires_at\": \"2023-11-07T05:31:56Z\",\n \"application_rules\": {\n \"max_applicable_items\": 123\n },\n \"visibility_scope\": \"public\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://staging.api.commercengine.io/api/v1/{store_id}/admin/offer/coupons/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"can_be_used_with_promotion\": false,\n \"starts_at\": \"2023-11-07T05:31:56Z\",\n \"details\": {\n \"discount_type\": \"percentage\",\n \"discount_percent\": 123,\n \"maximum_discount_amount\": 123,\n \"products\": [\n {\n \"product_id\": \"<string>\",\n \"variant_id\": \"<string>\",\n \"minimum_quantity\": 123,\n \"maximum_quantity\": 123,\n \"minimum_value\": 123,\n \"maximum_value\": 123\n }\n ],\n \"category_id\": [\n \"<string>\"\n ]\n },\n \"coupon_code\": [\n \"<string>\"\n ],\n \"description\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"customer_id\": [\n \"<string>\"\n ],\n \"segment_id\": [\n \"<string>\"\n ],\n \"customer_group_id\": [\n \"<string>\"\n ],\n \"redemption_limits\": {\n \"total_redemptions\": 123,\n \"per_customer_redemptions\": 123,\n \"per_coupon_code_redemptions\": 123\n },\n \"minimum_order_total\": 0,\n \"for_first_time_customer_only\": false,\n \"can_earn_loyalty_points\": true,\n \"can_redeem_loyalty_points\": true,\n \"expires_at\": \"2023-11-07T05:31:56Z\",\n \"application_rules\": {\n \"max_applicable_items\": 123\n },\n \"visibility_scope\": \"public\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging.api.commercengine.io/api/v1/{store_id}/admin/offer/coupons/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"can_be_used_with_promotion\": false,\n \"starts_at\": \"2023-11-07T05:31:56Z\",\n \"details\": {\n \"discount_type\": \"percentage\",\n \"discount_percent\": 123,\n \"maximum_discount_amount\": 123,\n \"products\": [\n {\n \"product_id\": \"<string>\",\n \"variant_id\": \"<string>\",\n \"minimum_quantity\": 123,\n \"maximum_quantity\": 123,\n \"minimum_value\": 123,\n \"maximum_value\": 123\n }\n ],\n \"category_id\": [\n \"<string>\"\n ]\n },\n \"coupon_code\": [\n \"<string>\"\n ],\n \"description\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"customer_id\": [\n \"<string>\"\n ],\n \"segment_id\": [\n \"<string>\"\n ],\n \"customer_group_id\": [\n \"<string>\"\n ],\n \"redemption_limits\": {\n \"total_redemptions\": 123,\n \"per_customer_redemptions\": 123,\n \"per_coupon_code_redemptions\": 123\n },\n \"minimum_order_total\": 0,\n \"for_first_time_customer_only\": false,\n \"can_earn_loyalty_points\": true,\n \"can_redeem_loyalty_points\": true,\n \"expires_at\": \"2023-11-07T05:31:56Z\",\n \"application_rules\": {\n \"max_applicable_items\": 123\n },\n \"visibility_scope\": \"public\"\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"success": true,
"content": {
"coupon": {
"name": "<string>",
"status": "draft",
"customer_eligibility": "all",
"can_be_used_with_promotion": false,
"starts_at": "2023-11-07T05:31:56Z",
"details": {
"discount_type": "percentage",
"discount_percent": 123,
"maximum_discount_amount": 123,
"products": [
{
"product_id": "<string>",
"variant_id": "<string>",
"minimum_quantity": 123,
"maximum_quantity": 123,
"minimum_value": 123,
"maximum_value": 123
}
],
"category_id": [
"<string>"
]
},
"applies_to_product": "all",
"coupon_type": "discount",
"coupon_code": [
"<string>"
],
"id": "<string>",
"description": "<string>",
"tags": [
"<string>"
],
"active": true,
"customer_id": [
"<string>"
],
"segment_id": [
"<string>"
],
"customer_group_id": [
"<string>"
],
"redemption_limits": {
"total_redemptions": 123,
"per_customer_redemptions": 123,
"per_coupon_code_redemptions": 123
},
"redemption_count": 123,
"minimum_order_total": 0,
"for_first_time_customer_only": false,
"can_earn_loyalty_points": true,
"can_redeem_loyalty_points": true,
"expires_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"application_rules": {
"max_applicable_items": 123,
"application_priority": "cheapest_first"
},
"visibility_scope": "public",
"terms_and_conditions": [
"<string>"
]
}
}
}Coupons & promotions
Update coupon
Update coupon
PUT
/
offer
/
coupons
/
{id}
Update coupon
curl --request PUT \
--url https://staging.api.commercengine.io/api/v1/{store_id}/admin/offer/coupons/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"can_be_used_with_promotion": false,
"starts_at": "2023-11-07T05:31:56Z",
"details": {
"discount_type": "percentage",
"discount_percent": 123,
"maximum_discount_amount": 123,
"products": [
{
"product_id": "<string>",
"variant_id": "<string>",
"minimum_quantity": 123,
"maximum_quantity": 123,
"minimum_value": 123,
"maximum_value": 123
}
],
"category_id": [
"<string>"
]
},
"coupon_code": [
"<string>"
],
"description": "<string>",
"tags": [
"<string>"
],
"customer_id": [
"<string>"
],
"segment_id": [
"<string>"
],
"customer_group_id": [
"<string>"
],
"redemption_limits": {
"total_redemptions": 123,
"per_customer_redemptions": 123,
"per_coupon_code_redemptions": 123
},
"minimum_order_total": 0,
"for_first_time_customer_only": false,
"can_earn_loyalty_points": true,
"can_redeem_loyalty_points": true,
"expires_at": "2023-11-07T05:31:56Z",
"application_rules": {
"max_applicable_items": 123
},
"visibility_scope": "public"
}
'import requests
url = "https://staging.api.commercengine.io/api/v1/{store_id}/admin/offer/coupons/{id}"
payload = {
"name": "<string>",
"can_be_used_with_promotion": False,
"starts_at": "2023-11-07T05:31:56Z",
"details": {
"discount_type": "percentage",
"discount_percent": 123,
"maximum_discount_amount": 123,
"products": [
{
"product_id": "<string>",
"variant_id": "<string>",
"minimum_quantity": 123,
"maximum_quantity": 123,
"minimum_value": 123,
"maximum_value": 123
}
],
"category_id": ["<string>"]
},
"coupon_code": ["<string>"],
"description": "<string>",
"tags": ["<string>"],
"customer_id": ["<string>"],
"segment_id": ["<string>"],
"customer_group_id": ["<string>"],
"redemption_limits": {
"total_redemptions": 123,
"per_customer_redemptions": 123,
"per_coupon_code_redemptions": 123
},
"minimum_order_total": 0,
"for_first_time_customer_only": False,
"can_earn_loyalty_points": True,
"can_redeem_loyalty_points": True,
"expires_at": "2023-11-07T05:31:56Z",
"application_rules": { "max_applicable_items": 123 },
"visibility_scope": "public"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
can_be_used_with_promotion: false,
starts_at: '2023-11-07T05:31:56Z',
details: {
discount_type: 'percentage',
discount_percent: 123,
maximum_discount_amount: 123,
products: [
{
product_id: '<string>',
variant_id: '<string>',
minimum_quantity: 123,
maximum_quantity: 123,
minimum_value: 123,
maximum_value: 123
}
],
category_id: ['<string>']
},
coupon_code: ['<string>'],
description: '<string>',
tags: ['<string>'],
customer_id: ['<string>'],
segment_id: ['<string>'],
customer_group_id: ['<string>'],
redemption_limits: {
total_redemptions: 123,
per_customer_redemptions: 123,
per_coupon_code_redemptions: 123
},
minimum_order_total: 0,
for_first_time_customer_only: false,
can_earn_loyalty_points: true,
can_redeem_loyalty_points: true,
expires_at: '2023-11-07T05:31:56Z',
application_rules: {max_applicable_items: 123},
visibility_scope: 'public'
})
};
fetch('https://staging.api.commercengine.io/api/v1/{store_id}/admin/offer/coupons/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://staging.api.commercengine.io/api/v1/{store_id}/admin/offer/coupons/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'can_be_used_with_promotion' => false,
'starts_at' => '2023-11-07T05:31:56Z',
'details' => [
'discount_type' => 'percentage',
'discount_percent' => 123,
'maximum_discount_amount' => 123,
'products' => [
[
'product_id' => '<string>',
'variant_id' => '<string>',
'minimum_quantity' => 123,
'maximum_quantity' => 123,
'minimum_value' => 123,
'maximum_value' => 123
]
],
'category_id' => [
'<string>'
]
],
'coupon_code' => [
'<string>'
],
'description' => '<string>',
'tags' => [
'<string>'
],
'customer_id' => [
'<string>'
],
'segment_id' => [
'<string>'
],
'customer_group_id' => [
'<string>'
],
'redemption_limits' => [
'total_redemptions' => 123,
'per_customer_redemptions' => 123,
'per_coupon_code_redemptions' => 123
],
'minimum_order_total' => 0,
'for_first_time_customer_only' => false,
'can_earn_loyalty_points' => true,
'can_redeem_loyalty_points' => true,
'expires_at' => '2023-11-07T05:31:56Z',
'application_rules' => [
'max_applicable_items' => 123
],
'visibility_scope' => 'public'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://staging.api.commercengine.io/api/v1/{store_id}/admin/offer/coupons/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"can_be_used_with_promotion\": false,\n \"starts_at\": \"2023-11-07T05:31:56Z\",\n \"details\": {\n \"discount_type\": \"percentage\",\n \"discount_percent\": 123,\n \"maximum_discount_amount\": 123,\n \"products\": [\n {\n \"product_id\": \"<string>\",\n \"variant_id\": \"<string>\",\n \"minimum_quantity\": 123,\n \"maximum_quantity\": 123,\n \"minimum_value\": 123,\n \"maximum_value\": 123\n }\n ],\n \"category_id\": [\n \"<string>\"\n ]\n },\n \"coupon_code\": [\n \"<string>\"\n ],\n \"description\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"customer_id\": [\n \"<string>\"\n ],\n \"segment_id\": [\n \"<string>\"\n ],\n \"customer_group_id\": [\n \"<string>\"\n ],\n \"redemption_limits\": {\n \"total_redemptions\": 123,\n \"per_customer_redemptions\": 123,\n \"per_coupon_code_redemptions\": 123\n },\n \"minimum_order_total\": 0,\n \"for_first_time_customer_only\": false,\n \"can_earn_loyalty_points\": true,\n \"can_redeem_loyalty_points\": true,\n \"expires_at\": \"2023-11-07T05:31:56Z\",\n \"application_rules\": {\n \"max_applicable_items\": 123\n },\n \"visibility_scope\": \"public\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://staging.api.commercengine.io/api/v1/{store_id}/admin/offer/coupons/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"can_be_used_with_promotion\": false,\n \"starts_at\": \"2023-11-07T05:31:56Z\",\n \"details\": {\n \"discount_type\": \"percentage\",\n \"discount_percent\": 123,\n \"maximum_discount_amount\": 123,\n \"products\": [\n {\n \"product_id\": \"<string>\",\n \"variant_id\": \"<string>\",\n \"minimum_quantity\": 123,\n \"maximum_quantity\": 123,\n \"minimum_value\": 123,\n \"maximum_value\": 123\n }\n ],\n \"category_id\": [\n \"<string>\"\n ]\n },\n \"coupon_code\": [\n \"<string>\"\n ],\n \"description\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"customer_id\": [\n \"<string>\"\n ],\n \"segment_id\": [\n \"<string>\"\n ],\n \"customer_group_id\": [\n \"<string>\"\n ],\n \"redemption_limits\": {\n \"total_redemptions\": 123,\n \"per_customer_redemptions\": 123,\n \"per_coupon_code_redemptions\": 123\n },\n \"minimum_order_total\": 0,\n \"for_first_time_customer_only\": false,\n \"can_earn_loyalty_points\": true,\n \"can_redeem_loyalty_points\": true,\n \"expires_at\": \"2023-11-07T05:31:56Z\",\n \"application_rules\": {\n \"max_applicable_items\": 123\n },\n \"visibility_scope\": \"public\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging.api.commercengine.io/api/v1/{store_id}/admin/offer/coupons/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"can_be_used_with_promotion\": false,\n \"starts_at\": \"2023-11-07T05:31:56Z\",\n \"details\": {\n \"discount_type\": \"percentage\",\n \"discount_percent\": 123,\n \"maximum_discount_amount\": 123,\n \"products\": [\n {\n \"product_id\": \"<string>\",\n \"variant_id\": \"<string>\",\n \"minimum_quantity\": 123,\n \"maximum_quantity\": 123,\n \"minimum_value\": 123,\n \"maximum_value\": 123\n }\n ],\n \"category_id\": [\n \"<string>\"\n ]\n },\n \"coupon_code\": [\n \"<string>\"\n ],\n \"description\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"customer_id\": [\n \"<string>\"\n ],\n \"segment_id\": [\n \"<string>\"\n ],\n \"customer_group_id\": [\n \"<string>\"\n ],\n \"redemption_limits\": {\n \"total_redemptions\": 123,\n \"per_customer_redemptions\": 123,\n \"per_coupon_code_redemptions\": 123\n },\n \"minimum_order_total\": 0,\n \"for_first_time_customer_only\": false,\n \"can_earn_loyalty_points\": true,\n \"can_redeem_loyalty_points\": true,\n \"expires_at\": \"2023-11-07T05:31:56Z\",\n \"application_rules\": {\n \"max_applicable_items\": 123\n },\n \"visibility_scope\": \"public\"\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"success": true,
"content": {
"coupon": {
"name": "<string>",
"status": "draft",
"customer_eligibility": "all",
"can_be_used_with_promotion": false,
"starts_at": "2023-11-07T05:31:56Z",
"details": {
"discount_type": "percentage",
"discount_percent": 123,
"maximum_discount_amount": 123,
"products": [
{
"product_id": "<string>",
"variant_id": "<string>",
"minimum_quantity": 123,
"maximum_quantity": 123,
"minimum_value": 123,
"maximum_value": 123
}
],
"category_id": [
"<string>"
]
},
"applies_to_product": "all",
"coupon_type": "discount",
"coupon_code": [
"<string>"
],
"id": "<string>",
"description": "<string>",
"tags": [
"<string>"
],
"active": true,
"customer_id": [
"<string>"
],
"segment_id": [
"<string>"
],
"customer_group_id": [
"<string>"
],
"redemption_limits": {
"total_redemptions": 123,
"per_customer_redemptions": 123,
"per_coupon_code_redemptions": 123
},
"redemption_count": 123,
"minimum_order_total": 0,
"for_first_time_customer_only": false,
"can_earn_loyalty_points": true,
"can_redeem_loyalty_points": true,
"expires_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"application_rules": {
"max_applicable_items": 123,
"application_priority": "cheapest_first"
},
"visibility_scope": "public",
"terms_and_conditions": [
"<string>"
]
}
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
coupon id
Body
application/json
- Coupon
- Coupon
- Coupon
- Coupon
- Coupon
- Coupon
- Coupon
- Coupon
this key is ignored in create coupon api and draft status will be added by default. required in update coupon api only.
Available options:
draft, scheduled, active, inactive Available options:
all, customer, segment, customer-group - PercentageDiscountRule
- FixedAmountDiscountRule
Show child attributes
Show child attributes
Available options:
all, product, category Available options:
discount, tiered-discount, free-goods, fixed-price, free-shipping, buy-x-get-y, volume-based, accelerated-rewards required if customer_eligibility = customer
required if customer_eligibility = segment
Show child attributes
Show child attributes
Ignored when coupon_type or promotion_type is tiered-discount. Each slab in details defines its own order_value threshold.
Show child attributes
Show child attributes
visibility scope of the coupon. only public coupons are visible in storefront.
Available options:
public, private Was this page helpful?
⌘I