Get Coupons
curl --request GET \
--url https://api.sellauth.com/v1/shops/{shopId}/coupons \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"page": 1,
"perPage": null,
"orderColumn": null,
"orderDirection": null,
"code": null,
"ids": null,
"statuses": null,
"type": null,
"global": null
}
'import requests
url = "https://api.sellauth.com/v1/shops/{shopId}/coupons"
payload = {
"page": 1,
"perPage": None,
"orderColumn": None,
"orderDirection": None,
"code": None,
"ids": None,
"statuses": None,
"type": None,
"global": None
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.get(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
page: 1,
perPage: null,
orderColumn: null,
orderDirection: null,
code: null,
ids: null,
statuses: null,
type: null,
global: null
})
};
fetch('https://api.sellauth.com/v1/shops/{shopId}/coupons', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => json_encode([
'page' => 1,
'perPage' => null,
'orderColumn' => null,
'orderDirection' => null,
'code' => null,
'ids' => null,
'statuses' => null,
'type' => null,
'global' => null
]),
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"
payload := strings.NewReader("{\n \"page\": 1,\n \"perPage\": null,\n \"orderColumn\": null,\n \"orderDirection\": null,\n \"code\": null,\n \"ids\": null,\n \"statuses\": null,\n \"type\": null,\n \"global\": null\n}")
req, _ := http.NewRequest("GET", 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.get("https://api.sellauth.com/v1/shops/{shopId}/coupons")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"page\": 1,\n \"perPage\": null,\n \"orderColumn\": null,\n \"orderDirection\": null,\n \"code\": null,\n \"ids\": null,\n \"statuses\": null,\n \"type\": null,\n \"global\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sellauth.com/v1/shops/{shopId}/coupons")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"page\": 1,\n \"perPage\": null,\n \"orderColumn\": null,\n \"orderDirection\": null,\n \"code\": null,\n \"ids\": null,\n \"statuses\": null,\n \"type\": null,\n \"global\": null\n}"
response = http.request(request)
puts response.read_body{
"current_page": 1,
"data": [
{
"id": 1,
"shop_id": 1,
"code": "SAVE10",
"global": true,
"discount": "10.00",
"uses": 0,
"max_uses": null,
"max_uses_per_customer": null,
"min_invoice_price": null,
"allowed_emails": null,
"disable_if_volume_discount": false,
"type": "percentage",
"start_date": null,
"expiration_date": null,
"uses_count_mode": "pending",
"last_used_at": null,
"total_saved": "0.00",
"revenue_attributed": "0.00",
"items": []
}
],
"first_page_url": "http://api.sellauth.test/v1/shops/1/coupons?page=1",
"from": 1,
"last_page": 1,
"last_page_url": "http://api.sellauth.test/v1/shops/1/coupons?page=1",
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "http://api.sellauth.test/v1/shops/1/coupons?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"next_page_url": null,
"path": "http://api.sellauth.test/v1/shops/1/coupons",
"per_page": 20,
"prev_page_url": null,
"to": 1,
"total": 1
}Coupons
Get Coupons
Retrieves the coupons.
GET
/
v1
/
shops
/
{shopId}
/
coupons
Get Coupons
curl --request GET \
--url https://api.sellauth.com/v1/shops/{shopId}/coupons \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"page": 1,
"perPage": null,
"orderColumn": null,
"orderDirection": null,
"code": null,
"ids": null,
"statuses": null,
"type": null,
"global": null
}
'import requests
url = "https://api.sellauth.com/v1/shops/{shopId}/coupons"
payload = {
"page": 1,
"perPage": None,
"orderColumn": None,
"orderDirection": None,
"code": None,
"ids": None,
"statuses": None,
"type": None,
"global": None
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.get(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
page: 1,
perPage: null,
orderColumn: null,
orderDirection: null,
code: null,
ids: null,
statuses: null,
type: null,
global: null
})
};
fetch('https://api.sellauth.com/v1/shops/{shopId}/coupons', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => json_encode([
'page' => 1,
'perPage' => null,
'orderColumn' => null,
'orderDirection' => null,
'code' => null,
'ids' => null,
'statuses' => null,
'type' => null,
'global' => null
]),
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"
payload := strings.NewReader("{\n \"page\": 1,\n \"perPage\": null,\n \"orderColumn\": null,\n \"orderDirection\": null,\n \"code\": null,\n \"ids\": null,\n \"statuses\": null,\n \"type\": null,\n \"global\": null\n}")
req, _ := http.NewRequest("GET", 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.get("https://api.sellauth.com/v1/shops/{shopId}/coupons")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"page\": 1,\n \"perPage\": null,\n \"orderColumn\": null,\n \"orderDirection\": null,\n \"code\": null,\n \"ids\": null,\n \"statuses\": null,\n \"type\": null,\n \"global\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sellauth.com/v1/shops/{shopId}/coupons")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"page\": 1,\n \"perPage\": null,\n \"orderColumn\": null,\n \"orderDirection\": null,\n \"code\": null,\n \"ids\": null,\n \"statuses\": null,\n \"type\": null,\n \"global\": null\n}"
response = http.request(request)
puts response.read_body{
"current_page": 1,
"data": [
{
"id": 1,
"shop_id": 1,
"code": "SAVE10",
"global": true,
"discount": "10.00",
"uses": 0,
"max_uses": null,
"max_uses_per_customer": null,
"min_invoice_price": null,
"allowed_emails": null,
"disable_if_volume_discount": false,
"type": "percentage",
"start_date": null,
"expiration_date": null,
"uses_count_mode": "pending",
"last_used_at": null,
"total_saved": "0.00",
"revenue_attributed": "0.00",
"items": []
}
],
"first_page_url": "http://api.sellauth.test/v1/shops/1/coupons?page=1",
"from": 1,
"last_page": 1,
"last_page_url": "http://api.sellauth.test/v1/shops/1/coupons?page=1",
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "http://api.sellauth.test/v1/shops/1/coupons?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"next_page_url": null,
"path": "http://api.sellauth.test/v1/shops/1/coupons",
"per_page": 20,
"prev_page_url": null,
"to": 1,
"total": 1
}Authorizations
You can retrieve your API key from your dashboard under Account > Developers.
Path Parameters
The shop ID.
Body
application/json
Page number.
Example:
1
Items per page, 1-100. Must be at least 1. Must not be greater than 100.
Example:
null
Available options:
id, code, discount, uses, start_date, expiration_date, last_used_at, total_saved, revenue_attributed Example:
null
Available options:
asc, desc Example:
null
Filter by coupon code.
Example:
null
Filter by coupon IDs.
Example:
null
Example:
null
Available options:
percentage, fixed Example:
null
Only global (all-products) coupons.
Example:
null
Response
200 - application/json
Example:
1
Show child attributes
Show child attributes
Example:
[
{
"id": 1,
"shop_id": 1,
"code": "SAVE10",
"global": true,
"discount": "10.00",
"uses": 0,
"max_uses": null,
"max_uses_per_customer": null,
"min_invoice_price": null,
"allowed_emails": null,
"disable_if_volume_discount": false,
"type": "percentage",
"start_date": null,
"expiration_date": null,
"uses_count_mode": "pending",
"last_used_at": null,
"total_saved": "0.00",
"revenue_attributed": "0.00",
"items": []
}
]
Example:
"http://api.sellauth.test/v1/shops/1/coupons?page=1"
Example:
1
Example:
1
Example:
"http://api.sellauth.test/v1/shops/1/coupons?page=1"
Show child attributes
Show child attributes
Example:
[
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "http://api.sellauth.test/v1/shops/1/coupons?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
]
Example:
null
Example:
"http://api.sellauth.test/v1/shops/1/coupons"
Example:
20
Example:
null
Example:
1
Example:
1