cURL
curl --request GET 'https://api.integrateledger.com/v1/rewards/launch20' \
-H "Authorization: Bearer $LEDGER_API_KEY"import ledger from "integrateledger";
const client = new ledger({ apiKey: process.env.LEDGER_API_KEY ?? "" });
await client.getReward({ rewardId: "launch20" });import os
from integrateledger import ledger
client = ledger(api_key=os.environ["LEDGER_API_KEY"])
client.get_reward("launch20"){
"id": "<string>",
"name": "<string>",
"kind": "coupon",
"coupon": {
"percentOff": 123,
"amountOffCents": 123,
"currency": "<string>",
"duration": "once",
"durationMonths": 123,
"planIds": [
"<string>"
]
},
"grant": {
"items": [
{
"featureId": "<string>",
"amount": 123,
"expiresAfter": {
"days": 123,
"months": 123
}
}
]
},
"maxRedemptions": 123,
"timesRedeemed": 123,
"redeemBy": "<string>",
"oncePerCustomer": true,
"archived": true,
"stripeSyncStatus": "pending",
"stripeSyncError": "<string>",
"promotionCodes": [
{
"code": "<string>",
"source": "catalog",
"active": true,
"customerId": "<string>",
"maxRedemptions": 123,
"timesRedeemed": 123,
"expiresAt": "<string>",
"firstTimeOnly": true
}
]
}{
"error": "<string>",
"message": "No customer \"user_123\" exists in this environment. Create it with POST /v1/customers, or check that the API key is for the right environment.",
"issues": [
{
"path": "<string>",
"message": "<string>"
}
]
}{
"error": "insufficient_permissions",
"requiredScope": "customers:read",
"message": "No customer \"user_123\" exists in this environment. Create it with POST /v1/customers, or check that the API key is for the right environment."
}{
"error": "<string>",
"message": "No customer \"user_123\" exists in this environment. Create it with POST /v1/customers, or check that the API key is for the right environment.",
"issues": [
{
"path": "<string>",
"message": "<string>"
}
]
}{
"error": "rate_limited",
"message": "No customer \"user_123\" exists in this environment. Create it with POST /v1/customers, or check that the API key is for the right environment."
}Rewards
Get a reward
One reward with its promotion codes.
GET
/
v1
/
rewards
/
{rewardId}
cURL
curl --request GET 'https://api.integrateledger.com/v1/rewards/launch20' \
-H "Authorization: Bearer $LEDGER_API_KEY"import ledger from "integrateledger";
const client = new ledger({ apiKey: process.env.LEDGER_API_KEY ?? "" });
await client.getReward({ rewardId: "launch20" });import os
from integrateledger import ledger
client = ledger(api_key=os.environ["LEDGER_API_KEY"])
client.get_reward("launch20"){
"id": "<string>",
"name": "<string>",
"kind": "coupon",
"coupon": {
"percentOff": 123,
"amountOffCents": 123,
"currency": "<string>",
"duration": "once",
"durationMonths": 123,
"planIds": [
"<string>"
]
},
"grant": {
"items": [
{
"featureId": "<string>",
"amount": 123,
"expiresAfter": {
"days": 123,
"months": 123
}
}
]
},
"maxRedemptions": 123,
"timesRedeemed": 123,
"redeemBy": "<string>",
"oncePerCustomer": true,
"archived": true,
"stripeSyncStatus": "pending",
"stripeSyncError": "<string>",
"promotionCodes": [
{
"code": "<string>",
"source": "catalog",
"active": true,
"customerId": "<string>",
"maxRedemptions": 123,
"timesRedeemed": 123,
"expiresAt": "<string>",
"firstTimeOnly": true
}
]
}{
"error": "<string>",
"message": "No customer \"user_123\" exists in this environment. Create it with POST /v1/customers, or check that the API key is for the right environment.",
"issues": [
{
"path": "<string>",
"message": "<string>"
}
]
}{
"error": "insufficient_permissions",
"requiredScope": "customers:read",
"message": "No customer \"user_123\" exists in this environment. Create it with POST /v1/customers, or check that the API key is for the right environment."
}{
"error": "<string>",
"message": "No customer \"user_123\" exists in this environment. Create it with POST /v1/customers, or check that the API key is for the right environment.",
"issues": [
{
"path": "<string>",
"message": "<string>"
}
]
}{
"error": "rate_limited",
"message": "No customer \"user_123\" exists in this environment. Create it with POST /v1/customers, or check that the API key is for the right environment."
}Returns one reward, archived or not, with its promotion codes.
stripeSyncStatus is synced once its Stripe coupon and codes exist, pending while Ledger waits for its plans’ Stripe Products or for Stripe, and failed with a reason Ledger retries hourly. An unknown ID returns 404 reward_not_found. Needs the Catalog permission at Read.Authorizations
Path Parameters
Response
The reward, archived or not
Why the last Stripe sync didn't finish: promotion_code_taken (a code is active in Stripe already, such as a Dashboard code), waiting_for_plan_products, too_many_products (the coupon would cover more than the 100 Products a Stripe coupon takes: name fewer plans), or a Stripe failure. Null once synced.