Skip to content
Developer docs
⌘ K
Dashboard ↗

HTTP endpoints

getPartnerSummary

GET /api/v1/partners/{id}/summary

GET /api/v1/partners/by-external-id/{externalId}/summary

Requires read. Keep the Bearer key on your server.

SDK

ts
grizzlee.getPartnerSummary(partner: { externalId: string; } | { id: string; }): Promise<PartnerSummary>

HTTP

Use your backend's HTTP client. The cURL request shows the wire format. Replace path parameters and example values.

sh
curl --fail-with-body --request GET \
  'https://app.grizzlee.ca/api/v1/partners/{id}/summary' \
  -H "Authorization: Bearer $GRIZZLEE_SERVER_KEY"

Response

HTTP responses wrap this value in data. The SDK returns the value directly unless the note above describes a wrapper.

FieldTypeRequiredDetails
idstringYes
externalIdstringYes
namestringYes
activebooleanYes
referralCodestringYes
clicksobjectYesLink and QR activity across all programs, including former memberships.
programsarrayYesCurrent memberships in programIds order, then former programs with rewards, referrals, payout allocations or debt, sorted by ID.
balancesobjectYes
payoutAccountRequiredbooleanYesTrue when the payout schedule waits for a Stripe account (missingStripeAccount "wait"), the partner has no stripeAccountId, and the partner earns merchant-delivered cash: it belongs to such a program or has such cash pending or approved. Scheduled runs pay this partner nothing until it gets a stripeAccountId.
awaitingPayoutAccountbooleanYesTrue when payoutAccountRequired and a scheduled run already held a payout for it.
awaitingPayoutAccountSinceunionYesDue date (YYYY-MM-DD) of the first run that held a payout. Null unless awaitingPayoutAccount.

clicks

FieldTypeRequiredDetails
clicks.totalnumberYesAll recorded activity, including repeat visits and unclaimed or voided receipts.
clicks.last30DaysnumberYesActivity in the rolling 30 days ending at the summary's read time.

programs[]

FieldTypeRequiredDetails
programs.idstringYes
programs.namestringYes
programs.activebooleanYes
programs.memberbooleanYesWhether the partner currently belongs to this program. Former memberships keep their totals.
programs.trackingobjectYes
programs.attributionCodeunionYes
programs.aliasunionYesThe partner's short code, such as KARL7Q, when attributionCode is set. Customers can type either.
programs.promoCodesarrayYes
programs.qrLinkunionYes
programs.currencyunionYes
programs.rewardTypeunionYes
programs.triggerunionYesWhat earns a reward in this program.
programs.deliveryModeunionYesWho delivers this program's rewards: the Grizzlee wallet or the merchant.
programs.compensationunionNoOrder compensation, with this partner's custom terms when present. Absent for milestones.
programs.milestoneRewardsobjectNo
programs.fixedRefundModeunionYesHow this program refunds fixed rewards. Percentage rewards keep their commission base.
programs.incentiveunionYesWhat a referred customer gets in this program. Null without an offer or a current membership.
programs.termsobjectYesReadable reward terms. Former memberships omit the friend incentive from the text.
programs.displayobjectYesPublic name, headline and milestone label. The headline falls back to terms.text.headline.
programs.linkunionYesReferral link to the program's published destination. Null when unavailable or membership ended.
programs.linkUnavailableReasonunionYesSet when link is null, otherwise null.
programs.clicksobjectYesLink and QR activity in this program. Coupon and in-app channels are excluded.
programs.earnedCentsnumberYesReward value after reversals, across saved reward types and delivery modes.
programs.reversedCentsnumberYesReward value currently reversed. Restorations reduce this total.
programs.referralsobjectYesEach attribution counts once, including displaced referrals and separate order-scoped referrals.
programs.orderCountnumberYesSum of referral orderCount values in this program. Reversed rewards still count; milestones do not.
programs.payoutsobjectYesPaid merchant allocations less returned transfers. Wallet payouts have no program allocations.
programs.balancesobjectYes

programs.tracking

FieldTypeRequiredDetails
programs.tracking.linksbooleanYes
programs.tracking.qrCodesbooleanYes
programs.tracking.attributionCodesbooleanYes
programs.tracking.providerPromoCodesbooleanYes

programs.attributionCode

Variant 1

Type: null.

Variant 2

Type: string.

programs.alias

Variant 1

Type: null.

Variant 2

Type: string.

programs.promoCodes[]

FieldTypeRequiredDetails
programs.promoCodes.idstringYes
programs.promoCodes.companyIdstringYes
programs.promoCodes.partnerIdstringYes
programs.promoCodes.programIdstringYes
programs.promoCodes.integrationIdstringYes
programs.promoCodes.providerunionYes
programs.promoCodes.codestringYes
programs.promoCodes.providerCodeIdunionYesNull until Grizzlee has saved the provider discount ID.
programs.promoCodes.statusunionYes
programs.promoCodes.replacesIdstringNo
programs.promoCodes.couponIdstringNo
programs.promoCodes.incentiveunionYes
programs.promoCodes.programVersionnumberYes
programs.promoCodes.activebooleanYes
programs.promoCodes.createdAtstringYes
programs.promoCodes.deactivatedAtstringNo

programs.promoCodes.provider

Variant 1

Type: string.

Variant 2

Type: string.

programs.promoCodes.providerCodeId

Variant 1

Type: null.

Variant 2

Type: string.

programs.promoCodes.status

Variant 1

Type: string.

Variant 2

Type: string.

Variant 3

Type: string.

programs.promoCodes.incentive

Variant 1

FieldTypeRequiredDetails
programs.promoCodes.incentive.type"percent"Yes
programs.promoCodes.incentive.rateBpsnumberYes
programs.promoCodes.incentive.ordersnumberYesHow many of the friend's orders get the incentive.
programs.promoCodes.incentive.newCustomersOnlybooleanYestrue: use the merchant's newCustomer answer, or recorded purchases when omitted. false: returning customers qualify too. A supplied answer uses the order limit after the referral.
programs.promoCodes.incentive.expiresAfterDaysunionYesDays after the referral was captured, claimed or entered. null means it never expires.
programs.promoCodes.incentive.returnOnFullRefundbooleanYestrue: a full refund gives the use back, so the customer can get the offer again.
programs.promoCodes.incentive.maxDiscountCentsnumberNoLargest discount for one order.
programs.promoCodes.incentive.minOrderCentsnumberNoThe friend's order total before the discount must reach this amount. Checked by the merchant's checkout.
programs.promoCodes.incentive.orderCategoriesobjectNoOrder categories that get the discount. Checked apart from the program's own orderCategories, which decide rewards. Absent means every order qualifies.
programs.promoCodes.incentive.currencyunionYes

programs.promoCodes.incentive.expiresAfterDays

Variant 1

Type: null.

Variant 2

Type: number.

programs.promoCodes.incentive.orderCategories

FieldTypeRequiredDetails
programs.promoCodes.incentive.orderCategories.includearrayNo
programs.promoCodes.incentive.orderCategories.excludearrayNo

programs.promoCodes.incentive.currency

Variant 1

Type: string.

Variant 2

Type: string.

Variant 3

Type: string.

Variant 4

Type: string.

Variant 2

FieldTypeRequiredDetails
programs.promoCodes.incentive.type"fixed"Yes
programs.promoCodes.incentive.ordersnumberYesHow many of the friend's orders get the incentive.
programs.promoCodes.incentive.newCustomersOnlybooleanYestrue: use the merchant's newCustomer answer, or recorded purchases when omitted. false: returning customers qualify too. A supplied answer uses the order limit after the referral.
programs.promoCodes.incentive.expiresAfterDaysunionYesDays after the referral was captured, claimed or entered. null means it never expires.
programs.promoCodes.incentive.returnOnFullRefundbooleanYestrue: a full refund gives the use back, so the customer can get the offer again.
programs.promoCodes.incentive.amountCentsnumberYes
programs.promoCodes.incentive.minOrderCentsnumberNoThe friend's order total before the discount must reach this amount. Checked by the merchant's checkout.
programs.promoCodes.incentive.orderCategoriesobjectNoOrder categories that get the discount. Checked apart from the program's own orderCategories, which decide rewards. Absent means every order qualifies.
programs.promoCodes.incentive.currencyunionYes

programs.promoCodes.incentive.expiresAfterDays

Variant 1

Type: null.

Variant 2

Type: number.

programs.promoCodes.incentive.orderCategories

FieldTypeRequiredDetails
programs.promoCodes.incentive.orderCategories.includearrayNo
programs.promoCodes.incentive.orderCategories.excludearrayNo

programs.promoCodes.incentive.currency

Variant 1

Type: string.

Variant 2

Type: string.

Variant 3

Type: string.

Variant 4

Type: string.

Variant 1

Type: null.

Variant 2

Type: string.

programs.currency

Variant 1

Type: string.

Variant 2

Type: string.

Variant 3

Type: string.

Variant 4

Type: string.

programs.rewardType

Variant 1

Type: string.

Variant 2

Type: string.

Variant 3

Type: string.

programs.trigger

Variant 1

FieldTypeRequiredDetails
programs.trigger.type"order"Yes

Variant 2

FieldTypeRequiredDetails
programs.trigger.type"milestone"Yes
programs.trigger.milestonestringYes

programs.deliveryMode

Variant 1

Type: string.

Variant 2

Type: string.

