Coupons
Get Coupon
Fetch a single coupon by ID, including its redemption gate.
GET
/
v1
/
coupons
/
{id}
Get one coupon (tenant-scoped)
curl --request GET \
--url https://billing.example.com/v1/coupons/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://billing.example.com/v1/coupons/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://billing.example.com/v1/coupons/{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://billing.example.com/v1/coupons/{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://billing.example.com/v1/coupons/{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://billing.example.com/v1/coupons/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://billing.example.com/v1/coupons/{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{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tenant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"code": "<string>",
"discount_type": "percent",
"discount_value": 123,
"duration": "forever",
"duration_months": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "validation_failed",
"message": "<string>"
}
}Returns one coupon as an addressable object — the record behind the
dashboard’s coupon page. Coupons are tenant-scoped: an ID that belongs to
another tenant returns
Errors use the standard envelope — see Errors.
404, the same as a missing one. To browse the
catalog use List Coupons; to flip the
redemption gate use Update Coupon.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string (UUID) | Yes | Coupon ID (path) |
Example Request
curl https://api.recurso.dev/v1/coupons/6f3c2a91-4b7e-4d0a-9c1e-8a2f5b7d3e10 \
-H "Authorization: Bearer $API_KEY"
Response
{
"data": {
"id": "6f3c2a91-4b7e-4d0a-9c1e-8a2f5b7d3e10",
"tenant_id": "2b9e1c44-7d3a-4f6b-8e21-5c0d9a7f1b33",
"code": "SUMMER25",
"discount_type": "percent",
"discount_value": 25,
"duration": "repeating",
"duration_months": 3,
"active": true,
"created_at": "2026-04-01T09:00:00Z",
"updated_at": "2026-04-01T09:00:00Z"
}
}
Fields
| Field | Type | Description |
|---|---|---|
id | string (UUID) | Coupon ID |
tenant_id | string (UUID) | Owning tenant |
code | string | The redeemable code, unique per tenant |
discount_type | string | percent or amount |
discount_value | integer | Percent (for percent) or the discount in minor currency units (for amount) |
duration | string | once, repeating, or forever |
duration_months | integer | Months the discount applies; only present for repeating |
active | boolean | Whether new subscriptions may redeem the code. Deactivated coupons are rejected at subscription creation; existing subscriptions keep their applied discount |
created_at | string (RFC 3339) | Creation timestamp |
updated_at | string (RFC 3339) | Last modification timestamp |
Errors
| Status | Code | When | Fix |
|---|---|---|---|
400 | validation_failed | id is not a valid UUID | Pass the coupon’s UUID |
401 | unauthorized | Missing or invalid API key / session | Send Authorization: Bearer $API_KEY |
404 | not_found | No coupon with that ID in your tenant (cross-tenant IDs are never leaked) | Check the ID against List Coupons |
500 | internal_error | Loading the coupon failed | Retry; contact support if it persists |
⌘I
Get one coupon (tenant-scoped)
curl --request GET \
--url https://billing.example.com/v1/coupons/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://billing.example.com/v1/coupons/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://billing.example.com/v1/coupons/{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://billing.example.com/v1/coupons/{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://billing.example.com/v1/coupons/{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://billing.example.com/v1/coupons/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://billing.example.com/v1/coupons/{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{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tenant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"code": "<string>",
"discount_type": "percent",
"discount_value": 123,
"duration": "forever",
"duration_months": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "validation_failed",
"message": "<string>"
}
}