curl --request PUT \
--url https://api.salesive.com/api/v1/coupons/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"discount": 25,
"active": false
}
'import requests
url = "https://api.salesive.com/api/v1/coupons/{id}"
payload = {
"discount": 25,
"active": False
}
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({discount: 25, active: false})
};
fetch('https://api.salesive.com/api/v1/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://api.salesive.com/api/v1/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([
'discount' => 25,
'active' => false
]),
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://api.salesive.com/api/v1/coupons/{id}"
payload := strings.NewReader("{\n \"discount\": 25,\n \"active\": false\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://api.salesive.com/api/v1/coupons/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"discount\": 25,\n \"active\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.salesive.com/api/v1/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 \"discount\": 25,\n \"active\": false\n}"
response = http.request(request)
puts response.read_body{
"status": 200,
"success": true,
"message": "Coupon updated successfully",
"data": {
"_id": "66b1f2a9c4d5e6f7a8b9c0d1",
"code": "SUMMER20",
"user": "66a0e1b2c3d4e5f6a7b8c9d0",
"shop": "66a0d1c2b3a4958677564738",
"type": "percentage",
"discount": 25,
"usageLimit": 100,
"usageCount": 12,
"usagePerUser": 1,
"minimumOrderAmount": 5000,
"startDate": "2026-06-01T00:00:00.000Z",
"endDate": "2026-08-31T23:59:59.000Z",
"active": false,
"createdAt": "2026-05-20T10:15:00.000Z",
"updatedAt": "2026-06-28T12:30:00.000Z"
}
}{
"status": 401,
"success": false,
"message": "Authentication required",
"data": null
}{
"status": 403,
"success": false,
"message": "Insufficient scope",
"data": null
}{
"status": 404,
"success": false,
"message": "Coupon not found",
"data": null
}Update a coupon
Update an existing discount coupon in the store. Requires the WRITE_DISCOUNTS scope.
curl --request PUT \
--url https://api.salesive.com/api/v1/coupons/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"discount": 25,
"active": false
}
'import requests
url = "https://api.salesive.com/api/v1/coupons/{id}"
payload = {
"discount": 25,
"active": False
}
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({discount: 25, active: false})
};
fetch('https://api.salesive.com/api/v1/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://api.salesive.com/api/v1/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([
'discount' => 25,
'active' => false
]),
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://api.salesive.com/api/v1/coupons/{id}"
payload := strings.NewReader("{\n \"discount\": 25,\n \"active\": false\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://api.salesive.com/api/v1/coupons/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"discount\": 25,\n \"active\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.salesive.com/api/v1/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 \"discount\": 25,\n \"active\": false\n}"
response = http.request(request)
puts response.read_body{
"status": 200,
"success": true,
"message": "Coupon updated successfully",
"data": {
"_id": "66b1f2a9c4d5e6f7a8b9c0d1",
"code": "SUMMER20",
"user": "66a0e1b2c3d4e5f6a7b8c9d0",
"shop": "66a0d1c2b3a4958677564738",
"type": "percentage",
"discount": 25,
"usageLimit": 100,
"usageCount": 12,
"usagePerUser": 1,
"minimumOrderAmount": 5000,
"startDate": "2026-06-01T00:00:00.000Z",
"endDate": "2026-08-31T23:59:59.000Z",
"active": false,
"createdAt": "2026-05-20T10:15:00.000Z",
"updatedAt": "2026-06-28T12:30:00.000Z"
}
}{
"status": 401,
"success": false,
"message": "Authentication required",
"data": null
}{
"status": 403,
"success": false,
"message": "Insufficient scope",
"data": null
}{
"status": 404,
"success": false,
"message": "Coupon not found",
"data": null
}Authorizations
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.
Path Parameters
The coupon's unique id.
Body
Fields accepted when updating a coupon. At least one field must be supplied.
New coupon code (alphanumeric only). Stored uppercase; must be unique within the store.
Discount type: fixed or percentage.
fixed, percentage Discount amount. Must be greater than 0.
Maximum total redemptions. Minimum 1.
x >= 1Maximum redemptions per customer. Minimum 1.
x >= 1Minimum order subtotal required. Cannot be negative.
x >= 0Date the coupon becomes valid (ISO 8601).
Date the coupon expires (ISO 8601). Must be on or after startDate.
Whether the coupon is active.
Response
The updated coupon.
Standard Salesive response envelope. The operation-specific payload is carried in data.
Was this page helpful?