programs.compensation

Variant 1

FieldTypeRequiredDetails
programs.compensation.type"percentage"Yes
programs.compensation.rateBpsnumberYes
programs.compensation.phasesarrayNo

programs.compensation.phases[]

FieldTypeRequiredDetails
programs.compensation.phases.rateBpsnumberYes
programs.compensation.phases.afterMonthsnumberYes

Variant 2

FieldTypeRequiredDetails
programs.compensation.type"fixed"Yes
programs.compensation.amountCentsnumberYes

programs.milestoneRewards

FieldTypeRequiredDetails
programs.milestoneRewards.eachReportobjectNo
programs.milestoneRewards.atCountobjectNo

programs.milestoneRewards.eachReport

FieldTypeRequiredDetails
programs.milestoneRewards.eachReport.compensationunionYes
programs.milestoneRewards.eachReport.limitnumberNoAbsent means every counted report. Reversed reports do not count toward the limit.

programs.milestoneRewards.eachReport.compensation

Variant 1

FieldTypeRequiredDetails
programs.milestoneRewards.eachReport.compensation.type"fixed"Yes
programs.milestoneRewards.eachReport.compensation.amountCentsnumberYes

Variant 2

FieldTypeRequiredDetails
programs.milestoneRewards.eachReport.compensation.type"percentage"Yes
programs.milestoneRewards.eachReport.compensation.rateBpsnumberYes

programs.milestoneRewards.atCount

FieldTypeRequiredDetails
programs.milestoneRewards.atCount.amountCentsnumberYes
programs.milestoneRewards.atCount.countnumberYes

programs.fixedRefundMode

Variant 1

Type: string.

Variant 2

Type: string.

programs.incentive

Variant 1

Type: null.

Variant 2

FieldTypeRequiredDetails
programs.incentive.type"percent"Yes
programs.incentive.rateBpsnumberYes
programs.incentive.ordersnumberYesHow many of the friend's orders get the incentive.
programs.incentive.newCustomersOnlybooleanYestrue: use the merchant's newCustomer answer, or recorded purchases when omitted. false: returning customers qualify too. A supplied answer uses the order limit after the referral.
programs.incentive.expiresAfterDaysunionYesDays after the referral was captured, claimed or entered. null means it never expires.
programs.incentive.returnOnFullRefundbooleanYestrue: a full refund gives the use back, so the customer can get the offer again.
programs.incentive.maxDiscountCentsnumberNoLargest discount for one order.
programs.incentive.minOrderCentsnumberNoThe friend's order total before the discount must reach this amount. Checked by the merchant's checkout.
programs.incentive.orderCategoriesobjectNoOrder categories that get the discount. Checked apart from the program's own orderCategories, which decide rewards. Absent means every order qualifies.
programs.incentive.currencyunionYes

programs.incentive.expiresAfterDays

Variant 1

Type: null.

Variant 2

Type: number.

programs.incentive.orderCategories

FieldTypeRequiredDetails
programs.incentive.orderCategories.includearrayNo
programs.incentive.orderCategories.excludearrayNo

programs.incentive.currency

Variant 1

Type: string.

Variant 2

Type: string.

Variant 3

Type: string.

Variant 4

Type: string.

Variant 3

FieldTypeRequiredDetails
programs.incentive.type"fixed"Yes
programs.incentive.ordersnumberYesHow many of the friend's orders get the incentive.
programs.incentive.newCustomersOnlybooleanYestrue: use the merchant's newCustomer answer, or recorded purchases when omitted. false: returning customers qualify too. A supplied answer uses the order limit after the referral.
programs.incentive.expiresAfterDaysunionYesDays after the referral was captured, claimed or entered. null means it never expires.
programs.incentive.returnOnFullRefundbooleanYestrue: a full refund gives the use back, so the customer can get the offer again.
programs.incentive.amountCentsnumberYes
programs.incentive.minOrderCentsnumberNoThe friend's order total before the discount must reach this amount. Checked by the merchant's checkout.
programs.incentive.orderCategoriesobjectNoOrder categories that get the discount. Checked apart from the program's own orderCategories, which decide rewards. Absent means every order qualifies.
programs.incentive.currencyunionYes

programs.incentive.expiresAfterDays

Variant 1

Type: null.

Variant 2

Type: number.

programs.incentive.orderCategories

FieldTypeRequiredDetails
programs.incentive.orderCategories.includearrayNo
programs.incentive.orderCategories.excludearrayNo

programs.incentive.currency

Variant 1

Type: string.

Variant 2

Type: string.

Variant 3

Type: string.

Variant 4

Type: string.

programs.terms

FieldTypeRequiredDetails
programs.terms.triggerunionYes
programs.terms.rewardTypeunionYes
programs.terms.currencyunionYes
programs.terms.compensationunionYesWhat the partner earns. This partner's custom terms replace the program's when it has them.
programs.terms.partnerOfferunionYesThe partner's earned discount with currency. Null for money rewards.
programs.terms.milestoneRewardsobjectNo
programs.terms.durationunionYesWhich orders of a referred customer earn a reward. Null for milestone programs.
programs.terms.fixedRefundModeunionYesHow a partial refund changes a fixed order reward. Null for percentage and milestone rewards.
programs.terms.referralWindowDaysunionYesDays a referral stays open until an order or milestone qualifies it. Null when it never expires.
programs.terms.textobjectYes

programs.terms.trigger

Variant 1

FieldTypeRequiredDetails
programs.terms.trigger.type"order"Yes

Variant 2

FieldTypeRequiredDetails
programs.terms.trigger.type"milestone"Yes
programs.terms.trigger.milestonestringYes

programs.terms.rewardType

Variant 1

Type: string.

Variant 2

Type: string.

Variant 3

Type: string.

programs.terms.currency

Variant 1

Type: string.

Variant 2

Type: string.

Variant 3

Type: string.

Variant 4

Type: string.

programs.terms.compensation

Variant 1

Type: null.

Variant 2

FieldTypeRequiredDetails
programs.terms.compensation.type"percentage"Yes
programs.terms.compensation.rateBpsnumberYesBase rate, before any performance tier bonus.
programs.terms.compensation.phasesarrayYesLater rates by months after the customer's first rewarded order. Empty when the rate never changes.

programs.terms.compensation.phases[]

FieldTypeRequiredDetails
programs.terms.compensation.phases.afterMonthsnumberYes
programs.terms.compensation.phases.rateBpsnumberYes

Variant 3

FieldTypeRequiredDetails
programs.terms.compensation.type"fixed"Yes
programs.terms.compensation.amountCentsnumberYes

programs.terms.partnerOffer

Variant 1

Type: null.

Variant 2

FieldTypeRequiredDetails
programs.terms.partnerOffer.type"percent"Yes
programs.terms.partnerOffer.rateBpsnumberYes
programs.terms.partnerOffer.ordersnumberYesHow many of the friend's orders get the incentive.
programs.terms.partnerOffer.expiresAfterDaysunionYesDays after the referral was captured, claimed or entered. null means it never expires.
programs.terms.partnerOffer.returnOnFullRefundbooleanYestrue: a full refund gives the use back, so the customer can get the offer again.
programs.terms.partnerOffer.maxDiscountCentsnumberNoLargest discount for one order.
programs.terms.partnerOffer.minOrderCentsnumberNoThe friend's order total before the discount must reach this amount. Checked by the merchant's checkout.
programs.terms.partnerOffer.orderCategoriesobjectNoOrder categories that get the discount. Checked apart from the program's own orderCategories, which decide rewards. Absent means every order qualifies.
programs.terms.partnerOffer.currencyunionYes

programs.terms.partnerOffer.expiresAfterDays

Variant 1

Type: null.

Variant 2

Type: number.

programs.terms.partnerOffer.orderCategories

FieldTypeRequiredDetails
programs.terms.partnerOffer.orderCategories.includearrayNo
programs.terms.partnerOffer.orderCategories.excludearrayNo

programs.terms.partnerOffer.currency

Variant 1

Type: string.

Variant 2

Type: string.

Variant 3

Type: string.

Variant 4

Type: string.

Variant 3

FieldTypeRequiredDetails
programs.terms.partnerOffer.type"fixed"Yes
programs.terms.partnerOffer.ordersnumberYesHow many of the friend's orders get the incentive.
programs.terms.partnerOffer.expiresAfterDaysunionYesDays after the referral was captured, claimed or entered. null means it never expires.
programs.terms.partnerOffer.returnOnFullRefundbooleanYestrue: a full refund gives the use back, so the customer can get the offer again.
programs.terms.partnerOffer.amountCentsnumberYes
programs.terms.partnerOffer.minOrderCentsnumberNoThe friend's order total before the discount must reach this amount. Checked by the merchant's checkout.
programs.terms.partnerOffer.orderCategoriesobjectNoOrder categories that get the discount. Checked apart from the program's own orderCategories, which decide rewards. Absent means every order qualifies.
programs.terms.partnerOffer.currencyunionYes

programs.terms.partnerOffer.expiresAfterDays

Variant 1

Type: null.

Variant 2

Type: number.

programs.terms.partnerOffer.orderCategories

FieldTypeRequiredDetails
programs.terms.partnerOffer.orderCategories.includearrayNo
programs.terms.partnerOffer.orderCategories.excludearrayNo

programs.terms.partnerOffer.currency

Variant 1

Type: string.

Variant 2

