List Discounts
curl --request GET \
--url https://{defaultHost}/v1/discounts \
--header 'Authorization: Bearer <token>'import requests
url = "https://{defaultHost}/v1/discounts"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{defaultHost}/v1/discounts', 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://{defaultHost}/v1/discounts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{defaultHost}/v1/discounts"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{defaultHost}/v1/discounts")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{defaultHost}/v1/discounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"object": "list",
"pagination": {
"count": 1,
"limit": 20,
"page": 1,
"url": "/v1/discounts"
},
"data": [
{
"id": "573637ca-b267-4de3-9a87-4be61d8b63a0",
"object": "discount",
"discount_amount": -500,
"primary": true,
"redeemable_status": "redeemable",
"redeemed_at": 1787228313,
"used_up": false,
"checkout": "f32a5413-dbcb-4053-9bdf-08396d1820da",
"coupon": "9b5a8ae9-3e10-4701-bc07-1fc1b75a4539",
"customer": "add17645-f749-4371-a172-08240be0b226",
"primary_discount": null,
"promotion": null,
"created_at": 1787228373,
"updated_at": 1787228373
}
]
}Discounts
List Discounts
Returns a list of discounts (only redeemed discounts).
GET
/
v1
/
discounts
List Discounts
curl --request GET \
--url https://{defaultHost}/v1/discounts \
--header 'Authorization: Bearer <token>'import requests
url = "https://{defaultHost}/v1/discounts"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{defaultHost}/v1/discounts', 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://{defaultHost}/v1/discounts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{defaultHost}/v1/discounts"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{defaultHost}/v1/discounts")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{defaultHost}/v1/discounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"object": "list",
"pagination": {
"count": 1,
"limit": 20,
"page": 1,
"url": "/v1/discounts"
},
"data": [
{
"id": "573637ca-b267-4de3-9a87-4be61d8b63a0",
"object": "discount",
"discount_amount": -500,
"primary": true,
"redeemable_status": "redeemable",
"redeemed_at": 1787228313,
"used_up": false,
"checkout": "f32a5413-dbcb-4053-9bdf-08396d1820da",
"coupon": "9b5a8ae9-3e10-4701-bc07-1fc1b75a4539",
"customer": "add17645-f749-4371-a172-08240be0b226",
"primary_discount": null,
"promotion": null,
"created_at": 1787228373,
"updated_at": 1787228373
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Only return objects with the given coupon IDs.
Only return objects that belong to the given customers.
A limit on the number of items to be returned, between 1 and 100.
The page of items you want returned.
Only return the primary discounts, the first one when the coupon is recurring.
Only return objects that belong to the given primary discount.
Only return objects with the given promotion IDs.
Was this page helpful?