cURL
curl --request DELETE '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.archiveReward({ rewardId: "launch20" });import os
from integrateledger import ledger
client = ledger(api_key=os.environ["LEDGER_API_KEY"])
client.archive_reward("launch20"){
"item": {
"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
}
]
},
"changed": 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": "<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
Archive a reward
Stop new redemptions of a reward.
DELETE
/
v1
/
rewards
/
{rewardId}
cURL
curl --request DELETE '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.archiveReward({ rewardId: "launch20" });import os
from integrateledger import ledger
client = ledger(api_key=os.environ["LEDGER_API_KEY"])
client.archive_reward("launch20"){
"item": {
"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
}
]
},
"changed": 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": "<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."
}Deactivates every code of the reward, in Ledger and in Stripe, so no new redemptions start. Discounts already on customers’ subscriptions run to their end. Sending the reward again brings it back, with its catalog codes. Needs the Catalog permission at Write.