Type: string.

Variant 3

Type: string.

Variant 4

Type: string.

programs.terms.milestoneRewards

FieldTypeRequiredDetails
programs.terms.milestoneRewards.eachReportobjectNo
programs.terms.milestoneRewards.atCountobjectNo

programs.terms.milestoneRewards.eachReport

FieldTypeRequiredDetails
programs.terms.milestoneRewards.eachReport.compensationunionYes
programs.terms.milestoneRewards.eachReport.limitnumberNoAbsent means every counted report. Reversed reports do not count toward the limit.

programs.terms.milestoneRewards.eachReport.compensation

Variant 1

FieldTypeRequiredDetails
programs.terms.milestoneRewards.eachReport.compensation.type"fixed"Yes
programs.terms.milestoneRewards.eachReport.compensation.amountCentsnumberYes

Variant 2

FieldTypeRequiredDetails
programs.terms.milestoneRewards.eachReport.compensation.type"percentage"Yes
programs.terms.milestoneRewards.eachReport.compensation.rateBpsnumberYes

programs.terms.milestoneRewards.atCount

FieldTypeRequiredDetails
programs.terms.milestoneRewards.atCount.amountCentsnumberYes
programs.terms.milestoneRewards.atCount.countnumberYes

programs.terms.duration

Variant 1

Type: null.

Variant 2

FieldTypeRequiredDetails
programs.terms.duration.type"only_order"Yes

Variant 3

FieldTypeRequiredDetails
programs.terms.duration.type"first_order"Yes

Variant 4

FieldTypeRequiredDetails
programs.terms.duration.type"first_n_orders"Yes
programs.terms.duration.countnumberYes

Variant 5

FieldTypeRequiredDetails
programs.terms.duration.type"days"Yes
programs.terms.duration.daysnumberYes

Variant 6

FieldTypeRequiredDetails
programs.terms.duration.type"months"Yes
programs.terms.duration.monthsnumberYes

Variant 7

FieldTypeRequiredDetails
programs.terms.duration.type"lifetime"Yes

programs.terms.fixedRefundMode

Variant 1

Type: null.

Variant 2

Type: string.

Variant 3

Type: string.

programs.terms.referralWindowDays

Variant 1

Type: null.

Variant 2

Type: number.

programs.terms.text

FieldTypeRequiredDetails
programs.terms.text.rewardobjectYesWhat the partner earns, such as "$10 credit when your friend completes their first order after your referral".
programs.terms.text.incentiveunionYesWhat the referred friend gets, such as "20% off your first order". Null without a friend incentive.
programs.terms.text.headlineobjectYesBoth sides in a few words, such as "Give 20%, get $10", or "Get $10" without a friend incentive.

programs.terms.text.reward

FieldTypeRequiredDetails
programs.terms.text.reward.enstringYes
programs.terms.text.reward.fr-CAstringYes
programs.terms.text.reward.hystringYes
programs.terms.text.reward.rustringYes

programs.terms.text.incentive

Variant 1

Type: null.

Variant 2

FieldTypeRequiredDetails
programs.terms.text.incentive.enstringYes
programs.terms.text.incentive.fr-CAstringYes
programs.terms.text.incentive.hystringYes
programs.terms.text.incentive.rustringYes

programs.terms.text.headline

FieldTypeRequiredDetails
programs.terms.text.headline.enstringYes
programs.terms.text.headline.fr-CAstringYes
programs.terms.text.headline.hystringYes
programs.terms.text.headline.rustringYes

programs.display

FieldTypeRequiredDetails
programs.display.publicNameobjectYes
programs.display.headlineobjectYes
programs.display.milestoneLabelunionYesNull for order programs. Forms by plural category, picked with Intl.PluralRules. few and many matter in Russian. A merchant's label sets one and other, and few and many reuse other.

programs.display.publicName

FieldTypeRequiredDetails
programs.display.publicName.enstringYes
programs.display.publicName.fr-CAstringYes
programs.display.publicName.hystringYes
programs.display.publicName.rustringYes

programs.display.headline

FieldTypeRequiredDetails
programs.display.headline.enstringYes
programs.display.headline.fr-CAstringYes
programs.display.headline.hystringYes
programs.display.headline.rustringYes

programs.display.milestoneLabel

Variant 1

Type: null.

Variant 2

FieldTypeRequiredDetails
programs.display.milestoneLabel.oneobjectYes
programs.display.milestoneLabel.fewobjectYes
programs.display.milestoneLabel.manyobjectYes
programs.display.milestoneLabel.otherobjectYes

programs.display.milestoneLabel.one

FieldTypeRequiredDetails
programs.display.milestoneLabel.one.enstringYes
programs.display.milestoneLabel.one.fr-CAstringYes
programs.display.milestoneLabel.one.hystringYes
programs.display.milestoneLabel.one.rustringYes

programs.display.milestoneLabel.few

FieldTypeRequiredDetails
programs.display.milestoneLabel.few.enstringYes
programs.display.milestoneLabel.few.fr-CAstringYes
programs.display.milestoneLabel.few.hystringYes
programs.display.milestoneLabel.few.rustringYes

programs.display.milestoneLabel.many

FieldTypeRequiredDetails
programs.display.milestoneLabel.many.enstringYes
programs.display.milestoneLabel.many.fr-CAstringYes
programs.display.milestoneLabel.many.hystringYes
programs.display.milestoneLabel.many.rustringYes

programs.display.milestoneLabel.other

FieldTypeRequiredDetails
programs.display.milestoneLabel.other.enstringYes
programs.display.milestoneLabel.other.fr-CAstringYes
programs.display.milestoneLabel.other.hystringYes
programs.display.milestoneLabel.other.rustringYes

Variant 1

Type: null.

Variant 2

Type: string.

programs.linkUnavailableReason

Variant 1

Type: null.

Variant 2

Type: string.

Variant 3

Type: string.

Variant 4

Type: string.

Variant 5

Type: string.

Variant 6

Type: string.

programs.clicks

FieldTypeRequiredDetails
programs.clicks.totalnumberYesAll recorded activity, including repeat visits and unclaimed or voided receipts.
programs.clicks.last30DaysnumberYesActivity in the rolling 30 days ending at the summary's read time.

programs.referrals

FieldTypeRequiredDetails
programs.referrals.referrednumberYes
programs.referrals.qualifiednumberYes

programs.payouts

FieldTypeRequiredDetails
programs.payouts.paidOutCentsnumberYes

programs.balances

FieldTypeRequiredDetails
programs.balances.walletobjectYesWallet spending, reservations and debt cannot be attributed to a program.
programs.balances.merchantobjectYes

programs.balances.wallet

FieldTypeRequiredDetails
programs.balances.wallet.cashobjectYes
programs.balances.wallet.creditobjectYes

programs.balances.wallet.cash

FieldTypeRequiredDetails
programs.balances.wallet.cash.currencyunionYes
programs.balances.wallet.cash.rewardTypeunionYes
programs.balances.wallet.cash.pendingApprovalCentsnumberYesPending rewards after reversals.
programs.balances.wallet.cash.approvedCentsnumberYesEvery approved reward after reversals, including amounts already reserved, paid or redeemed.

programs.balances.wallet.cash.currency

Variant 1

Type: string.

Variant 2

Type: string.

Variant 3

Type: string.

Variant 4

Type: string.

programs.balances.wallet.cash.rewardType

Variant 1

Type: string.

Variant 2

Type: string.

programs.balances.wallet.credit

FieldTypeRequiredDetails
programs.balances.wallet.credit.currencyunionYes
programs.balances.wallet.credit.rewardTypeunionYes
programs.balances.wallet.credit.pendingApprovalCentsnumberYesPending rewards after reversals.
programs.balances.wallet.credit.approvedCentsnumberYesEvery approved reward after reversals, including amounts already reserved, paid or redeemed.

programs.balances.wallet.credit.currency

Variant 1

Type: string.

Variant 2

Type: string.

Variant 3

Type: string.

Variant 4

Type: string.

programs.balances.wallet.credit.rewardType

Variant 1

Type: string.

Variant 2

Type: string.

programs.balances.merchant

FieldTypeRequiredDetails
programs.balances.merchant.cashobjectYes
programs.balances.merchant.creditobjectYes

programs.balances.merchant.cash

FieldTypeRequiredDetails
programs.balances.merchant.cash.versionnumberYesPartner-wide accounting history count shared by cash, credit and program merchant balances.
programs.balances.merchant.cash.rewardTypeunionYes
programs.balances.merchant.cash.currencyunionYes
programs.balances.merchant.cash.pendingApprovalCentsnumberYesPending rewards the partner is still owed.
programs.balances.merchant.cash.approvedUndeliveredCentsnumberYesApproved and owed, not delivered yet and not in an open merchant payout.
programs.balances.merchant.cash.inOpenPayoutsCentsnumberYesApproved and owed, allocated to a merchant payout that is queued, processing or needs action.
programs.balances.merchant.cash.deliveredGrossCentsnumberYesDelivered gross amounts less returned transfers, before reward refunds or debt settlements.
programs.balances.merchant.cash.debtCentsnumberYesDelivered amounts that later refunds reversed and the partner has not repaid.

programs.balances.merchant.cash.rewardType

Variant 1

Type: string.

Variant 2

Type: string.

programs.balances.merchant.cash.currency

Variant 1

Type: string.

Variant 2

Type: string.

