cURL
curl --request DELETE 'https://api.integrateledger.com/v1/referral-programs/{programId}' \
-H "Authorization: Bearer $LEDGER_API_KEY"import ledger from "integrateledger";
const client = new ledger({ apiKey: process.env.LEDGER_API_KEY ?? "" });
await client.archiveReferralProgram({ programId: "friends" });import os
from integrateledger import ledger
client = ledger(api_key=os.environ["LEDGER_API_KEY"])
client.archive_referral_program("friends"){
"item": {
"id": "<string>",
"name": "<string>",
"referrerRewardId": "<string>",
"refereeRewardId": "<string>",
"trigger": "signup",
"planIds": [
"<string>"
],
"maxRewardsPerReferrer": 123,
"archived": 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": "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 referral program
Stop new referrals in a program.
DELETE
/
v1
/
referral-programs
/
{programId}
cURL
curl --request DELETE 'https://api.integrateledger.com/v1/referral-programs/{programId}' \
-H "Authorization: Bearer $LEDGER_API_KEY"import ledger from "integrateledger";
const client = new ledger({ apiKey: process.env.LEDGER_API_KEY ?? "" });
await client.archiveReferralProgram({ programId: "friends" });import os
from integrateledger import ledger
client = ledger(api_key=os.environ["LEDGER_API_KEY"])
client.archive_referral_program("friends"){
"item": {
"id": "<string>",
"name": "<string>",
"referrerRewardId": "<string>",
"refereeRewardId": "<string>",
"trigger": "signup",
"planIds": [
"<string>"
],
"maxRewardsPerReferrer": 123,
"archived": 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": "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."
}Archives a referral program: customers get no new codes for it and its codes stop working. Referrals already made keep their rewards. Archive a program before archiving a reward it gives (
409 reward_in_use). Needs the Catalog permission at Write.