Update Coupon
curl --request PUT \
--url https://api.sellauth.com/v1/shops/{shopId}/coupons/{couponId}/update \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"code": "culpa",
"global": false,
"discount": 19,
"type": "percentage",
"max_uses": 25,
"max_uses_per_customer": 22,
"min_invoice_price": 18,
"start_date": "2020-09-01",
"expiration_date": "2020-09-01",
"allowed_emails": [
"reichel.zetta@example.net"
],
"payment_method_ids": null,
"disable_if_volume_discount": false,
"disable_if_quantity_deal": false,
"disable_if_bundle_offer": false,
"disable_if_gateway_discount": true,
"disable_if_affiliate_discount": true,
"uses_count_mode": "paid",
"applies_to_renewals": true,
"items": [
"culpa"
]
}
'import requests
url = "https://api.sellauth.com/v1/shops/{shopId}/coupons/{couponId}/update"
payload = {
"code": "culpa",
"global": False,
"discount": 19,
"type": "percentage",
"max_uses": 25,
"max_uses_per_customer": 22,
"min_invoice_price": 18,
"start_date": "2020-09-01",
"expiration_date": "2020-09-01",
"allowed_emails": ["reichel.zetta@example.net"],
"payment_method_ids": None,
"disable_if_volume_discount": False,
"disable_if_quantity_deal": False,
"disable_if_bundle_offer": False,
"disable_if_gateway_discount": True,
"disable_if_affiliate_discount": True,
"uses_count_mode": "paid",
"applies_to_renewals": True,
"items": ["culpa"]
}
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({
code: 'culpa',
global: false,
discount: 19,
type: 'percentage',
max_uses: 25,
max_uses_per_customer: 22,
min_invoice_price: 18,
start_date: '2020-09-01',
expiration_date: '2020-09-01',
allowed_emails: ['reichel.zetta@example.net'],
payment_method_ids: null,
disable_if_volume_discount: false,
disable_if_quantity_deal: false,
disable_if_bundle_offer: false,
disable_if_gateway_discount: true,
disable_if_affiliate_discount: true,
uses_count_mode: 'paid',
applies_to_renewals: true,
items: ['culpa']
})
};
fetch('https://api.sellauth.com/v1/shops/{shopId}/coupons/{couponId}/update', 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.sellauth.com/v1/shops/{shopId}/coupons/{couponId}/update",
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([
'code' => 'culpa',
'global' => false,
'discount' => 19,
'type' => 'percentage',
'max_uses' => 25,
'max_uses_per_customer' => 22,
'min_invoice_price' => 18,
'start_date' => '2020-09-01',
'expiration_date' => '2020-09-01',
'allowed_emails' => [
'reichel.zetta@example.net'
],
'payment_method_ids' => null,
'disable_if_volume_discount' => false,
'disable_if_quantity_deal' => false,
'disable_if_bundle_offer' => false,
'disable_if_gateway_discount' => true,
'disable_if_affiliate_discount' => true,
'uses_count_mode' => 'paid',
'applies_to_renewals' => true,
'items' => [
'culpa'
]
]),
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.sellauth.com/v1/shops/{shopId}/coupons/{couponId}/update"
payload := strings.NewReader("{\n \"code\": \"culpa\",\n \"global\": false,\n \"discount\": 19,\n \"type\": \"percentage\",\n \"max_uses\": 25,\n \"max_uses_per_customer\": 22,\n \"min_invoice_price\": 18,\n \"start_date\": \"2020-09-01\",\n \"expiration_date\": \"2020-09-01\",\n \"allowed_emails\": [\n \"reichel.zetta@example.net\"\n ],\n \"payment_method_ids\": null,\n \"disable_if_volume_discount\": false,\n \"disable_if_quantity_deal\": false,\n \"disable_if_bundle_offer\": false,\n \"disable_if_gateway_discount\": true,\n \"disable_if_affiliate_discount\": true,\n \"uses_count_mode\": \"paid\",\n \"applies_to_renewals\": true,\n \"items\": [\n \"culpa\"\n ]\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.sellauth.com/v1/shops/{shopId}/coupons/{couponId}/update")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"code\": \"culpa\",\n \"global\": false,\n \"discount\": 19,\n \"type\": \"percentage\",\n \"max_uses\": 25,\n \"max_uses_per_customer\": 22,\n \"min_invoice_price\": 18,\n \"start_date\": \"2020-09-01\",\n \"expiration_date\": \"2020-09-01\",\n \"allowed_emails\": [\n \"reichel.zetta@example.net\"\n ],\n \"payment_method_ids\": null,\n \"disable_if_volume_discount\": false,\n \"disable_if_quantity_deal\": false,\n \"disable_if_bundle_offer\": false,\n \"disable_if_gateway_discount\": true,\n \"disable_if_affiliate_discount\": true,\n \"uses_count_mode\": \"paid\",\n \"applies_to_renewals\": true,\n \"items\": [\n \"culpa\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sellauth.com/v1/shops/{shopId}/coupons/{couponId}/update")
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 \"code\": \"culpa\",\n \"global\": false,\n \"discount\": 19,\n \"type\": \"percentage\",\n \"max_uses\": 25,\n \"max_uses_per_customer\": 22,\n \"min_invoice_price\": 18,\n \"start_date\": \"2020-09-01\",\n \"expiration_date\": \"2020-09-01\",\n \"allowed_emails\": [\n \"reichel.zetta@example.net\"\n ],\n \"payment_method_ids\": null,\n \"disable_if_volume_discount\": false,\n \"disable_if_quantity_deal\": false,\n \"disable_if_bundle_offer\": false,\n \"disable_if_gateway_discount\": true,\n \"disable_if_affiliate_discount\": true,\n \"uses_count_mode\": \"paid\",\n \"applies_to_renewals\": true,\n \"items\": [\n \"culpa\"\n ]\n}"
response = http.request(request)
puts response.read_bodyCoupons
Update Coupon
Updates a specific coupon.
PUT
/
v1
/
shops
/
{shopId}
/
coupons
/
{couponId}
/
update
Update Coupon
curl --request PUT \
--url https://api.sellauth.com/v1/shops/{shopId}/coupons/{couponId}/update \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"code": "culpa",
"global": false,
"discount": 19,
"type": "percentage",
"max_uses": 25,
"max_uses_per_customer": 22,
"min_invoice_price": 18,
"start_date": "2020-09-01",
"expiration_date": "2020-09-01",
"allowed_emails": [
"reichel.zetta@example.net"
],
"payment_method_ids": null,
"disable_if_volume_discount": false,
"disable_if_quantity_deal": false,
"disable_if_bundle_offer": false,
"disable_if_gateway_discount": true,
"disable_if_affiliate_discount": true,
"uses_count_mode": "paid",
"applies_to_renewals": true,
"items": [
"culpa"
]
}
'import requests
url = "https://api.sellauth.com/v1/shops/{shopId}/coupons/{couponId}/update"
payload = {
"code": "culpa",
"global": False,
"discount": 19,
"type": "percentage",
"max_uses": 25,
"max_uses_per_customer": 22,
"min_invoice_price": 18,
"start_date": "2020-09-01",
"expiration_date": "2020-09-01",
"allowed_emails": ["reichel.zetta@example.net"],
"payment_method_ids": None,
"disable_if_volume_discount": False,
"disable_if_quantity_deal": False,
"disable_if_bundle_offer": False,
"disable_if_gateway_discount": True,
"disable_if_affiliate_discount": True,
"uses_count_mode": "paid",
"applies_to_renewals": True,
"items": ["culpa"]
}
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({
code: 'culpa',
global: false,
discount: 19,
type: 'percentage',
max_uses: 25,
max_uses_per_customer: 22,
min_invoice_price: 18,
start_date: '2020-09-01',
expiration_date: '2020-09-01',
allowed_emails: ['reichel.zetta@example.net'],
payment_method_ids: null,
disable_if_volume_discount: false,
disable_if_quantity_deal: false,
disable_if_bundle_offer: false,
disable_if_gateway_discount: true,
disable_if_affiliate_discount: true,
uses_count_mode: 'paid',
applies_to_renewals: true,
items: ['culpa']
})
};
fetch('https://api.sellauth.com/v1/shops/{shopId}/coupons/{couponId}/update', 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.sellauth.com/v1/shops/{shopId}/coupons/{couponId}/update",
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([
'code' => 'culpa',
'global' => false,
'discount' => 19,
'type' => 'percentage',
'max_uses' => 25,
'max_uses_per_customer' => 22,
'min_invoice_price' => 18,
'start_date' => '2020-09-01',
'expiration_date' => '2020-09-01',
'allowed_emails' => [
'reichel.zetta@example.net'
],
'payment_method_ids' => null,
'disable_if_volume_discount' => false,
'disable_if_quantity_deal' => false,
'disable_if_bundle_offer' => false,
'disable_if_gateway_discount' => true,
'disable_if_affiliate_discount' => true,
'uses_count_mode' => 'paid',
'applies_to_renewals' => true,
'items' => [
'culpa'
]
]),
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.sellauth.com/v1/shops/{shopId}/coupons/{couponId}/update"
payload := strings.NewReader("{\n \"code\": \"culpa\",\n \"global\": false,\n \"discount\": 19,\n \"type\": \"percentage\",\n \"max_uses\": 25,\n \"max_uses_per_customer\": 22,\n \"min_invoice_price\": 18,\n \"start_date\": \"2020-09-01\",\n \"expiration_date\": \"2020-09-01\",\n \"allowed_emails\": [\n \"reichel.zetta@example.net\"\n ],\n \"payment_method_ids\": null,\n \"disable_if_volume_discount\": false,\n \"disable_if_quantity_deal\": false,\n \"disable_if_bundle_offer\": false,\n \"disable_if_gateway_discount\": true,\n \"disable_if_affiliate_discount\": true,\n \"uses_count_mode\": \"paid\",\n \"applies_to_renewals\": true,\n \"items\": [\n \"culpa\"\n ]\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.sellauth.com/v1/shops/{shopId}/coupons/{couponId}/update")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"code\": \"culpa\",\n \"global\": false,\n \"discount\": 19,\n \"type\": \"percentage\",\n \"max_uses\": 25,\n \"max_uses_per_customer\": 22,\n \"min_invoice_price\": 18,\n \"start_date\": \"2020-09-01\",\n \"expiration_date\": \"2020-09-01\",\n \"allowed_emails\": [\n \"reichel.zetta@example.net\"\n ],\n \"payment_method_ids\": null,\n \"disable_if_volume_discount\": false,\n \"disable_if_quantity_deal\": false,\n \"disable_if_bundle_offer\": false,\n \"disable_if_gateway_discount\": true,\n \"disable_if_affiliate_discount\": true,\n \"uses_count_mode\": \"paid\",\n \"applies_to_renewals\": true,\n \"items\": [\n \"culpa\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sellauth.com/v1/shops/{shopId}/coupons/{couponId}/update")
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 \"code\": \"culpa\",\n \"global\": false,\n \"discount\": 19,\n \"type\": \"percentage\",\n \"max_uses\": 25,\n \"max_uses_per_customer\": 22,\n \"min_invoice_price\": 18,\n \"start_date\": \"2020-09-01\",\n \"expiration_date\": \"2020-09-01\",\n \"allowed_emails\": [\n \"reichel.zetta@example.net\"\n ],\n \"payment_method_ids\": null,\n \"disable_if_volume_discount\": false,\n \"disable_if_quantity_deal\": false,\n \"disable_if_bundle_offer\": false,\n \"disable_if_gateway_discount\": true,\n \"disable_if_affiliate_discount\": true,\n \"uses_count_mode\": \"paid\",\n \"applies_to_renewals\": true,\n \"items\": [\n \"culpa\"\n ]\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
You can retrieve your API key from your dashboard under Account > Developers.
Body
application/json
Example:
"culpa"
Example:
false
Must be at least -999999. Must not be greater than 999999.
Example:
19
Available options:
percentage, fixed Example:
"percentage"
Must be at least 1. Must not be greater than 999999.
Example:
25
Must be at least 1. Must not be greater than 999999.
Example:
22
Must be at least 0. Must not be greater than 999999.
Example:
18
Must be a valid date. Must be a date before 2038-01-19.
Example:
"2020-09-01"
Must be a valid date. Must be a date after today. Must be a date before 2038-01-19.
Example:
"2020-09-01"
Must be a valid email address.
Example:
["reichel.zetta@example.net"]
Example:
null
Example:
false
Example:
false
Example:
false
Example:
true
Example:
true
Available options:
pending, paid Example:
"paid"
Example:
true
This field is required when global is false.
Example:
["culpa"]
Response
200 - undefined