Variant 3

Type: string.

Variant 4

Type: string.

programs.balances.merchant.credit

FieldTypeRequiredDetails
programs.balances.merchant.credit.versionnumberYesPartner-wide accounting history count shared by cash, credit and program merchant balances.
programs.balances.merchant.credit.rewardTypeunionYes
programs.balances.merchant.credit.currencyunionYes
programs.balances.merchant.credit.pendingApprovalCentsnumberYesPending rewards the partner is still owed.
programs.balances.merchant.credit.approvedUndeliveredCentsnumberYesApproved and owed, not delivered yet and not in an open merchant payout.
programs.balances.merchant.credit.inOpenPayoutsCentsnumberYesApproved and owed, allocated to a merchant payout that is queued, processing or needs action.
programs.balances.merchant.credit.deliveredGrossCentsnumberYesDelivered gross amounts less returned transfers, before reward refunds or debt settlements.
programs.balances.merchant.credit.debtCentsnumberYesDelivered amounts that later refunds reversed and the partner has not repaid.

programs.balances.merchant.credit.rewardType

Variant 1

Type: string.

Variant 2

Type: string.

programs.balances.merchant.credit.currency

Variant 1

Type: string.

Variant 2

Type: string.

Variant 3

Type: string.

Variant 4

Type: string.

balances

FieldTypeRequiredDetails
balances.walletobjectYes
balances.merchantobjectYes

balances.wallet

FieldTypeRequiredDetails
balances.wallet.cashobjectYes
balances.wallet.creditobjectYes

balances.wallet.cash

FieldTypeRequiredDetails
balances.wallet.cash.rewardTypeunionYes
balances.wallet.cash.currencyunionYes
balances.wallet.cash.pendingApprovalCentsnumberYesPending rewards after reversals.
balances.wallet.cash.approvedCentsnumberYesEvery approved reward after reversals, including amounts already reserved, paid or redeemed.
balances.wallet.cash.reservedCentsnumberYesCash held by wallet payouts that are queued, processing or need action. Always 0 for credit.
balances.wallet.cash.paidOrRedeemedCentsnumberYesCash paid by finished wallet payouts, or credit redeemed less restorations.
balances.wallet.cash.availableToSpendCentsnumberYesWhat a new wallet payout (cash) or redemption (credit) can use now: approved value minus reserved, paid, redeemed and reversed-after-payout amounts. Never below 0.
balances.wallet.cash.debtCentsnumberYesReversals after money left the wallet that later earnings must cover first.

balances.wallet.cash.rewardType

Variant 1

Type: string.

Variant 2

Type: string.

balances.wallet.cash.currency

Variant 1

Type: string.

Variant 2

Type: string.

Variant 3

Type: string.

Variant 4

Type: string.

balances.wallet.credit

FieldTypeRequiredDetails
balances.wallet.credit.rewardTypeunionYes
balances.wallet.credit.currencyunionYes
balances.wallet.credit.pendingApprovalCentsnumberYesPending rewards after reversals.
balances.wallet.credit.approvedCentsnumberYesEvery approved reward after reversals, including amounts already reserved, paid or redeemed.
balances.wallet.credit.reservedCentsnumberYesCash held by wallet payouts that are queued, processing or need action. Always 0 for credit.
balances.wallet.credit.paidOrRedeemedCentsnumberYesCash paid by finished wallet payouts, or credit redeemed less restorations.
balances.wallet.credit.availableToSpendCentsnumberYesWhat a new wallet payout (cash) or redemption (credit) can use now: approved value minus reserved, paid, redeemed and reversed-after-payout amounts. Never below 0.
balances.wallet.credit.debtCentsnumberYesReversals after money left the wallet that later earnings must cover first.

balances.wallet.credit.rewardType

Variant 1

Type: string.

Variant 2

Type: string.

balances.wallet.credit.currency

Variant 1

Type: string.

Variant 2

Type: string.

Variant 3

Type: string.

Variant 4

Type: string.

balances.merchant

FieldTypeRequiredDetails
balances.merchant.cashobjectYes
balances.merchant.creditobjectYes

balances.merchant.cash

FieldTypeRequiredDetails
balances.merchant.cash.versionnumberYesPartner-wide accounting history count shared by cash, credit and program merchant balances.
balances.merchant.cash.rewardTypeunionYes
balances.merchant.cash.currencyunionYes
balances.merchant.cash.pendingApprovalCentsnumberYesPending rewards the partner is still owed.
balances.merchant.cash.approvedUndeliveredCentsnumberYesApproved and owed, not delivered yet and not in an open merchant payout.
balances.merchant.cash.inOpenPayoutsCentsnumberYesApproved and owed, allocated to a merchant payout that is queued, processing or needs action.
balances.merchant.cash.deliveredGrossCentsnumberYesDelivered gross amounts less returned transfers, before reward refunds or debt settlements.
balances.merchant.cash.debtCentsnumberYesDelivered amounts that later refunds reversed and the partner has not repaid.

balances.merchant.cash.rewardType

Variant 1

Type: string.

Variant 2

Type: string.

balances.merchant.cash.currency

Variant 1

Type: string.

Variant 2

Type: string.

Variant 3

Type: string.

Variant 4

Type: string.

balances.merchant.credit

FieldTypeRequiredDetails
balances.merchant.credit.versionnumberYesPartner-wide accounting history count shared by cash, credit and program merchant balances.
balances.merchant.credit.rewardTypeunionYes
balances.merchant.credit.currencyunionYes
balances.merchant.credit.pendingApprovalCentsnumberYesPending rewards the partner is still owed.
balances.merchant.credit.approvedUndeliveredCentsnumberYesApproved and owed, not delivered yet and not in an open merchant payout.
balances.merchant.credit.inOpenPayoutsCentsnumberYesApproved and owed, allocated to a merchant payout that is queued, processing or needs action.
balances.merchant.credit.deliveredGrossCentsnumberYesDelivered gross amounts less returned transfers, before reward refunds or debt settlements.
balances.merchant.credit.debtCentsnumberYesDelivered amounts that later refunds reversed and the partner has not repaid.

balances.merchant.credit.rewardType

Variant 1

Type: string.

Variant 2

Type: string.

balances.merchant.credit.currency

Variant 1

Type: string.

Variant 2

Type: string.

Variant 3

Type: string.

Variant 4

Type: string.

awaitingPayoutAccountSince

Variant 1

Type: null.

Variant 2

Type: string.

Response schema

