cURL
curl --request GET 'https://api.integrateledger.com/v1/rewards' \
-H "Authorization: Bearer $LEDGER_API_KEY"import ledger from "integrateledger";
const client = new ledger({ apiKey: process.env.LEDGER_API_KEY ?? "" });
await client.listRewards();import os
from integrateledger import ledger
client = ledger(api_key=os.environ["LEDGER_API_KEY"])
client.list_rewards(){
"items": [
{
"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": "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
List rewards
Your active coupon rewards and their promotion codes.
GET
/
v1
/
rewards
cURL
curl --request GET 'https://api.integrateledger.com/v1/rewards' \
-H "Authorization: Bearer $LEDGER_API_KEY"import ledger from "integrateledger";
const client = new ledger({ apiKey: process.env.LEDGER_API_KEY ?? "" });
await client.listRewards();import os
from integrateledger import ledger
client = ledger(api_key=os.environ["LEDGER_API_KEY"])
client.list_rewards(){
"items": [
{
"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": "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."
}Lists the environment’s active coupon rewards, each with its promotion codes (catalog and API codes, active or not), how many times each was redeemed, and its Stripe sync status. Archived rewards are left out; read one by ID to see it. Needs the Catalog permission at Read.