Retrieve Discount
curl --request GET \
--url https://{defaultHost}/v1/discounts/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://{defaultHost}/v1/discounts/{id}"
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/{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://{defaultHost}/v1/discounts/{id}",
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/{id}"
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/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{defaultHost}/v1/discounts/{id}")
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{
"id": "9515c2f8-ca7e-400d-b4fd-de2590e9ccd3",
"object": "discount",
"discount_amount": -500,
"primary": true,
"redeemable_status": "redeemable",
"redeemed_at": 1796063869,
"used_up": false,
"checkout": "d36d6948-be95-482f-be97-fca0c0cca553",
"coupon": "9f93bc3a-c738-40d4-ac80-f4992305df70",
"customer": "ff69a9b6-0dec-491d-a38a-4f34abbe6a3a",
"primary_discount": null,
"promotion": null,
"created_at": 1796063929,
"updated_at": 1796063929
}Discounts
Retrieve Discount
Retrieves details of a specific discount (only redeemed discounts).
GET
/
v1
/
discounts
/
{id}
Retrieve Discount
curl --request GET \
--url https://{defaultHost}/v1/discounts/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://{defaultHost}/v1/discounts/{id}"
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/{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://{defaultHost}/v1/discounts/{id}",
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/{id}"
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/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{defaultHost}/v1/discounts/{id}")
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{
"id": "9515c2f8-ca7e-400d-b4fd-de2590e9ccd3",
"object": "discount",
"discount_amount": -500,
"primary": true,
"redeemable_status": "redeemable",
"redeemed_at": 1796063869,
"used_up": false,
"checkout": "d36d6948-be95-482f-be97-fca0c0cca553",
"coupon": "9f93bc3a-c738-40d4-ac80-f4992305df70",
"customer": "ff69a9b6-0dec-491d-a38a-4f34abbe6a3a",
"primary_discount": null,
"promotion": null,
"created_at": 1796063929,
"updated_at": 1796063929
}Authorizations
Response
200 - application/json
Success
Expandable – The associated checkout ID.
Expandable – The associated coupon ID.
Expandable – The associated customer ID.
Expandable – The associated discount ID.
Expandable – The associated promotion ID.
Expandable – Property not returned unless expanded.
Was this page helpful?