json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "externalId": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "active": {
      "type": "boolean"
    },
    "referralCode": {
      "type": "string"
    },
    "clicks": {
      "type": "object",
      "properties": {
        "total": {
          "type": "number",
          "description": "All recorded activity, including repeat visits and unclaimed or voided receipts."
        },
        "last30Days": {
          "type": "number",
          "description": "Activity in the rolling 30 days ending at the summary's read time."
        }
      },
      "required": [
        "total",
        "last30Days"
      ],
      "description": "Link and QR activity across all programs, including former memberships."
    },
    "programs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "active": {
            "type": "boolean"
          },
          "member": {
            "type": "boolean",
            "description": "Whether the partner currently belongs to this program. Former memberships keep their totals."
          },
          "tracking": {
            "type": "object",
            "properties": {
              "links": {
                "type": "boolean"
              },
              "qrCodes": {
                "type": "boolean"
              },
              "attributionCodes": {
                "type": "boolean"
              },
              "providerPromoCodes": {
                "type": "boolean"
              }
            },
            "required": [
              "links",
              "qrCodes",
              "attributionCodes",
              "providerPromoCodes"
            ]
          },
          "attributionCode": {
            "anyOf": [
              {
                "type": "null"
              },
              {
                "type": "string"
              }
            ]
          },
          "alias": {
            "anyOf": [
              {
                "type": "null"
              },
              {
                "type": "string"
              }
            ],
            "description": "The partner's short code, such as KARL7Q, when attributionCode is set. Customers can type either."
          },
          "promoCodes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "companyId": {
                  "type": "string"
                },
                "partnerId": {
                  "type": "string"
                },
                "programId": {
                  "type": "string"
                },
                "integrationId": {
                  "type": "string"
                },
                "provider": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "stripe"
                    },
                    {
                      "type": "string",
                      "const": "shopify"
                    }
                  ]
                },
                "code": {
                  "type": "string"
                },
                "providerCodeId": {
                  "anyOf": [
                    {
                      "type": "null"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "Null until Grizzlee has saved the provider discount ID."
                },
                "status": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "pending"
                    },
                    {
                      "type": "string",
                      "const": "active"
                    },
                    {
                      "type": "string",
                      "const": "inactive"
                    }
                  ]
                },
                "replacesId": {
                  "type": "string"
                },
                "couponId": {
                  "type": "string"
                },
                "incentive": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "percent"
                        },
                        "rateBps": {
                          "type": "number"
                        },
                        "orders": {
                          "type": "number",
                          "description": "How many of the friend's orders get the incentive."
                        },
                        "newCustomersOnly": {
                          "type": "boolean",
                          "description": "true: use the merchant's newCustomer answer, or recorded purchases when omitted. false:\nreturning customers qualify too. A supplied answer uses the order limit after the referral."
                        },
                        "expiresAfterDays": {
                          "anyOf": [
                            {
                              "type": "null"
                            },
                            {
                              "type": "number"
                            }
                          ],
                          "description": "Days after the referral was captured, claimed or entered. null means it never expires."
                        },
                        "returnOnFullRefund": {
                          "type": "boolean",
                          "description": "true: a full refund gives the use back, so the customer can get the offer again."
                        },
                        "maxDiscountCents": {
                          "type": "number",
                          "description": "Largest discount for one order."
                        },
                        "minOrderCents": {
                          "type": "number",
                          "description": "The friend's order total before the discount must reach this amount. Checked by the merchant's checkout."
                        },
                        "orderCategories": {
                          "type": "object",
                          "properties": {
                            "include": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "exclude": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "description": "Order categories that get the discount. Checked apart from the program's own orderCategories,\nwhich decide rewards. Absent means every order qualifies."
                        },
                        "currency": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "CAD"
                            },
                            {
                              "type": "string",
                              "const": "USD"
                            },
                            {
                              "type": "string",
                              "const": "EUR"
                            },
                            {
                              "type": "string",
                              "const": "GBP"
                            }
                          ]
                        }
                      },
                      "required": [
                        "type",
                        "rateBps",
                        "orders",
                        "newCustomersOnly",
                        "expiresAfterDays",
                        "returnOnFullRefund",
                        "currency"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "fixed"
                        },
                        "orders": {
                          "type": "number",
                          "description": "How many of the friend's orders get the incentive."
                        },
                        "newCustomersOnly": {
                          "type": "boolean",
                          "description": "true: use the merchant's newCustomer answer, or recorded purchases when omitted. false:\nreturning customers qualify too. A supplied answer uses the order limit after the referral."
                        },
                        "expiresAfterDays": {
                          "anyOf": [
                            {
                              "type": "null"
                            },
                            {
                              "type": "number"
                            }
                          ],
                          "description": "Days after the referral was captured, claimed or entered. null means it never expires."
                        },
                        "returnOnFullRefund": {
                          "type": "boolean",
                          "description": "true: a full refund gives the use back, so the customer can get the offer again."
                        },
                        "amountCents": {
                          "type": "number"
                        },
                        "minOrderCents": {
                          "type": "number",
                          "description": "The friend's order total before the discount must reach this amount. Checked by the merchant's checkout."
                        },
                        "orderCategories": {
                          "type": "object",
                          "properties": {
                            "include": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "exclude": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "description": "Order categories that get the discount. Checked apart from the program's own orderCategories,\nwhich decide rewards. Absent means every order qualifies."
                        },
                        "currency": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "CAD"
                            },
                            {
                              "type": "string",
                              "const": "USD"
                            },
                            {
                              "type": "string",
                              "const": "EUR"
                            },
                            {
                              "type": "string",
                              "const": "GBP"
                            }
                          ]
                        }
                      },
                      "required": [
                        "type",
                        "orders",
                        "newCustomersOnly",
                        "expiresAfterDays",
                        "returnOnFullRefund",
                        "amountCents",
                        "currency"
                      ]
                    }
                  ]
                },
                "programVersion": {
                  "type": "number"
                },
                "active": {
                  "type": "boolean"
                },
                "createdAt": {
                  "type": "string"
                },
                "deactivatedAt": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "companyId",
                "partnerId",
                "programId",
                "integrationId",
                "provider",
                "code",
                "providerCodeId",
                "status",
                "incentive",
                "programVersion",
                "active",
                "createdAt"
              ]
            }
          },
          "qrLink": {
            "anyOf": [
              {
                "type": "null"
              },
              {
                "type": "string"
              }
            ]
          },
          "currency": {
            "anyOf": [
              {
                "type": "string",
                "const": "CAD"
              },
              {
                "type": "string",
                "const": "USD"
              },
              {
                "type": "string",
                "const": "EUR"
              },
              {
                "type": "string",
                "const": "GBP"
              }
            ]
          },
          "rewardType": {
            "anyOf": [
              {
                "type": "string",
                "const": "offer"
              },
              {
                "type": "string",
                "const": "cash"
              },
              {
                "type": "string",
                "const": "credit"
              }
            ]
          },
          "trigger": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "order"
                  }
                },
                "required": [
                  "type"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "milestone"
                  },
                  "milestone": {
                    "type": "string"
                  }
                },
                "required": [
                  "type",
                  "milestone"
                ]
              }
            ],
            "description": "What earns a reward in this program."
          },
          "deliveryMode": {
            "anyOf": [
              {
                "type": "string",
                "const": "grizzlee_wallet"
              },
              {
                "type": "string",
                "const": "merchant"
              }
            ],
            "description": "Who delivers this program's rewards: the Grizzlee wallet or the merchant."
          },
          "compensation": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "percentage"
                  },
                  "rateBps": {
                    "type": "number"
                  },
                  "phases": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "rateBps": {
                          "type": "number"
                        },
                        "afterMonths": {
                          "type": "number"
                        }
                      },
                      "required": [
                        "rateBps",
                        "afterMonths"
                      ]
                    }
                  }
                },
                "required": [
                  "type",
                  "rateBps"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "fixed"
                  },
                  "amountCents": {
                    "type": "number"
                  }
                },
                "required": [
                  "type",
                  "amountCents"
                ]
              }
            ],
            "description": "Order compensation, with this partner's custom terms when present. Absent for milestones."
          },
          "milestoneRewards": {
            "type": "object",
            "properties": {
              "eachReport": {
                "type": "object",
                "properties": {
                  "compensation": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "fixed"
                          },
                          "amountCents": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "type",
                          "amountCents"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "percentage"
                          },
                          "rateBps": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "type",
                          "rateBps"
                        ]
                      }
                    ]
                  },
                  "limit": {
                    "type": "number",
                    "description": "Absent means every counted report. Reversed reports do not count toward the limit."
                  }
                },
                "required": [
                  "compensation"
                ]
              },
              "atCount": {
                "type": "object",
                "properties": {
                  "amountCents": {
                    "type": "number"
                  },
                  "count": {
                    "type": "number"
                  }
                },
                "required": [
                  "amountCents",
                  "count"
                ]
              }
            }
          },
          "fixedRefundMode": {
            "anyOf": [
              {
                "type": "string",
                "const": "prorate"
              },
              {
                "type": "string",
                "const": "full_refund_only"
              }
            ],
            "description": "How this program refunds fixed rewards. Percentage rewards keep their commission base."
          },
          "incentive": {
            "anyOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "percent"
                  },
                  "rateBps": {
                    "type": "number"
                  },
                  "orders": {
                    "type": "number",
                    "description": "How many of the friend's orders get the incentive."
                  },
                  "newCustomersOnly": {
                    "type": "boolean",
                    "description": "true: use the merchant's newCustomer answer, or recorded purchases when omitted. false:\nreturning customers qualify too. A supplied answer uses the order limit after the referral."
                  },
                  "expiresAfterDays": {
                    "anyOf": [
                      {
                        "type": "null"
                      },
                      {
                        "type": "number"
                      }
                    ],
                    "description": "Days after the referral was captured, claimed or entered. null means it never expires."
                  },
                  "returnOnFullRefund": {
                    "type": "boolean",
                    "description": "true: a full refund gives the use back, so the customer can get the offer again."
                  },
                  "maxDiscountCents": {
                    "type": "number",
                    "description": "Largest discount for one order."
                  },
                  "minOrderCents": {
                    "type": "number",
                    "description": "The friend's order total before the discount must reach this amount. Checked by the merchant's checkout."
                  },
                  "orderCategories": {
                    "type": "object",
                    "properties": {
                      "include": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "exclude": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "description": "Order categories that get the discount. Checked apart from the program's own orderCategories,\nwhich decide rewards. Absent means every order qualifies."
                  },
                  "currency": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "CAD"
                      },
                      {
                        "type": "string",
                        "const": "USD"
                      },
                      {
                        "type": "string",
                        "const": "EUR"
                      },
                      {
                        "type": "string",
                        "const": "GBP"
                      }
                    ]
                  }
                },
                "required": [
                  "type",
                  "rateBps",
                  "orders",
                  "newCustomersOnly",
                  "expiresAfterDays",
                  "returnOnFullRefund",
                  "currency"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "fixed"
                  },
                  "orders": {
                    "type": "number",
                    "description": "How many of the friend's orders get the incentive."
                  },
                  "newCustomersOnly": {
                    "type": "boolean",
                    "description": "true: use the merchant's newCustomer answer, or recorded purchases when omitted. false:\nreturning customers qualify too. A supplied answer uses the order limit after the referral."
                  },
                  "expiresAfterDays": {
                    "anyOf": [
                      {
                        "type": "null"
                      },
                      {
                        "type": "number"
                      }
                    ],
                    "description": "Days after the referral was captured, claimed or entered. null means it never expires."
                  },
                  "returnOnFullRefund": {
                    "type": "boolean",
                    "description": "true: a full refund gives the use back, so the customer can get the offer again."
                  },
                  "amountCents": {
                    "type": "number"
                  },
                  "minOrderCents": {
                    "type": "number",
                    "description": "The friend's order total before the discount must reach this amount. Checked by the merchant's checkout."
                  },
                  "orderCategories": {
                    "type": "object",
                    "properties": {
                      "include": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "exclude": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "description": "Order categories that get the discount. Checked apart from the program's own orderCategories,\nwhich decide rewards. Absent means every order qualifies."
                  },
                  "currency": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "CAD"
                      },
                      {
                        "type": "string",
                        "const": "USD"
                      },
                      {
                        "type": "string",
                        "const": "EUR"
                      },
                      {
                        "type": "string",
                        "const": "GBP"
                      }
                    ]
                  }
                },
                "required": [
                  "type",
                  "orders",
                  "newCustomersOnly",
                  "expiresAfterDays",
                  "returnOnFullRefund",
                  "amountCents",
                  "currency"
                ]
              }
            ],
            "description": "What a referred customer gets in this program. Null without an offer or a current membership."
          },
          "terms": {
            "type": "object",
            "properties": {
              "trigger": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "order"
                      }
                    },
                    "required": [
                      "type"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "milestone"
                      },
                      "milestone": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "type",
                      "milestone"
                    ]
                  }
                ]
              },
              "rewardType": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "offer"
                  },
                  {
                    "type": "string",
                    "const": "cash"
                  },
                  {
                    "type": "string",
                    "const": "credit"
                  }
                ]
              },
              "currency": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "CAD"
                  },
                  {
                    "type": "string",
                    "const": "USD"
                  },
                  {
                    "type": "string",
                    "const": "EUR"
                  },
                  {
                    "type": "string",
                    "const": "GBP"
                  }
                ]
              },
              "compensation": {
                "anyOf": [
                  {
                    "type": "null"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "percentage"
                      },
                      "rateBps": {
                        "type": "number",
                        "description": "Base rate, before any performance tier bonus."
                      },
                      "phases": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "afterMonths": {
                              "type": "number"
                            },
                            "rateBps": {
                              "type": "number"
                            }
                          },
                          "required": [
                            "afterMonths",
                            "rateBps"
                          ]
                        },
                        "description": "Later rates by months after the customer's first rewarded order. Empty when the rate never changes."
                      }
                    },
                    "required": [
                      "type",
                      "rateBps",
                      "phases"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "fixed"
                      },
                      "amountCents": {
                        "type": "number"
                      }
                    },
                    "required": [
                      "type",
                      "amountCents"
                    ]
                  }
                ],
                "description": "What the partner earns. This partner's custom terms replace the program's when it has them."
              },
              "partnerOffer": {
                "anyOf": [
                  {
                    "type": "null"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "percent"
                      },
                      "rateBps": {
                        "type": "number"
                      },
                      "orders": {
                        "type": "number",
                        "description": "How many of the friend's orders get the incentive."
                      },
                      "expiresAfterDays": {
                        "anyOf": [
                          {
                            "type": "null"
                          },
                          {
                            "type": "number"
                          }
                        ],
                        "description": "Days after the referral was captured, claimed or entered. null means it never expires."
                      },
                      "returnOnFullRefund": {
                        "type": "boolean",
                        "description": "true: a full refund gives the use back, so the customer can get the offer again."
                      },
                      "maxDiscountCents": {
                        "type": "number",
                        "description": "Largest discount for one order."
                      },
                      "minOrderCents": {
                        "type": "number",
                        "description": "The friend's order total before the discount must reach this amount. Checked by the merchant's checkout."
                      },
                      "orderCategories": {
                        "type": "object",
                        "properties": {
                          "include": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "exclude": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        },
                        "description": "Order categories that get the discount. Checked apart from the program's own orderCategories,\nwhich decide rewards. Absent means every order qualifies."
                      },
                      "currency": {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "CAD"
                          },
                          {
                            "type": "string",
                            "const": "USD"
                          },
                          {
                            "type": "string",
                            "const": "EUR"
                          },
                          {
                            "type": "string",
                            "const": "GBP"
                          }
                        ]
                      }
                    },
                    "required": [
                      "type",
                      "rateBps",
                      "orders",
                      "expiresAfterDays",
                      "returnOnFullRefund",
                      "currency"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "fixed"
                      },
                      "orders": {
                        "type": "number",
                        "description": "How many of the friend's orders get the incentive."
                      },
                      "expiresAfterDays": {
                        "anyOf": [
                          {
                            "type": "null"
                          },
                          {
                            "type": "number"
                          }
                        ],
                        "description": "Days after the referral was captured, claimed or entered. null means it never expires."
                      },
                      "returnOnFullRefund": {
                        "type": "boolean",
                        "description": "true: a full refund gives the use back, so the customer can get the offer again."
                      },
                      "amountCents": {
                        "type": "number"
                      },
                      "minOrderCents": {
                        "type": "number",
                        "description": "The friend's order total before the discount must reach this amount. Checked by the merchant's checkout."
                      },
                      "orderCategories": {
                        "type": "object",
                        "properties": {
                          "include": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "exclude": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        },
                        "description": "Order categories that get the discount. Checked apart from the program's own orderCategories,\nwhich decide rewards. Absent means every order qualifies."
                      },
                      "currency": {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "CAD"
                          },
                          {
                            "type": "string",
                            "const": "USD"
                          },
                          {
                            "type": "string",
                            "const": "EUR"
                          },
                          {
                            "type": "string",
                            "const": "GBP"
                          }
                        ]
                      }
                    },
                    "required": [
                      "type",
                      "orders",
                      "expiresAfterDays",
                      "returnOnFullRefund",
                      "amountCents",
                      "currency"
                    ]
                  }
                ],
                "description": "The partner's earned discount with currency. Null for money rewards."
              },
              "milestoneRewards": {
                "type": "object",
                "properties": {
                  "eachReport": {
                    "type": "object",
                    "properties": {
                      "compensation": {
                        "anyOf": [
                          {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string",
                                "const": "fixed"
                              },
                              "amountCents": {
                                "type": "number"
                              }
                            },
                            "required": [
                              "type",
                              "amountCents"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string",
                                "const": "percentage"
                              },
                              "rateBps": {
                                "type": "number"
                              }
                            },
                            "required": [
                              "type",
                              "rateBps"
                            ]
                          }
                        ]
                      },
                      "limit": {
                        "type": "number",
                        "description": "Absent means every counted report. Reversed reports do not count toward the limit."
                      }
                    },
                    "required": [
                      "compensation"
                    ]
                  },
                  "atCount": {
                    "type": "object",
                    "properties": {
                      "amountCents": {
                        "type": "number"
                      },
                      "count": {
                        "type": "number"
                      }
                    },
                    "required": [
                      "amountCents",
                      "count"
                    ]
                  }
                }
              },
              "duration": {
                "anyOf": [
                  {
                    "type": "null"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "only_order"
                      }
                    },
                    "required": [
                      "type"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "first_order"
                      }
                    },
                    "required": [
                      "type"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "first_n_orders"
                      },
                      "count": {
                        "type": "number"
                      }
                    },
                    "required": [
                      "type",
                      "count"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "days"
                      },
                      "days": {
                        "type": "number"
                      }
                    },
                    "required": [
                      "type",
                      "days"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "months"
                      },
                      "months": {
                        "type": "number"
                      }
                    },
                    "required": [
                      "type",
                      "months"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "lifetime"
                      }
                    },
                    "required": [
                      "type"
                    ]
                  }
                ],
                "description": "Which orders of a referred customer earn a reward. Null for milestone programs."
              },
              "fixedRefundMode": {
                "anyOf": [
                  {
                    "type": "null"
                  },
                  {
                    "type": "string",
                    "const": "prorate"
                  },
                  {
                    "type": "string",
                    "const": "full_refund_only"
                  }
                ],
                "description": "How a partial refund changes a fixed order reward. Null for percentage and milestone rewards."
              },
              "referralWindowDays": {
                "anyOf": [
                  {
                    "type": "null"
                  },
                  {
                    "type": "number"
                  }
                ],
                "description": "Days a referral stays open until an order or milestone qualifies it. Null when it never expires."
              },
              "text": {
                "type": "object",
                "properties": {
                  "reward": {
                    "type": "object",
                    "properties": {
                      "en": {
                        "type": "string"
                      },
                      "fr-CA": {
                        "type": "string"
                      },
                      "hy": {
                        "type": "string"
                      },
                      "ru": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "en",
                      "fr-CA",
                      "hy",
                      "ru"
                    ],
                    "description": "What the partner earns, such as \"$10 credit when your friend completes their first order after your referral\"."
                  },
                  "incentive": {
                    "anyOf": [
                      {
                        "type": "null"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "en": {
                            "type": "string"
                          },
                          "fr-CA": {
                            "type": "string"
                          },
                          "hy": {
                            "type": "string"
                          },
                          "ru": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "en",
                          "fr-CA",
                          "hy",
                          "ru"
                        ]
                      }
                    ],
                    "description": "What the referred friend gets, such as \"20% off your first order\". Null without a friend incentive."
                  },
                  "headline": {
                    "type": "object",
                    "properties": {
                      "en": {
                        "type": "string"
                      },
                      "fr-CA": {
                        "type": "string"
                      },
                      "hy": {
                        "type": "string"
                      },
                      "ru": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "en",
                      "fr-CA",
                      "hy",
                      "ru"
                    ],
                    "description": "Both sides in a few words, such as \"Give 20%, get $10\", or \"Get $10\" without a friend incentive."
                  }
                },
                "required": [
                  "reward",
                  "incentive",
                  "headline"
                ]
              }
            },
            "required": [
              "trigger",
              "rewardType",
              "currency",
              "compensation",
              "partnerOffer",
              "duration",
              "fixedRefundMode",
              "referralWindowDays",
              "text"
            ],
            "description": "Readable reward terms. Former memberships omit the friend incentive from the text."
          },
          "display": {
            "type": "object",
            "properties": {
              "publicName": {
                "type": "object",
                "properties": {
                  "en": {
                    "type": "string"
                  },
                  "fr-CA": {
                    "type": "string"
                  },
                  "hy": {
                    "type": "string"
                  },
                  "ru": {
                    "type": "string"
                  }
                },
                "required": [
                  "en",
                  "fr-CA",
                  "hy",
                  "ru"
                ]
              },
              "headline": {
                "type": "object",
                "properties": {
                  "en": {
                    "type": "string"
                  },
                  "fr-CA": {
                    "type": "string"
                  },
                  "hy": {
                    "type": "string"
                  },
                  "ru": {
                    "type": "string"
                  }
                },
                "required": [
                  "en",
                  "fr-CA",
                  "hy",
                  "ru"
                ]
              },
              "milestoneLabel": {
                "anyOf": [
                  {
                    "type": "null"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "one": {
                        "type": "object",
                        "properties": {
                          "en": {
                            "type": "string"
                          },
                          "fr-CA": {
                            "type": "string"
                          },
                          "hy": {
                            "type": "string"
                          },
                          "ru": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "en",
                          "fr-CA",
                          "hy",
                          "ru"
                        ]
                      },
                      "few": {
                        "type": "object",
                        "properties": {
                          "en": {
                            "type": "string"
                          },
                          "fr-CA": {
                            "type": "string"
                          },
                          "hy": {
                            "type": "string"
                          },
                          "ru": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "en",
                          "fr-CA",
                          "hy",
                          "ru"
                        ]
                      },
                      "many": {
                        "type": "object",
                        "properties": {
                          "en": {
                            "type": "string"
                          },
                          "fr-CA": {
                            "type": "string"
                          },
                          "hy": {
                            "type": "string"
                          },
                          "ru": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "en",
                          "fr-CA",
                          "hy",
                          "ru"
                        ]
                      },
                      "other": {
                        "type": "object",
                        "properties": {
                          "en": {
                            "type": "string"
                          },
                          "fr-CA": {
                            "type": "string"
                          },
                          "hy": {
                            "type": "string"
                          },
                          "ru": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "en",
                          "fr-CA",
                          "hy",
                          "ru"
                        ]
                      }
                    },
                    "required": [
                      "one",
                      "few",
                      "many",
                      "other"
                    ]
                  }
                ],
                "description": "Null for order programs. Forms by plural category, picked with Intl.PluralRules. few and\nmany matter in Russian. A merchant's label sets one and other, and few and many reuse other."
              }
            },
            "required": [
              "publicName",
              "headline",
              "milestoneLabel"
            ],
            "description": "Public name, headline and milestone label. The headline falls back to terms.text.headline."
          },
          "link": {
            "anyOf": [
              {
                "type": "null"
              },
              {
                "type": "string"
              }
            ],
            "description": "Referral link to the program's published destination. Null when unavailable or membership ended."
          },
          "linkUnavailableReason": {
            "anyOf": [
              {
                "type": "null"
              },
              {
                "type": "string",
                "const": "program_inactive"
              },
              {
                "type": "string",
                "const": "partner_inactive"
              },
              {
                "type": "string",
                "const": "tracking_disabled"
              },
              {
                "type": "string",
                "const": "no_published_page"
              },
              {
                "type": "string",
                "const": "invalid_destination"
              }
            ],
            "description": "Set when link is null, otherwise null."
          },
          "clicks": {
            "type": "object",
            "properties": {
              "total": {
                "type": "number",
                "description": "All recorded activity, including repeat visits and unclaimed or voided receipts."
              },
              "last30Days": {
                "type": "number",
                "description": "Activity in the rolling 30 days ending at the summary's read time."
              }
            },
            "required": [
              "total",
              "last30Days"
            ],
            "description": "Link and QR activity in this program. Coupon and in-app channels are excluded."
          },
          "earnedCents": {
            "type": "number",
            "description": "Reward value after reversals, across saved reward types and delivery modes."
          },
          "reversedCents": {
            "type": "number",
            "description": "Reward value currently reversed. Restorations reduce this total."
          },
          "referrals": {
            "type": "object",
            "properties": {
              "referred": {
                "type": "number"
              },
              "qualified": {
                "type": "number"
              }
            },
            "required": [
              "referred",
              "qualified"
            ],
            "description": "Each attribution counts once, including displaced referrals and separate order-scoped referrals."
          },
          "orderCount": {
            "type": "number",
            "description": "Sum of referral orderCount values in this program. Reversed rewards still count; milestones do not."
          },
          "payouts": {
            "type": "object",
            "properties": {
              "paidOutCents": {
                "type": "number"
              }
            },
            "required": [
              "paidOutCents"
            ],
            "description": "Paid merchant allocations less returned transfers. Wallet payouts have no program allocations."
          },
          "balances": {
            "type": "object",
            "properties": {
              "wallet": {
                "type": "object",
                "properties": {
                  "cash": {
                    "type": "object",
                    "properties": {
                      "currency": {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "CAD"
                          },
                          {
                            "type": "string",
                            "const": "USD"
                          },
                          {
                            "type": "string",
                            "const": "EUR"
                          },
                          {
                            "type": "string",
                            "const": "GBP"
                          }
                        ]
                      },
                      "rewardType": {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "cash"
                          },
                          {
                            "type": "string",
                            "const": "credit"
                          }
                        ]
                      },
                      "pendingApprovalCents": {
                        "type": "number",
                        "description": "Pending rewards after reversals."
                      },
                      "approvedCents": {
                        "type": "number",
                        "description": "Every approved reward after reversals, including amounts already reserved, paid or redeemed."
                      }
                    },
                    "required": [
                      "currency",
                      "rewardType",
                      "pendingApprovalCents",
                      "approvedCents"
                    ]
                  },
                  "credit": {
                    "type": "object",
                    "properties": {
                      "currency": {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "CAD"
                          },
                          {
                            "type": "string",
                            "const": "USD"
                          },
                          {
                            "type": "string",
                            "const": "EUR"
                          },
                          {
                            "type": "string",
                            "const": "GBP"
                          }
                        ]
                      },
                      "rewardType": {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "cash"
                          },
                          {
                            "type": "string",
                            "const": "credit"
                          }
                        ]
                      },
                      "pendingApprovalCents": {
                        "type": "number",
                        "description": "Pending rewards after reversals."
                      },
                      "approvedCents": {
                        "type": "number",
                        "description": "Every approved reward after reversals, including amounts already reserved, paid or redeemed."
                      }
                    },
                    "required": [
                      "currency",
                      "rewardType",
                      "pendingApprovalCents",
                      "approvedCents"
                    ]
                  }
                },
                "required": [
                  "cash",
                  "credit"
                ],
                "description": "Wallet spending, reservations and debt cannot be attributed to a program."
              },
              "merchant": {
                "type": "object",
                "properties": {
                  "cash": {
                    "type": "object",
                    "properties": {
                      "version": {
                        "type": "number",
                        "description": "Partner-wide accounting history count shared by cash, credit and program merchant balances."
                      },
                      "rewardType": {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "cash"
                          },
                          {
                            "type": "string",
                            "const": "credit"
                          }
                        ]
                      },
                      "currency": {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "CAD"
                          },
                          {
                            "type": "string",
                            "const": "USD"
                          },
                          {
                            "type": "string",
                            "const": "EUR"
                          },
                          {
                            "type": "string",
                            "const": "GBP"
                          }
                        ]
                      },
                      "pendingApprovalCents": {
                        "type": "number",
                        "description": "Pending rewards the partner is still owed."
                      },
                      "approvedUndeliveredCents": {
                        "type": "number",
                        "description": "Approved and owed, not delivered yet and not in an open merchant payout."
                      },
                      "inOpenPayoutsCents": {
                        "type": "number",
                        "description": "Approved and owed, allocated to a merchant payout that is queued, processing or needs action."
                      },
                      "deliveredGrossCents": {
                        "type": "number",
                        "description": "Delivered gross amounts less returned transfers, before reward refunds or debt settlements."
                      },
                      "debtCents": {
                        "type": "number",
                        "description": "Delivered amounts that later refunds reversed and the partner has not repaid."
                      }
                    },
                    "required": [
                      "version",
                      "rewardType",
                      "currency",
                      "pendingApprovalCents",
                      "approvedUndeliveredCents",
                      "inOpenPayoutsCents",
                      "deliveredGrossCents",
                      "debtCents"
                    ]
                  },
                  "credit": {
                    "type": "object",
                    "properties": {
                      "version": {
                        "type": "number",
                        "description": "Partner-wide accounting history count shared by cash, credit and program merchant balances."
                      },
                      "rewardType": {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "cash"
                          },
                          {
                            "type": "string",
                            "const": "credit"
                          }
                        ]
                      },
                      "currency": {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "CAD"
                          },
                          {
                            "type": "string",
                            "const": "USD"
                          },
                          {
                            "type": "string",
                            "const": "EUR"
                          },
                          {
                            "type": "string",
                            "const": "GBP"
                          }
                        ]
                      },
                      "pendingApprovalCents": {
                        "type": "number",
                        "description": "Pending rewards the partner is still owed."
                      },
                      "approvedUndeliveredCents": {
                        "type": "number",
                        "description": "Approved and owed, not delivered yet and not in an open merchant payout."
                      },
                      "inOpenPayoutsCents": {
                        "type": "number",
                        "description": "Approved and owed, allocated to a merchant payout that is queued, processing or needs action."
                      },
                      "deliveredGrossCents": {
                        "type": "number",
                        "description": "Delivered gross amounts less returned transfers, before reward refunds or debt settlements."
                      },
                      "debtCents": {
                        "type": "number",
                        "description": "Delivered amounts that later refunds reversed and the partner has not repaid."
                      }
                    },
                    "required": [
                      "version",
                      "rewardType",
                      "currency",
                      "pendingApprovalCents",
                      "approvedUndeliveredCents",
                      "inOpenPayoutsCents",
                      "deliveredGrossCents",
                      "debtCents"
                    ]
                  }
                },
                "required": [
                  "cash",
                  "credit"
                ]
              }
            },
            "required": [
              "wallet",
              "merchant"
            ]
          }
        },
        "required": [
          "id",
          "name",
          "active",
          "member",
          "tracking",
          "attributionCode",
          "alias",
          "promoCodes",
          "qrLink",
          "currency",
          "rewardType",
          "trigger",
          "deliveryMode",
          "fixedRefundMode",
          "incentive",
          "terms",
          "display",
          "link",
          "linkUnavailableReason",
          "clicks",
          "earnedCents",
          "reversedCents",
          "referrals",
          "orderCount",
          "payouts",
          "balances"
        ]
      },
      "description": "Current memberships in programIds order, then former programs with rewards, referrals, payout allocations or debt, sorted by ID."
    },
    "balances": {
      "type": "object",
      "properties": {
        "wallet": {
          "type": "object",
          "properties": {
            "cash": {
              "type": "object",
              "properties": {
                "rewardType": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "cash"
                    },
                    {
                      "type": "string",
                      "const": "credit"
                    }
                  ]
                },
                "currency": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "CAD"
                    },
                    {
                      "type": "string",
                      "const": "USD"
                    },
                    {
                      "type": "string",
                      "const": "EUR"
                    },
                    {
                      "type": "string",
                      "const": "GBP"
                    }
                  ]
                },
                "pendingApprovalCents": {
                  "type": "number",
                  "description": "Pending rewards after reversals."
                },
                "approvedCents": {
                  "type": "number",
                  "description": "Every approved reward after reversals, including amounts already reserved, paid or redeemed."
                },
                "reservedCents": {
                  "type": "number",
                  "description": "Cash held by wallet payouts that are queued, processing or need action. Always 0 for credit."
                },
                "paidOrRedeemedCents": {
                  "type": "number",
                  "description": "Cash paid by finished wallet payouts, or credit redeemed less restorations."
                },
                "availableToSpendCents": {
                  "type": "number",
                  "description": "What a new wallet payout (cash) or redemption (credit) can use now: approved value minus\nreserved, paid, redeemed and reversed-after-payout amounts. Never below 0."
                },
                "debtCents": {
                  "type": "number",
                  "description": "Reversals after money left the wallet that later earnings must cover first."
                }
              },
              "required": [
                "rewardType",
                "currency",
                "pendingApprovalCents",
                "approvedCents",
                "reservedCents",
                "paidOrRedeemedCents",
                "availableToSpendCents",
                "debtCents"
              ]
            },
            "credit": {
              "type": "object",
              "properties": {
                "rewardType": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "cash"
                    },
                    {
                      "type": "string",
                      "const": "credit"
                    }
                  ]
                },
                "currency": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "CAD"
                    },
                    {
                      "type": "string",
                      "const": "USD"
                    },
                    {
                      "type": "string",
                      "const": "EUR"
                    },
                    {
                      "type": "string",
                      "const": "GBP"
                    }
                  ]
                },
                "pendingApprovalCents": {
                  "type": "number",
                  "description": "Pending rewards after reversals."
                },
                "approvedCents": {
                  "type": "number",
                  "description": "Every approved reward after reversals, including amounts already reserved, paid or redeemed."
                },
                "reservedCents": {
                  "type": "number",
                  "description": "Cash held by wallet payouts that are queued, processing or need action. Always 0 for credit."
                },
                "paidOrRedeemedCents": {
                  "type": "number",
                  "description": "Cash paid by finished wallet payouts, or credit redeemed less restorations."
                },
                "availableToSpendCents": {
                  "type": "number",
                  "description": "What a new wallet payout (cash) or redemption (credit) can use now: approved value minus\nreserved, paid, redeemed and reversed-after-payout amounts. Never below 0."
                },
                "debtCents": {
                  "type": "number",
                  "description": "Reversals after money left the wallet that later earnings must cover first."
                }
              },
              "required": [
                "rewardType",
                "currency",
                "pendingApprovalCents",
                "approvedCents",
                "reservedCents",
                "paidOrRedeemedCents",
                "availableToSpendCents",
                "debtCents"
              ]
            }
          },
          "required": [
            "cash",
            "credit"
          ]
        },
        "merchant": {
          "type": "object",
          "properties": {
            "cash": {
              "type": "object",
              "properties": {
                "version": {
                  "type": "number",
                  "description": "Partner-wide accounting history count shared by cash, credit and program merchant balances."
                },
                "rewardType": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "cash"
                    },
                    {
                      "type": "string",
                      "const": "credit"
                    }
                  ]
                },
                "currency": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "CAD"
                    },
                    {
                      "type": "string",
                      "const": "USD"
                    },
                    {
                      "type": "string",
                      "const": "EUR"
                    },
                    {
                      "type": "string",
                      "const": "GBP"
                    }
                  ]
                },
                "pendingApprovalCents": {
                  "type": "number",
                  "description": "Pending rewards the partner is still owed."
                },
                "approvedUndeliveredCents": {
                  "type": "number",
                  "description": "Approved and owed, not delivered yet and not in an open merchant payout."
                },
                "inOpenPayoutsCents": {
                  "type": "number",
                  "description": "Approved and owed, allocated to a merchant payout that is queued, processing or needs action."
                },
                "deliveredGrossCents": {
                  "type": "number",
                  "description": "Delivered gross amounts less returned transfers, before reward refunds or debt settlements."
                },
                "debtCents": {
                  "type": "number",
                  "description": "Delivered amounts that later refunds reversed and the partner has not repaid."
                }
              },
              "required": [
                "version",
                "rewardType",
                "currency",
                "pendingApprovalCents",
                "approvedUndeliveredCents",
                "inOpenPayoutsCents",
                "deliveredGrossCents",
                "debtCents"
              ]
            },
            "credit": {
              "type": "object",
              "properties": {
                "version": {
                  "type": "number",
                  "description": "Partner-wide accounting history count shared by cash, credit and program merchant balances."
                },
                "rewardType": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "cash"
                    },
                    {
                      "type": "string",
                      "const": "credit"
                    }
                  ]
                },
                "currency": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "CAD"
                    },
                    {
                      "type": "string",
                      "const": "USD"
                    },
                    {
                      "type": "string",
                      "const": "EUR"
                    },
                    {
                      "type": "string",
                      "const": "GBP"
                    }
                  ]
                },
                "pendingApprovalCents": {
                  "type": "number",
                  "description": "Pending rewards the partner is still owed."
                },
                "approvedUndeliveredCents": {
                  "type": "number",
                  "description": "Approved and owed, not delivered yet and not in an open merchant payout."
                },
                "inOpenPayoutsCents": {
                  "type": "number",
                  "description": "Approved and owed, allocated to a merchant payout that is queued, processing or needs action."
                },
                "deliveredGrossCents": {
                  "type": "number",
                  "description": "Delivered gross amounts less returned transfers, before reward refunds or debt settlements."
                },
                "debtCents": {
                  "type": "number",
                  "description": "Delivered amounts that later refunds reversed and the partner has not repaid."
                }
              },
              "required": [
                "version",
                "rewardType",
                "currency",
                "pendingApprovalCents",
                "approvedUndeliveredCents",
                "inOpenPayoutsCents",
                "deliveredGrossCents",
                "debtCents"
              ]
            }
          },
          "required": [
            "cash",
            "credit"
          ]
        }
      },
      "required": [
        "wallet",
        "merchant"
      ]
    },
    "payoutAccountRequired": {
      "type": "boolean",
      "description": "True when the payout schedule waits for a Stripe account (missingStripeAccount \"wait\"), the\npartner has no stripeAccountId, and the partner earns merchant-delivered cash: it belongs to\nsuch a program or has such cash pending or approved. Scheduled runs pay this partner nothing\nuntil it gets a stripeAccountId."
    },
    "awaitingPayoutAccount": {
      "type": "boolean",
      "description": "True when payoutAccountRequired and a scheduled run already held a payout for it."
    },
    "awaitingPayoutAccountSince": {
      "anyOf": [
        {
          "type": "null"
        },
        {
          "type": "string"
        }
      ],
      "description": "Due date (YYYY-MM-DD) of the first run that held a payout. Null unless awaitingPayoutAccount."
    }
  },
  "required": [
    "id",
    "externalId",
    "name",
    "active",
    "referralCode",
    "clicks",
    "programs",
    "balances",
    "payoutAccountRequired",
    "awaitingPayoutAccount",
    "awaitingPayoutAccountSince"
  ]
}

Errors

Failures return { "error": { "code": "...", "message": "...", "details": {} } }. Details are optional. See error statuses. Reuse an unchanged event payload when retrying.