cURL
curl --request GET 'https://api.integrateledger.com/v1/customers/redemptions?customerId=user_123' \
-H "Authorization: Bearer $LEDGER_API_KEY"import ledger from "integrateledger";
const client = new ledger({ apiKey: process.env.LEDGER_API_KEY ?? "" });
await client.listRedemptions({ customerId: "user_123" });import os
from integrateledger import ledger
client = ledger(api_key=os.environ["LEDGER_API_KEY"])
client.list_redemptions(customer_id="user_123"){
"items": [
{
"redemptionId": 123,
"rewardId": "<string>",
"kind": "coupon",
"code": "<string>",
"status": "pending",
"appliesFrom": "next_invoice",
"subscriptionId": 123,
"discount": {
"percentOff": 123,
"amountOffCents": 123,
"currency": "<string>",
"duration": "once",
"durationMonths": 123
},
"grants": [
{
"featureId": "<string>",
"amount": 123,
"expiresAt": "<string>"
}
],
"endsAt": "<string>",
"endedReason": "duration",
"createdAt": "<string>"
}
]
}{
"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."
}Customers
List a customer's redemptions
The coupons a customer redeemed, and where each one is.
GET
/
v1
/
customers
/
redemptions
cURL
curl --request GET 'https://api.integrateledger.com/v1/customers/redemptions?customerId=user_123' \
-H "Authorization: Bearer $LEDGER_API_KEY"import ledger from "integrateledger";
const client = new ledger({ apiKey: process.env.LEDGER_API_KEY ?? "" });
await client.listRedemptions({ customerId: "user_123" });import os
from integrateledger import ledger
client = ledger(api_key=os.environ["LEDGER_API_KEY"])
client.list_redemptions(customer_id="user_123"){
"items": [
{
"redemptionId": 123,
"rewardId": "<string>",
"kind": "coupon",
"code": "<string>",
"status": "pending",
"appliesFrom": "next_invoice",
"subscriptionId": 123,
"discount": {
"percentOff": 123,
"amountOffCents": 123,
"currency": "<string>",
"duration": "once",
"durationMonths": 123
},
"grants": [
{
"featureId": "<string>",
"amount": 123,
"expiresAt": "<string>"
}
],
"endsAt": "<string>",
"endedReason": "duration",
"createdAt": "<string>"
}
]
}{
"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."
}Lists every coupon the customer redeemed, newest first: through the API, on attach, or typed in Checkout.
status is pending, queued, active, ended (with endedReason: duration, subscription_ended or removed) or void (never applied, such as an abandoned Checkout, whose use was given back). Get a customer lists the live ones as discounts. Needs the Customers permission at Read.