curl --request GET \
--url https://api.privy.com/v1/coupons/{id}/codes/{code} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.privy.com/v1/coupons/{id}/codes/{code}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.privy.com/v1/coupons/{id}/codes/{code}', 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.privy.com/v1/coupons/{id}/codes/{code}",
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://api.privy.com/v1/coupons/{id}/codes/{code}"
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://api.privy.com/v1/coupons/{id}/codes/{code}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.privy.com/v1/coupons/{id}/codes/{code}")
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{
"data": {
"code": "VIP4X9K2",
"redeemed": true,
"usage_count": 1
},
"note": "redeemed and usage_count come from the connected store's usage counter, not an event log: redemption dates, order ids, and customer attribution are not available."
}{
"error": {
"code": "unauthorized",
"message": "Bearer token is missing or invalid"
}
}{
"error": {
"code": "insufficient_scope",
"message": "Token does not have the required scope"
}
}{
"error": {
"code": "not_found",
"message": "Code not found on the connected store"
}
}{
"error": {
"code": "unsupported_coupon_type",
"message": "Manual coupon pools have no store-side usage counter to check."
}
}{
"error": {
"code": "store_rate_limited",
"message": "The connected store is rate limiting requests. Try again shortly."
}
}{
"error": {
"code": "store_unavailable",
"message": "The connected store could not be reached. Try again shortly."
}
}Check a coupon code
Check whether an individual code from a Shopify or BigCommerce pool has been redeemed, read live from the connected store’s per-code usage counter (Privy stores no redemption events).
This is a counter, not an event log: usage_count says how many times
the store has accepted the code, but redemption dates, order ids, and
customer attribution are not available — every response repeats this in
an in-band note. Manual pools have no store-side counter and return
422 unsupported_coupon_type.
A spot check for individual codes — there is no bulk sweep; asking “which of my thousands of codes were redeemed” is not served by this endpoint.
Membership semantics: a master pool’s single code is matched exactly (case-insensitively) before the store is asked. Unique-pool codes are resolved against the store directly — Privy stores no per-code linkage for platform pools, so a code from one of your OTHER pools would still resolve; the check never crosses accounts.
Required scope: coupons_read
curl --request GET \
--url https://api.privy.com/v1/coupons/{id}/codes/{code} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.privy.com/v1/coupons/{id}/codes/{code}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.privy.com/v1/coupons/{id}/codes/{code}', 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.privy.com/v1/coupons/{id}/codes/{code}",
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://api.privy.com/v1/coupons/{id}/codes/{code}"
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://api.privy.com/v1/coupons/{id}/codes/{code}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.privy.com/v1/coupons/{id}/codes/{code}")
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{
"data": {
"code": "VIP4X9K2",
"redeemed": true,
"usage_count": 1
},
"note": "redeemed and usage_count come from the connected store's usage counter, not an event log: redemption dates, order ids, and customer attribution are not available."
}{
"error": {
"code": "unauthorized",
"message": "Bearer token is missing or invalid"
}
}{
"error": {
"code": "insufficient_scope",
"message": "Token does not have the required scope"
}
}{
"error": {
"code": "not_found",
"message": "Code not found on the connected store"
}
}{
"error": {
"code": "unsupported_coupon_type",
"message": "Manual coupon pools have no store-side usage counter to check."
}
}{
"error": {
"code": "store_rate_limited",
"message": "The connected store is rate limiting requests. Try again shortly."
}
}{
"error": {
"code": "store_unavailable",
"message": "The connected store could not be reached. Try again shortly."
}
}Authorizations
Send either an API token or an OAuth access token as
Authorization: Bearer <token>. See the Authentication page for details.
Headers
Target a subaccount instead of the main connected account.
Pass a subaccount id from get_account's subaccounts list. Only direct subaccounts
of the connected account are reachable — omit this for the main account itself.
Path Parameters
The coupon pool's unique identifier (returned as id in coupon responses). Ids are opaque public strings — a numeric id from a Privy dashboard URL is not a valid API id and will 404; list coupons and match by title instead.
The coupon code to check, URL-encoded. Matched case-insensitively.
Was this page helpful?