Skip to content
Developer docs
⌘ K
Dashboard ↗

HTTP endpoints

updateProgram

PUT /api/v1/programs/{id}

Requires programs:write. Keep the Bearer key on your server.

SDK

ts
grizzlee.updateProgram(id: string, input: { name: string; kind: "referral" | "affiliate" | "both"; rewardType: "offer" | "cash" | "credit"; attributionWindowDays: number | null; active: boolean; orderCategories?: { include?: string[] | undefined; exclude?: string[] | undefined; } | null | undefined; compensation?: { type: "percentage"; rateBps: number; phases?: { rateBps: number; afterMonths: number; }[] | undefined; } | { type: "fixed"; amountCents: number; } | undefined; currency?: "CAD" | "USD" | "EUR" | "GBP" | undefined; tracking?: { links?: boolean | undefined; qrCodes?: boolean | undefined; attributionCodes?: boolean | undefined; providerPromoCodes?: boolean | undefined; } | undefined; destinationUrl?: string | null | undefined; display?: { en?: { publicName?: string | undefined; headline?: string | undefined; milestoneLabel?: { one: string; other: string; } | undefined; } | undefined; "fr-CA"?: { publicName?: string | undefined; headline?: string | undefined; milestoneLabel?: { one: string; other: string; } | undefined; } | undefined; hy?: { publicName?: string | undefined; headline?: string | undefined; milestoneLabel?: { one: string; other: string; } | undefined; } | undefined; ru?: { publicName?: string | undefined; headline?: string | undefined; milestoneLabel?: { one: string; other: string; } | undefined; } | undefined; } | null | undefined; trigger?: { type: "order"; } | { type: "milestone"; milestone: string; } | undefined; milestoneRewards?: { eachReport?: { compensation: { type: "fixed"; amountCents: number; } | { type: "percentage"; rateBps: number; }; limit?: number | undefined; } | undefined; atCount?: { amountCents: number; count: number; } | undefined; } | undefined; fixedRefundMode?: "prorate" | "full_refund_only" | undefined; duration?: { type: "only_order"; } | { type: "first_order"; } | { type: "first_n_orders"; count: number; } | { type: "days"; days: number; } | { type: "months"; months: number; } | { type: "lifetime"; } | undefined; delivery?: { cash?: "grizzlee_wallet" | "merchant" | undefined; credit?: "grizzlee_wallet" | "merchant" | undefined; } | undefined; reviewRewards?: boolean | undefined; fraudChecks?: { selfReferral?: { action?: "review" | "block" | "flag" | "off" | undefined; } | undefined; duplicateAccounts?: { action?: "review" | "block" | "flag" | "off" | undefined; accounts?: number | undefined; windowDays?: number | undefined; ipAccounts?: number | null | undefined; } | undefined; rapidRepeats?: { action?: "review" | "block" | "flag" | "off" | undefined; referrals?: number | undefined; windowMinutes?: number | undefined; ipReferrals?: number | null | undefined; } | undefined; repeatCustomer?: { action?: "review" | "block" | "flag" | "off" | undefined; } | undefined; disposableEmail?: { action?: "review" | "flag" | "off" | undefined; } | undefined; } | undefined; performance?: { metric: "orders" | "new_customers"; tiers: { name: string; minValue: number; bonusBps: number; }[]; windowDays?: number | undefined; } | undefined; limits?: { customerCapCents?: number | undefined; partnerCapCents?: number | undefined; } | undefined; customTerms?: ({ target: "partner"; targetId: string; compensation?: { type: "percentage"; rateBps: number; phases?: { rateBps: number; afterMonths: number; }[] | undefined; } | { type: "fixed"; amountCents: number; } | undefined; milestoneRewards?: { eachReport?: { compensation: { type: "fixed"; amountCents: number; } | { type: "percentage"; rateBps: number; }; limit?: number | undefined; } | undefined; atCount?: { amountCents: number; count: number; } | undefined; } | undefined; customerCapCents?: number | null | undefined; partnerCapCents?: number | null | undefined; } | { target: "customer"; targetId: string; compensation?: { type: "percentage"; rateBps: number; phases?: { rateBps: number; afterMonths: number; }[] | undefined; } | { type: "fixed"; amountCents: number; } | undefined; milestoneRewards?: { eachReport?: { compensation: { type: "fixed"; amountCents: number; } | { type: "percentage"; rateBps: number; }; limit?: number | undefined; } | undefined; atCount?: { amountCents: number; count: number; } | undefined; } | undefined; customerCapCents?: number | null | undefined; })[] | undefined; friendIncentive?: { type: "percent"; rateBps: number; maxDiscountCents?: number | undefined; minOrderCents?: number | undefined; orders?: number | undefined; newCustomersOnly?: boolean | undefined; expiresAfterDays?: number | null | undefined; returnOnFullRefund?: boolean | undefined; orderCategories?: { include?: string[] | undefined; exclude?: string[] | undefined; } | undefined; } | { type: "fixed"; amountCents: number; minOrderCents?: number | undefined; orders?: number | undefined; newCustomersOnly?: boolean | undefined; expiresAfterDays?: number | null | undefined; returnOnFullRefund?: boolean | undefined; orderCategories?: { include?: string[] | undefined; exclude?: string[] | undefined; } | undefined; } | null | undefined; partnerOffer?: { type: "percent"; rateBps: number; maxDiscountCents?: number | undefined; minOrderCents?: number | undefined; orders?: number | undefined; expiresAfterDays?: number | null | undefined; returnOnFullRefund?: boolean | undefined; orderCategories?: { include?: string[] | undefined; exclude?: string[] | undefined; } | undefined; } | { type: "fixed"; amountCents: number; minOrderCents?: number | undefined; orders?: number | undefined; expiresAfterDays?: number | null | undefined; returnOnFullRefund?: boolean | undefined; orderCategories?: { include?: string[] | undefined; exclude?: string[] | undefined; } | undefined; } | undefined; }): Promise<Program>

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 PUT \
  'https://app.grizzlee.ca/api/v1/programs/{id}' \
  -H "Authorization: Bearer $GRIZZLEE_SERVER_KEY" \
  -H 'Content-Type: application/json' \
  --data '{"name":"Example referral program","kind":"referral","trigger":{"type":"order"},"rewardType":"cash","attributionWindowDays":1,"active":true,"compensation":{"type":"fixed","amountCents":1000},"duration":{"type":"first_order"}}'

Request body

FieldTypeRequiredDetails
namestringYes
kind"referral", "affiliate", "both"Yes
trackingobjectNo
currency"CAD", "USD", "EUR", "GBP"No
destinationUrlunionNo
displayunionNo
triggerunionNo
compensationunionNo
milestoneRewardsobjectNo
fixedRefundMode"prorate", "full_refund_only"No
durationunionNo
rewardType"cash", "credit", "offer"Yes
deliveryobjectNo
attributionWindowDaysunionYes
reviewRewardsbooleanNo
fraudChecksobjectNo
activebooleanYes
performanceobjectNo
limitsobjectNo
customTermsarrayNo
friendIncentiveunionNo
partnerOfferunionNo
orderCategoriesunionNo

tracking

FieldTypeRequiredDetails
tracking.linksbooleanNodefault true
tracking.qrCodesbooleanNodefault true
tracking.attributionCodesbooleanNodefault true
tracking.providerPromoCodesbooleanNodefault false

destinationUrl

Variant 1

Type: string.

Variant 2

Type: null.

display

Variant 1

FieldTypeRequiredDetails
display.enobjectNo
display.fr-CAobjectNo
display.hyobjectNo
display.ruobjectNo

display.en

FieldTypeRequiredDetails
display.en.publicNamestringNo
display.en.headlinestringNo
display.en.milestoneLabelobjectNo

display.en.milestoneLabel

FieldTypeRequiredDetails
display.en.milestoneLabel.onestringYes
display.en.milestoneLabel.otherstringYes

display.fr-CA

FieldTypeRequiredDetails
display.fr-CA.publicNamestringNo
display.fr-CA.headlinestringNo
display.fr-CA.milestoneLabelobjectNo

display.fr-CA.milestoneLabel

FieldTypeRequiredDetails
display.fr-CA.milestoneLabel.onestringYes
display.fr-CA.milestoneLabel.otherstringYes

display.hy

FieldTypeRequiredDetails
display.hy.publicNamestringNo
display.hy.headlinestringNo
display.hy.milestoneLabelobjectNo

display.hy.milestoneLabel

FieldTypeRequiredDetails
display.hy.milestoneLabel.onestringYes
display.hy.milestoneLabel.otherstringYes

display.ru

FieldTypeRequiredDetails
display.ru.publicNamestringNo
display.ru.headlinestringNo
display.ru.milestoneLabelobjectNo

display.ru.milestoneLabel

FieldTypeRequiredDetails
display.ru.milestoneLabel.onestringYes
display.ru.milestoneLabel.otherstringYes

Variant 2

Type: null.

trigger

Variant 1

FieldTypeRequiredDetails
trigger.type"order"Yes

Variant 2

FieldTypeRequiredDetails
trigger.type"milestone"Yes
trigger.milestonestringYes

compensation

Variant 1

FieldTypeRequiredDetails
compensation.type"percentage"Yes
compensation.rateBpsintegerYesminimum 1. maximum 10000
compensation.phasesarrayNo

compensation.phases[]

FieldTypeRequiredDetails
compensation.phases.afterMonthsintegerYesminimum 1. maximum 1200
compensation.phases.rateBpsintegerYesminimum 0. maximum 10000

Variant 2

FieldTypeRequiredDetails
compensation.type"fixed"Yes
compensation.amountCentsintegerYesminimum 0. maximum 1000000000000

milestoneRewards

FieldTypeRequiredDetails
milestoneRewards.eachReportobjectNo
milestoneRewards.atCountobjectNo

milestoneRewards.eachReport

FieldTypeRequiredDetails
milestoneRewards.eachReport.compensationunionYes
milestoneRewards.eachReport.limitintegerNominimum 1. maximum 10000

milestoneRewards.eachReport.compensation

Variant 1

FieldTypeRequiredDetails
milestoneRewards.eachReport.compensation.type"fixed"Yes
milestoneRewards.eachReport.compensation.amountCentsintegerYesminimum 0. maximum 1000000000000

Variant 2

FieldTypeRequiredDetails
milestoneRewards.eachReport.compensation.type"percentage"Yes
milestoneRewards.eachReport.compensation.rateBpsintegerYesminimum 1. maximum 10000

milestoneRewards.atCount

FieldTypeRequiredDetails
milestoneRewards.atCount.countintegerYesminimum 1. maximum 10000
milestoneRewards.atCount.amountCentsintegerYesminimum 0. maximum 1000000000000

duration

Variant 1

FieldTypeRequiredDetails
duration.type"only_order"Yes

Variant 2

FieldTypeRequiredDetails
duration.type"first_order"Yes

Variant 3

FieldTypeRequiredDetails
duration.type"first_n_orders"Yes
duration.countintegerYesminimum 1. maximum 10000

Variant 4

FieldTypeRequiredDetails
duration.type"days"Yes
duration.daysintegerYesminimum 1. maximum 36500

Variant 5

FieldTypeRequiredDetails
duration.type"months"Yes
duration.monthsintegerYesminimum 1. maximum 1200

Variant 6

FieldTypeRequiredDetails
duration.type"lifetime"Yes

delivery

FieldTypeRequiredDetails
delivery.cash"grizzlee_wallet", "merchant"Nodefault "grizzlee_wallet"
delivery.credit"grizzlee_wallet", "merchant"Nodefault "grizzlee_wallet"

attributionWindowDays

Variant 1

Type: integer.

Variant 2

Type: null.

fraudChecks

FieldTypeRequiredDetails
fraudChecks.selfReferralobjectNodefault {}
fraudChecks.duplicateAccountsobjectNodefault {}
fraudChecks.rapidRepeatsobjectNodefault {}
fraudChecks.repeatCustomerobjectNodefault {}
fraudChecks.disposableEmailobjectNodefault {}

fraudChecks.selfReferral

FieldTypeRequiredDetails
fraudChecks.selfReferral.action"block", "review", "flag", "off"Nodefault "block"

fraudChecks.duplicateAccounts

FieldTypeRequiredDetails
fraudChecks.duplicateAccounts.action"block", "review", "flag", "off"Nodefault "flag"
fraudChecks.duplicateAccounts.accountsintegerNominimum 2. maximum 200. default 3
fraudChecks.duplicateAccounts.windowDaysintegerNominimum 1. maximum 365. default 30
fraudChecks.duplicateAccounts.ipAccountsunionNodefault null

fraudChecks.duplicateAccounts.ipAccounts

Variant 1

Type: integer.

Variant 2

Type: null.

fraudChecks.rapidRepeats

FieldTypeRequiredDetails
fraudChecks.rapidRepeats.action"block", "review", "flag", "off"Nodefault "flag"
fraudChecks.rapidRepeats.referralsintegerNominimum 2. maximum 200. default 3
fraudChecks.rapidRepeats.windowMinutesintegerNominimum 1. maximum 10080. default 60
fraudChecks.rapidRepeats.ipReferralsunionNodefault null

fraudChecks.rapidRepeats.ipReferrals

Variant 1

Type: integer.

Variant 2

Type: null.

fraudChecks.repeatCustomer

FieldTypeRequiredDetails
fraudChecks.repeatCustomer.action"block", "review", "flag", "off"Nodefault "flag"

fraudChecks.disposableEmail

FieldTypeRequiredDetails
fraudChecks.disposableEmail.action"review", "flag", "off"Nodefault "flag"

performance

FieldTypeRequiredDetails
performance.metric"new_customers", "orders"Yes
performance.windowDaysintegerNominimum 1. maximum 3650
performance.tiersarrayYes

performance.tiers[]

FieldTypeRequiredDetails
performance.tiers.namestringYes
performance.tiers.minValueintegerYesminimum 1. maximum 1000000
performance.tiers.bonusBpsintegerYesminimum 0. maximum 10000

limits

FieldTypeRequiredDetails
limits.customerCapCentsintegerNominimum 0. maximum 1000000000000
limits.partnerCapCentsintegerNominimum 0. maximum 1000000000000

customTerms[]

Variant 1

FieldTypeRequiredDetails
customTerms.target"partner"Yes
customTerms.targetIdstringYes
customTerms.compensationunionNo
customTerms.milestoneRewardsobjectNo
customTerms.customerCapCentsunionNo
customTerms.partnerCapCentsunionNo

customTerms.compensation

Variant 1

FieldTypeRequiredDetails
customTerms.compensation.type"percentage"Yes
customTerms.compensation.rateBpsintegerYesminimum 1. maximum 10000
customTerms.compensation.phasesarrayNo

customTerms.compensation.phases[]

FieldTypeRequiredDetails
customTerms.compensation.phases.afterMonthsintegerYesminimum 1. maximum 1200
customTerms.compensation.phases.rateBpsintegerYesminimum 0. maximum 10000

Variant 2

FieldTypeRequiredDetails
customTerms.compensation.type"fixed"Yes
customTerms.compensation.amountCentsintegerYesminimum 0. maximum 1000000000000

customTerms.milestoneRewards

FieldTypeRequiredDetails
customTerms.milestoneRewards.eachReportobjectNo
customTerms.milestoneRewards.atCountobjectNo

customTerms.milestoneRewards.eachReport

FieldTypeRequiredDetails
customTerms.milestoneRewards.eachReport.compensationunionYes
customTerms.milestoneRewards.eachReport.limitintegerNominimum 1. maximum 10000

customTerms.milestoneRewards.eachReport.compensation

Variant 1

FieldTypeRequiredDetails
customTerms.milestoneRewards.eachReport.compensation.type"fixed"Yes
customTerms.milestoneRewards.eachReport.compensation.amountCentsintegerYesminimum 0. maximum 1000000000000

Variant 2

FieldTypeRequiredDetails
customTerms.milestoneRewards.eachReport.compensation.type"percentage"Yes
customTerms.milestoneRewards.eachReport.compensation.rateBpsintegerYesminimum 1. maximum 10000

customTerms.milestoneRewards.atCount

FieldTypeRequiredDetails
customTerms.milestoneRewards.atCount.countintegerYesminimum 1. maximum 10000
customTerms.milestoneRewards.atCount.amountCentsintegerYesminimum 0. maximum 1000000000000

customTerms.customerCapCents

Variant 1

Type: integer.

Variant 2

Type: null.

customTerms.partnerCapCents

Variant 1

Type: integer.

Variant 2

Type: null.

Variant 2

FieldTypeRequiredDetails
customTerms.target"customer"Yes
customTerms.targetIdstringYes
customTerms.compensationunionNo
customTerms.milestoneRewardsobjectNo
customTerms.customerCapCentsunionNo

customTerms.compensation

Variant 1

FieldTypeRequiredDetails
customTerms.compensation.type"percentage"Yes
customTerms.compensation.rateBpsintegerYesminimum 1. maximum 10000
customTerms.compensation.phasesarrayNo

customTerms.compensation.phases[]

FieldTypeRequiredDetails
customTerms.compensation.phases.afterMonthsintegerYesminimum 1. maximum 1200
customTerms.compensation.phases.rateBpsintegerYesminimum 0. maximum 10000

Variant 2

FieldTypeRequiredDetails
customTerms.compensation.type"fixed"Yes
customTerms.compensation.amountCentsintegerYesminimum 0. maximum 1000000000000

customTerms.milestoneRewards

FieldTypeRequiredDetails
customTerms.milestoneRewards.eachReportobjectNo
customTerms.milestoneRewards.atCountobjectNo

customTerms.milestoneRewards.eachReport

FieldTypeRequiredDetails
customTerms.milestoneRewards.eachReport.compensationunionYes
customTerms.milestoneRewards.eachReport.limitintegerNominimum 1. maximum 10000

customTerms.milestoneRewards.eachReport.compensation

Variant 1

FieldTypeRequiredDetails
customTerms.milestoneRewards.eachReport.compensation.type"fixed"Yes
customTerms.milestoneRewards.eachReport.compensation.amountCentsintegerYesminimum 0. maximum 1000000000000

Variant 2

FieldTypeRequiredDetails
customTerms.milestoneRewards.eachReport.compensation.type"percentage"Yes
customTerms.milestoneRewards.eachReport.compensation.rateBpsintegerYesminimum 1. maximum 10000

customTerms.milestoneRewards.atCount

FieldTypeRequiredDetails
customTerms.milestoneRewards.atCount.countintegerYesminimum 1. maximum 10000
customTerms.milestoneRewards.atCount.amountCentsintegerYesminimum 0. maximum 1000000000000

customTerms.customerCapCents

Variant 1

Type: integer.

Variant 2

Type: null.

friendIncentive

Variant 1

Variant 1

FieldTypeRequiredDetails
friendIncentive.type"percent"Yes
friendIncentive.rateBpsintegerYesminimum 1. maximum 10000
friendIncentive.maxDiscountCentsintegerNominimum 0. maximum 1000000000000
friendIncentive.minOrderCentsintegerNominimum 0. maximum 1000000000000
friendIncentive.ordersintegerNominimum 1. maximum 1000. default 1
friendIncentive.newCustomersOnlybooleanNodefault true
friendIncentive.expiresAfterDaysunionNodefault null
friendIncentive.returnOnFullRefundbooleanNodefault false
friendIncentive.orderCategoriesobjectNo

friendIncentive.expiresAfterDays

Variant 1

Type: integer.

Variant 2

Type: null.

friendIncentive.orderCategories

FieldTypeRequiredDetails
friendIncentive.orderCategories.includearrayNo
friendIncentive.orderCategories.excludearrayNo

friendIncentive.orderCategories.include[]

Type: string.

Type: string.

friendIncentive.orderCategories.exclude[]

Type: string.

Type: string.

Variant 2

FieldTypeRequiredDetails
friendIncentive.type"fixed"Yes
friendIncentive.amountCentsintegerYesminimum 0. maximum 1000000000000
friendIncentive.minOrderCentsintegerNominimum 0. maximum 1000000000000
friendIncentive.ordersintegerNominimum 1. maximum 1000. default 1
friendIncentive.newCustomersOnlybooleanNodefault true
friendIncentive.expiresAfterDaysunionNodefault null
friendIncentive.returnOnFullRefundbooleanNodefault false
friendIncentive.orderCategoriesobjectNo

friendIncentive.expiresAfterDays

Variant 1

Type: integer.

Variant 2

Type: null.

friendIncentive.orderCategories

FieldTypeRequiredDetails
friendIncentive.orderCategories.includearrayNo
friendIncentive.orderCategories.excludearrayNo

friendIncentive.orderCategories.include[]

Type: string.

Type: string.

friendIncentive.orderCategories.exclude[]

Type: string.

Type: string.

Variant 2

Type: null.

partnerOffer

Variant 1

FieldTypeRequiredDetails
partnerOffer.type"percent"Yes
partnerOffer.rateBpsintegerYesminimum 1. maximum 10000
partnerOffer.maxDiscountCentsintegerNominimum 0. maximum 1000000000000
partnerOffer.minOrderCentsintegerNominimum 0. maximum 1000000000000
partnerOffer.ordersintegerNominimum 1. maximum 1000. default 1
partnerOffer.expiresAfterDaysunionNodefault null
partnerOffer.returnOnFullRefundbooleanNodefault false
partnerOffer.orderCategoriesobjectNo

partnerOffer.expiresAfterDays

Variant 1

Type: integer.

Variant 2

Type: null.

partnerOffer.orderCategories

FieldTypeRequiredDetails
partnerOffer.orderCategories.includearrayNo
partnerOffer.orderCategories.excludearrayNo

partnerOffer.orderCategories.include[]

Type: string.

Type: string.

partnerOffer.orderCategories.exclude[]

Type: string.

Type: string.

Variant 2

FieldTypeRequiredDetails
partnerOffer.type"fixed"Yes
partnerOffer.amountCentsintegerYesminimum 0. maximum 1000000000000
partnerOffer.minOrderCentsintegerNominimum 0. maximum 1000000000000
partnerOffer.ordersintegerNominimum 1. maximum 1000. default 1
partnerOffer.expiresAfterDaysunionNodefault null
partnerOffer.returnOnFullRefundbooleanNodefault false
partnerOffer.orderCategoriesobjectNo

partnerOffer.expiresAfterDays

Variant 1

Type: integer.

Variant 2

Type: null.

partnerOffer.orderCategories

FieldTypeRequiredDetails
partnerOffer.orderCategories.includearrayNo
partnerOffer.orderCategories.excludearrayNo

partnerOffer.orderCategories.include[]

Type: string.

Type: string.

partnerOffer.orderCategories.exclude[]

Type: string.

Type: string.

orderCategories

Variant 1

FieldTypeRequiredDetails
orderCategories.includearrayNo
orderCategories.excludearrayNo

orderCategories.include[]

Type: string.

Type: string.

orderCategories.exclude[]

Type: string.

Type: string.

Variant 2

Type: null.

Request schema

json
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 2,
      "maxLength": 100
    },
    "kind": {
      "type": "string",
      "enum": [
        "referral",
        "affiliate",
        "both"
      ]
    },
    "tracking": {
      "type": "object",
      "properties": {
        "links": {
          "type": "boolean",
          "default": true
        },
        "qrCodes": {
          "type": "boolean",
          "default": true
        },
        "attributionCodes": {
          "type": "boolean",
          "default": true
        },
        "providerPromoCodes": {
          "type": "boolean",
          "default": false
        }
      },
      "additionalProperties": false
    },
    "currency": {
      "type": "string",
      "enum": [
        "CAD",
        "USD",
        "EUR",
        "GBP"
      ]
    },
    "destinationUrl": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 2000,
          "format": "uri"
        },
        {
          "type": "null"
        }
      ]
    },
    "display": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "en": {
              "type": "object",
              "properties": {
                "publicName": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                },
                "headline": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 120
                },
                "milestoneLabel": {
                  "type": "object",
                  "properties": {
                    "one": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 40
                    },
                    "other": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 40
                    }
                  },
                  "required": [
                    "one",
                    "other"
                  ],
                  "additionalProperties": false
                }
              },
              "additionalProperties": false
            },
            "fr-CA": {
              "type": "object",
              "properties": {
                "publicName": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                },
                "headline": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 120
                },
                "milestoneLabel": {
                  "type": "object",
                  "properties": {
                    "one": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 40
                    },
                    "other": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 40
                    }
                  },
                  "required": [
                    "one",
                    "other"
                  ],
                  "additionalProperties": false
                }
              },
              "additionalProperties": false
            },
            "hy": {
              "type": "object",
              "properties": {
                "publicName": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                },
                "headline": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 120
                },
                "milestoneLabel": {
                  "type": "object",
                  "properties": {
                    "one": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 40
                    },
                    "other": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 40
                    }
                  },
                  "required": [
                    "one",
                    "other"
                  ],
                  "additionalProperties": false
                }
              },
              "additionalProperties": false
            },
            "ru": {
              "type": "object",
              "properties": {
                "publicName": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                },
                "headline": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 120
                },
                "milestoneLabel": {
                  "type": "object",
                  "properties": {
                    "one": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 40
                    },
                    "other": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 40
                    }
                  },
                  "required": [
                    "one",
                    "other"
                  ],
                  "additionalProperties": false
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    },
    "trigger": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "order"
            }
          },
          "required": [
            "type"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "milestone"
            },
            "milestone": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,79}$"
            }
          },
          "required": [
            "type",
            "milestone"
          ],
          "additionalProperties": false
        }
      ]
    },
    "compensation": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "percentage"
            },
            "rateBps": {
              "type": "integer",
              "minimum": 1,
              "maximum": 10000
            },
            "phases": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "afterMonths": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1200
                  },
                  "rateBps": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 10000
                  }
                },
                "required": [
                  "afterMonths",
                  "rateBps"
                ],
                "additionalProperties": false
              },
              "minItems": 1,
              "maxItems": 12
            }
          },
          "required": [
            "type",
            "rateBps"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "fixed"
            },
            "amountCents": {
              "type": "integer",
              "minimum": 0,
              "maximum": 1000000000000
            }
          },
          "required": [
            "type",
            "amountCents"
          ],
          "additionalProperties": false
        }
      ]
    },
    "milestoneRewards": {
      "type": "object",
      "properties": {
        "eachReport": {
          "type": "object",
          "properties": {
            "compensation": {
              "anyOf": [
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "fixed"
                    },
                    "amountCents": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 1000000000000
                    }
                  },
                  "required": [
                    "type",
                    "amountCents"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "percentage"
                    },
                    "rateBps": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 10000
                    }
                  },
                  "required": [
                    "type",
                    "rateBps"
                  ],
                  "additionalProperties": false
                }
              ]
            },
            "limit": {
              "type": "integer",
              "minimum": 1,
              "maximum": 10000
            }
          },
          "required": [
            "compensation"
          ],
          "additionalProperties": false
        },
        "atCount": {
          "type": "object",
          "properties": {
            "count": {
              "type": "integer",
              "minimum": 1,
              "maximum": 10000
            },
            "amountCents": {
              "type": "integer",
              "minimum": 0,
              "maximum": 1000000000000
            }
          },
          "required": [
            "count",
            "amountCents"
          ],
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "fixedRefundMode": {
      "type": "string",
      "enum": [
        "prorate",
        "full_refund_only"
      ]
    },
    "duration": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "only_order"
            }
          },
          "required": [
            "type"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "first_order"
            }
          },
          "required": [
            "type"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "first_n_orders"
            },
            "count": {
              "type": "integer",
              "minimum": 1,
              "maximum": 10000
            }
          },
          "required": [
            "type",
            "count"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "days"
            },
            "days": {
              "type": "integer",
              "minimum": 1,
              "maximum": 36500
            }
          },
          "required": [
            "type",
            "days"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "months"
            },
            "months": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1200
            }
          },
          "required": [
            "type",
            "months"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "lifetime"
            }
          },
          "required": [
            "type"
          ],
          "additionalProperties": false
        }
      ]
    },
    "rewardType": {
      "type": "string",
      "enum": [
        "cash",
        "credit",
        "offer"
      ]
    },
    "delivery": {
      "type": "object",
      "properties": {
        "cash": {
          "type": "string",
          "enum": [
            "grizzlee_wallet",
            "merchant"
          ],
          "default": "grizzlee_wallet"
        },
        "credit": {
          "type": "string",
          "enum": [
            "grizzlee_wallet",
            "merchant"
          ],
          "default": "grizzlee_wallet"
        }
      },
      "additionalProperties": false
    },
    "attributionWindowDays": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": 1,
          "maximum": 365
        },
        {
          "type": "null"
        }
      ]
    },
    "reviewRewards": {
      "type": "boolean"
    },
    "fraudChecks": {
      "type": "object",
      "properties": {
        "selfReferral": {
          "type": "object",
          "properties": {
            "action": {
              "type": "string",
              "enum": [
                "block",
                "review",
                "flag",
                "off"
              ],
              "default": "block"
            }
          },
          "additionalProperties": false,
          "default": {}
        },
        "duplicateAccounts": {
          "type": "object",
          "properties": {
            "action": {
              "type": "string",
              "enum": [
                "block",
                "review",
                "flag",
                "off"
              ],
              "default": "flag"
            },
            "accounts": {
              "type": "integer",
              "minimum": 2,
              "maximum": 200,
              "default": 3
            },
            "windowDays": {
              "type": "integer",
              "minimum": 1,
              "maximum": 365,
              "default": 30
            },
            "ipAccounts": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 2,
                  "maximum": 200
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            }
          },
          "additionalProperties": false,
          "default": {}
        },
        "rapidRepeats": {
          "type": "object",
          "properties": {
            "action": {
              "type": "string",
              "enum": [
                "block",
                "review",
                "flag",
                "off"
              ],
              "default": "flag"
            },
            "referrals": {
              "type": "integer",
              "minimum": 2,
              "maximum": 200,
              "default": 3
            },
            "windowMinutes": {
              "type": "integer",
              "minimum": 1,
              "maximum": 10080,
              "default": 60
            },
            "ipReferrals": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 2,
                  "maximum": 200
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            }
          },
          "additionalProperties": false,
          "default": {}
        },
        "repeatCustomer": {
          "type": "object",
          "properties": {
            "action": {
              "type": "string",
              "enum": [
                "block",
                "review",
                "flag",
                "off"
              ],
              "default": "flag"
            }
          },
          "additionalProperties": false,
          "default": {}
        },
        "disposableEmail": {
          "type": "object",
          "properties": {
            "action": {
              "type": "string",
              "enum": [
                "review",
                "flag",
                "off"
              ],
              "default": "flag"
            }
          },
          "additionalProperties": false,
          "default": {}
        }
      },
      "additionalProperties": false
    },
    "active": {
      "type": "boolean"
    },
    "performance": {
      "type": "object",
      "properties": {
        "metric": {
          "type": "string",
          "enum": [
            "new_customers",
            "orders"
          ]
        },
        "windowDays": {
          "type": "integer",
          "minimum": 1,
          "maximum": 3650
        },
        "tiers": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 40
              },
              "minValue": {
                "type": "integer",
                "minimum": 1,
                "maximum": 1000000
              },
              "bonusBps": {
                "type": "integer",
                "minimum": 0,
                "maximum": 10000
              }
            },
            "required": [
              "name",
              "minValue",
              "bonusBps"
            ],
            "additionalProperties": false
          },
          "minItems": 1,
          "maxItems": 10
        }
      },
      "required": [
        "metric",
        "tiers"
      ],
      "additionalProperties": false
    },
    "limits": {
      "type": "object",
      "properties": {
        "customerCapCents": {
          "type": "integer",
          "minimum": 0,
          "maximum": 1000000000000
        },
        "partnerCapCents": {
          "type": "integer",
          "minimum": 0,
          "maximum": 1000000000000
        }
      },
      "additionalProperties": false
    },
    "customTerms": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "target": {
                "type": "string",
                "const": "partner"
              },
              "targetId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              },
              "compensation": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "percentage"
                      },
                      "rateBps": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 10000
                      },
                      "phases": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "afterMonths": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 1200
                            },
                            "rateBps": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 10000
                            }
                          },
                          "required": [
                            "afterMonths",
                            "rateBps"
                          ],
                          "additionalProperties": false
                        },
                        "minItems": 1,
                        "maxItems": 12
                      }
                    },
                    "required": [
                      "type",
                      "rateBps"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "fixed"
                      },
                      "amountCents": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 1000000000000
                      }
                    },
                    "required": [
                      "type",
                      "amountCents"
                    ],
                    "additionalProperties": false
                  }
                ]
              },
              "milestoneRewards": {
                "type": "object",
                "properties": {
                  "eachReport": {
                    "type": "object",
                    "properties": {
                      "compensation": {
                        "anyOf": [
                          {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string",
                                "const": "fixed"
                              },
                              "amountCents": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 1000000000000
                              }
                            },
                            "required": [
                              "type",
                              "amountCents"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string",
                                "const": "percentage"
                              },
                              "rateBps": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 10000
                              }
                            },
                            "required": [
                              "type",
                              "rateBps"
                            ],
                            "additionalProperties": false
                          }
                        ]
                      },
                      "limit": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 10000
                      }
                    },
                    "required": [
                      "compensation"
                    ],
                    "additionalProperties": false
                  },
                  "atCount": {
                    "type": "object",
                    "properties": {
                      "count": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 10000
                      },
                      "amountCents": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 1000000000000
                      }
                    },
                    "required": [
                      "count",
                      "amountCents"
                    ],
                    "additionalProperties": false
                  }
                },
                "additionalProperties": false
              },
              "customerCapCents": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 1000000000000
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "partnerCapCents": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 1000000000000
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "target",
              "targetId"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "target": {
                "type": "string",
                "const": "customer"
              },
              "targetId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              },
              "compensation": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "percentage"
                      },
                      "rateBps": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 10000
                      },
                      "phases": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "afterMonths": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 1200
                            },
                            "rateBps": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 10000
                            }
                          },
                          "required": [
                            "afterMonths",
                            "rateBps"
                          ],
                          "additionalProperties": false
                        },
                        "minItems": 1,
                        "maxItems": 12
                      }
                    },
                    "required": [
                      "type",
                      "rateBps"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "fixed"
                      },
                      "amountCents": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 1000000000000
                      }
                    },
                    "required": [
                      "type",
                      "amountCents"
                    ],
                    "additionalProperties": false
                  }
                ]
              },
              "milestoneRewards": {
                "type": "object",
                "properties": {
                  "eachReport": {
                    "type": "object",
                    "properties": {
                      "compensation": {
                        "anyOf": [
                          {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string",
                                "const": "fixed"
                              },
                              "amountCents": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 1000000000000
                              }
                            },
                            "required": [
                              "type",
                              "amountCents"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string",
                                "const": "percentage"
                              },
                              "rateBps": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 10000
                              }
                            },
                            "required": [
                              "type",
                              "rateBps"
                            ],
                            "additionalProperties": false
                          }
                        ]
                      },
                      "limit": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 10000
                      }
                    },
                    "required": [
                      "compensation"
                    ],
                    "additionalProperties": false
                  },
                  "atCount": {
                    "type": "object",
                    "properties": {
                      "count": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 10000
                      },
                      "amountCents": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 1000000000000
                      }
                    },
                    "required": [
                      "count",
                      "amountCents"
                    ],
                    "additionalProperties": false
                  }
                },
                "additionalProperties": false
              },
              "customerCapCents": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 1000000000000
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "target",
              "targetId"
            ],
            "additionalProperties": false
          }
        ]
      },
      "minItems": 1,
      "maxItems": 100
    },
    "friendIncentive": {
      "anyOf": [
        {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "percent"
                },
                "rateBps": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 10000
                },
                "maxDiscountCents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 1000000000000
                },
                "minOrderCents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 1000000000000
                },
                "orders": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 1000,
                  "default": 1
                },
                "newCustomersOnly": {
                  "type": "boolean",
                  "default": true
                },
                "expiresAfterDays": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 3650
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null
                },
                "returnOnFullRefund": {
                  "type": "boolean",
                  "default": false
                },
                "orderCategories": {
                  "type": "object",
                  "properties": {
                    "include": {
                      "type": "array",
                      "items": {
                        "allOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]{0,39}$"
                          }
                        ]
                      },
                      "minItems": 1,
                      "maxItems": 50
                    },
                    "exclude": {
                      "type": "array",
                      "items": {
                        "allOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]{0,39}$"
                          }
                        ]
                      },
                      "minItems": 1,
                      "maxItems": 50
                    }
                  },
                  "additionalProperties": false
                }
              },
              "required": [
                "type",
                "rateBps"
              ],
              "additionalProperties": false
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "fixed"
                },
                "amountCents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 1000000000000
                },
                "minOrderCents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 1000000000000
                },
                "orders": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 1000,
                  "default": 1
                },
                "newCustomersOnly": {
                  "type": "boolean",
                  "default": true
                },
                "expiresAfterDays": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 3650
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null
                },
                "returnOnFullRefund": {
                  "type": "boolean",
                  "default": false
                },
                "orderCategories": {
                  "type": "object",
                  "properties": {
                    "include": {
                      "type": "array",
                      "items": {
                        "allOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]{0,39}$"
                          }
                        ]
                      },
                      "minItems": 1,
                      "maxItems": 50
                    },
                    "exclude": {
                      "type": "array",
                      "items": {
                        "allOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]{0,39}$"
                          }
                        ]
                      },
                      "minItems": 1,
                      "maxItems": 50
                    }
                  },
                  "additionalProperties": false
                }
              },
              "required": [
                "type",
                "amountCents"
              ],
              "additionalProperties": false
            }
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "partnerOffer": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "percent"
            },
            "rateBps": {
              "type": "integer",
              "minimum": 1,
              "maximum": 10000
            },
            "maxDiscountCents": {
              "type": "integer",
              "minimum": 0,
              "maximum": 1000000000000
            },
            "minOrderCents": {
              "type": "integer",
              "minimum": 0,
              "maximum": 1000000000000
            },
            "orders": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000,
              "default": 1
            },
            "expiresAfterDays": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 3650
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "returnOnFullRefund": {
              "type": "boolean",
              "default": false
            },
            "orderCategories": {
              "type": "object",
              "properties": {
                "include": {
                  "type": "array",
                  "items": {
                    "allOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "string",
                        "pattern": "^[a-z0-9][a-z0-9_-]{0,39}$"
                      }
                    ]
                  },
                  "minItems": 1,
                  "maxItems": 50
                },
                "exclude": {
                  "type": "array",
                  "items": {
                    "allOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "string",
                        "pattern": "^[a-z0-9][a-z0-9_-]{0,39}$"
                      }
                    ]
                  },
                  "minItems": 1,
                  "maxItems": 50
                }
              },
              "additionalProperties": false
            }
          },
          "required": [
            "type",
            "rateBps"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "fixed"
            },
            "amountCents": {
              "type": "integer",
              "minimum": 0,
              "maximum": 1000000000000
            },
            "minOrderCents": {
              "type": "integer",
              "minimum": 0,
              "maximum": 1000000000000
            },
            "orders": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000,
              "default": 1
            },
            "expiresAfterDays": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 3650
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "returnOnFullRefund": {
              "type": "boolean",
              "default": false
            },
            "orderCategories": {
              "type": "object",
              "properties": {
                "include": {
                  "type": "array",
                  "items": {
                    "allOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "string",
                        "pattern": "^[a-z0-9][a-z0-9_-]{0,39}$"
                      }
                    ]
                  },
                  "minItems": 1,
                  "maxItems": 50
                },
                "exclude": {
                  "type": "array",
                  "items": {
                    "allOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "string",
                        "pattern": "^[a-z0-9][a-z0-9_-]{0,39}$"
                      }
                    ]
                  },
                  "minItems": 1,
                  "maxItems": 50
                }
              },
              "additionalProperties": false
            }
          },
          "required": [
            "type",
            "amountCents"
          ],
          "additionalProperties": false
        }
      ]
    },
    "orderCategories": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "include": {
              "type": "array",
              "items": {
                "allOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_-]{0,39}$"
                  }
                ]
              },
              "minItems": 1,
              "maxItems": 50
            },
            "exclude": {
              "type": "array",
              "items": {
                "allOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_-]{0,39}$"
                  }
                ]
              },
              "minItems": 1,
              "maxItems": 50
            }
          },
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "name",
    "kind",
    "rewardType",
    "attributionWindowDays",
    "active"
  ],
  "additionalProperties": false
}

Response

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

FieldTypeRequiredDetails
idstringYes
companyIdstringYes
createdAtstringYes
versionnumberYes1 when created. Every saved change except a rename adds 1. Rewards and incentive reservations record the version they were made under.
updatedAtstringYesLast saved change, including renames.
archivedAtstringNoWhen deleteProgram archived the program because it has history. An archived program stays inactive, has no placement keys and refuses changes. Its referrals, rewards and versions stay.
currencyunionYesMust match the company currency.
namestringYes
kindunionYes
rewardTypeunionYes
attributionWindowDaysunionYesDays after a referral that a first purchase, or a milestone, still counts. The latest referral always wins until one qualifies. Only milestone programs may use null, which means the referral never expires.
activebooleanYes
orderCategoriesobjectNoOrder categories that earn rewards. Order programs only. The friend incentive has its own orderCategories. Absent means every order can earn.
compensationunionNo
trackingobjectNoTracking methods are independent of kind. Provider discounts require a connected provider.
destinationUrlstringNoThe page partner links and QR codes open. A published signup page's destination takes precedence. Without either, partners have no link.
displayobjectNoOptional public name, headline and milestone label for partner and customer screens.
triggerunionNoWhat earns a reward. Defaults to completed orders.
milestoneRewardsobjectNo
fixedRefundModeunionNoHow fixed rewards change after a partial refund.
durationunionNo
deliveryobjectNoWho delivers approved rewards of each type. Defaults to the Grizzlee wallet for both.
reviewRewardsunionNoWhen true, new rewards wait as pending until someone approves them. Otherwise they start approved.
fraudChecksobjectNoSelf-referral and other fraud rules. Absent means every rule uses its default.
performanceobjectNo
limitsobjectNo
customTermsarrayNo
friendIncentiveunionNoOptional offer for the referred customer.
partnerOfferunionNoOffer programs only. What the partner earns per qualifying referred order.

currency

Variant 1

Type: string.

Variant 2

Type: string.

Variant 3

Type: string.

Variant 4

Type: string.

kind

Variant 1

Type: string.

Variant 2

Type: string.

Variant 3

Type: string.

rewardType

Variant 1

Type: string.

Variant 2

Type: string.

Variant 3

Type: string.

attributionWindowDays

Variant 1

Type: null.

Variant 2

Type: number.

orderCategories

FieldTypeRequiredDetails
orderCategories.includearrayNo
orderCategories.excludearrayNo

compensation

Variant 1

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

compensation.phases[]

FieldTypeRequiredDetails
compensation.phases.rateBpsnumberYes
compensation.phases.afterMonthsnumberYes

Variant 2

FieldTypeRequiredDetails
compensation.type"fixed"Yes
compensation.amountCentsnumberYes

tracking

FieldTypeRequiredDetails
tracking.linksunionNo
tracking.qrCodesunionNo
tracking.attributionCodesunionNo
tracking.providerPromoCodesunionNo

Variant 1

Type: boolean.

Variant 2

Type: boolean.

tracking.qrCodes

Variant 1

Type: boolean.

Variant 2

Type: boolean.

tracking.attributionCodes

Variant 1

Type: boolean.

Variant 2

Type: boolean.

tracking.providerPromoCodes

Variant 1

Type: boolean.

Variant 2

Type: boolean.

display

FieldTypeRequiredDetails
display.enobjectNo
display.fr-CAobjectNo
display.hyobjectNo
display.ruobjectNo

display.en

FieldTypeRequiredDetails
display.en.publicNamestringNoThe name partners and customers see. Falls back to the program name.
display.en.headlinestringNoReplaces the generated headline, such as "Give 20%, get $10".
display.en.milestoneLabelobjectNoMilestone programs only. What one report counts, such as one: "lesson", other: "lessons". In Russian, other is the genitive plural, such as "уроков", which reward terms put after "число".

display.en.milestoneLabel

FieldTypeRequiredDetails
display.en.milestoneLabel.onestringYes
display.en.milestoneLabel.otherstringYes

display.fr-CA

FieldTypeRequiredDetails
display.fr-CA.publicNamestringNoThe name partners and customers see. Falls back to the program name.
display.fr-CA.headlinestringNoReplaces the generated headline, such as "Give 20%, get $10".
display.fr-CA.milestoneLabelobjectNoMilestone programs only. What one report counts, such as one: "lesson", other: "lessons". In Russian, other is the genitive plural, such as "уроков", which reward terms put after "число".

display.fr-CA.milestoneLabel

FieldTypeRequiredDetails
display.fr-CA.milestoneLabel.onestringYes
display.fr-CA.milestoneLabel.otherstringYes

display.hy

FieldTypeRequiredDetails
display.hy.publicNamestringNoThe name partners and customers see. Falls back to the program name.
display.hy.headlinestringNoReplaces the generated headline, such as "Give 20%, get $10".
display.hy.milestoneLabelobjectNoMilestone programs only. What one report counts, such as one: "lesson", other: "lessons". In Russian, other is the genitive plural, such as "уроков", which reward terms put after "число".

display.hy.milestoneLabel

FieldTypeRequiredDetails
display.hy.milestoneLabel.onestringYes
display.hy.milestoneLabel.otherstringYes

display.ru

FieldTypeRequiredDetails
display.ru.publicNamestringNoThe name partners and customers see. Falls back to the program name.
display.ru.headlinestringNoReplaces the generated headline, such as "Give 20%, get $10".
display.ru.milestoneLabelobjectNoMilestone programs only. What one report counts, such as one: "lesson", other: "lessons". In Russian, other is the genitive plural, such as "уроков", which reward terms put after "число".

display.ru.milestoneLabel

FieldTypeRequiredDetails
display.ru.milestoneLabel.onestringYes
display.ru.milestoneLabel.otherstringYes

trigger

Variant 1

FieldTypeRequiredDetails
trigger.type"order"Yes

Variant 2

FieldTypeRequiredDetails
trigger.type"milestone"Yes
trigger.milestonestringYes

milestoneRewards

FieldTypeRequiredDetails
milestoneRewards.eachReportobjectNo
milestoneRewards.atCountobjectNo

milestoneRewards.eachReport

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

milestoneRewards.eachReport.compensation

Variant 1

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

Variant 2

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

milestoneRewards.atCount

FieldTypeRequiredDetails
milestoneRewards.atCount.amountCentsnumberYes
milestoneRewards.atCount.countnumberYes

fixedRefundMode

Variant 1

Type: string.

Variant 2

Type: string.

duration

Variant 1

FieldTypeRequiredDetails
duration.type"only_order"Yes

Variant 2

FieldTypeRequiredDetails
duration.type"first_order"Yes

Variant 3

FieldTypeRequiredDetails
duration.type"first_n_orders"Yes
duration.countnumberYes

Variant 4

FieldTypeRequiredDetails
duration.type"days"Yes
duration.daysnumberYes

Variant 5

FieldTypeRequiredDetails
duration.type"months"Yes
duration.monthsnumberYes

Variant 6

FieldTypeRequiredDetails
duration.type"lifetime"Yes

delivery

FieldTypeRequiredDetails
delivery.cashunionNo
delivery.creditunionNo

delivery.cash

Variant 1

Type: string.

Variant 2

Type: string.

delivery.credit

Variant 1

Type: string.

Variant 2

Type: string.

reviewRewards

Variant 1

Type: boolean.

Variant 2

Type: boolean.

fraudChecks

FieldTypeRequiredDetails
fraudChecks.selfReferralobjectNo
fraudChecks.duplicateAccountsobjectNo
fraudChecks.rapidRepeatsobjectNo
fraudChecks.repeatCustomerobjectNo
fraudChecks.disposableEmailobjectNo

fraudChecks.selfReferral

FieldTypeRequiredDetails
fraudChecks.selfReferral.actionunionNo

fraudChecks.selfReferral.action

Variant 1

Type: string.

Variant 2

Type: string.

Variant 3

Type: string.

Variant 4

Type: string.

fraudChecks.duplicateAccounts

FieldTypeRequiredDetails
fraudChecks.duplicateAccounts.actionunionNo
fraudChecks.duplicateAccounts.accountsnumberNoCustomers sharing one card or device that trigger the rule. This one counts when referred inside the window.
fraudChecks.duplicateAccounts.windowDaysnumberNo
fraudChecks.duplicateAccounts.ipAccountsunionNoCustomers sharing one IP address that trigger the rule. null leaves IP addresses out.

fraudChecks.duplicateAccounts.action

Variant 1

Type: string.

Variant 2

Type: string.

Variant 3

Type: string.

Variant 4

Type: string.

fraudChecks.duplicateAccounts.ipAccounts

Variant 1

Type: null.

Variant 2

Type: number.

fraudChecks.rapidRepeats

FieldTypeRequiredDetails
fraudChecks.rapidRepeats.actionunionNo
fraudChecks.rapidRepeats.referralsnumberNoReferrals from one device that trigger the rule. This one counts when referred inside the window.
fraudChecks.rapidRepeats.windowMinutesnumberNo
fraudChecks.rapidRepeats.ipReferralsunionNoReferrals from one IP address that trigger the rule. null leaves IP addresses out.

fraudChecks.rapidRepeats.action

Variant 1

Type: string.

Variant 2

Type: string.

Variant 3

Type: string.

Variant 4

Type: string.

fraudChecks.rapidRepeats.ipReferrals

Variant 1

Type: null.

Variant 2

Type: number.

fraudChecks.repeatCustomer

FieldTypeRequiredDetails
fraudChecks.repeatCustomer.actionunionNo

fraudChecks.repeatCustomer.action

Variant 1

Type: string.

Variant 2

Type: string.

Variant 3

Type: string.

Variant 4

Type: string.

fraudChecks.disposableEmail

FieldTypeRequiredDetails
fraudChecks.disposableEmail.actionunionNoA disposable address does not show a second person, so this rule cannot block.

fraudChecks.disposableEmail.action

Variant 1

Type: string.

Variant 2

Type: string.

Variant 3

Type: string.

performance

FieldTypeRequiredDetails
performance.metricunionYes
performance.tiersarrayYes
performance.windowDaysnumberNo

performance.metric

Variant 1

Type: string.

Variant 2

Type: string.

performance.tiers[]

FieldTypeRequiredDetails
performance.tiers.namestringYes
performance.tiers.minValuenumberYes
performance.tiers.bonusBpsnumberYes

limits

FieldTypeRequiredDetails
limits.customerCapCentsnumberNo
limits.partnerCapCentsnumberNo

customTerms[]

Variant 1

FieldTypeRequiredDetails
customTerms.target"partner"Yes
customTerms.targetIdstringYes
customTerms.compensationunionNo
customTerms.milestoneRewardsobjectNo
customTerms.customerCapCentsunionNo
customTerms.partnerCapCentsunionNo

customTerms.compensation

Variant 1

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

customTerms.compensation.phases[]

FieldTypeRequiredDetails
customTerms.compensation.phases.rateBpsnumberYes
customTerms.compensation.phases.afterMonthsnumberYes

Variant 2

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

customTerms.milestoneRewards

FieldTypeRequiredDetails
customTerms.milestoneRewards.eachReportobjectNo
customTerms.milestoneRewards.atCountobjectNo

customTerms.milestoneRewards.eachReport

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

customTerms.milestoneRewards.eachReport.compensation

Variant 1

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

Variant 2

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

customTerms.milestoneRewards.atCount

FieldTypeRequiredDetails
customTerms.milestoneRewards.atCount.amountCentsnumberYes
customTerms.milestoneRewards.atCount.countnumberYes

customTerms.customerCapCents

Variant 1

Type: null.

Variant 2

Type: number.

customTerms.partnerCapCents

Variant 1

Type: null.

Variant 2

Type: number.

Variant 2

FieldTypeRequiredDetails
customTerms.target"customer"Yes
customTerms.targetIdstringYes
customTerms.compensationunionNo
customTerms.milestoneRewardsobjectNo
customTerms.customerCapCentsunionNo

customTerms.compensation

Variant 1

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

customTerms.compensation.phases[]

FieldTypeRequiredDetails
customTerms.compensation.phases.rateBpsnumberYes
customTerms.compensation.phases.afterMonthsnumberYes

Variant 2

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

customTerms.milestoneRewards

FieldTypeRequiredDetails
customTerms.milestoneRewards.eachReportobjectNo
customTerms.milestoneRewards.atCountobjectNo

customTerms.milestoneRewards.eachReport

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

customTerms.milestoneRewards.eachReport.compensation

Variant 1

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

Variant 2

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

customTerms.milestoneRewards.atCount

FieldTypeRequiredDetails
customTerms.milestoneRewards.atCount.amountCentsnumberYes
customTerms.milestoneRewards.atCount.countnumberYes

customTerms.customerCapCents

Variant 1

Type: null.

Variant 2

Type: number.

friendIncentive

Variant 1

FieldTypeRequiredDetails
friendIncentive.type"percent"Yes
friendIncentive.rateBpsnumberYes
friendIncentive.maxDiscountCentsnumberNoLargest discount for one order.
friendIncentive.minOrderCentsnumberNoThe friend's order total before the discount must reach this amount. Checked by the merchant's checkout.
friendIncentive.ordersnumberNoHow many of the friend's orders get the incentive.
friendIncentive.newCustomersOnlyunionNotrue: 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.
friendIncentive.expiresAfterDaysunionNoDays after the referral was captured, claimed or entered. null means it never expires.
friendIncentive.returnOnFullRefundunionNotrue: a full refund gives the use back, so the customer can get the offer again.
friendIncentive.orderCategoriesobjectNoOrder categories that get the discount. Checked apart from the program's own orderCategories, which decide rewards. Absent means every order qualifies.

friendIncentive.newCustomersOnly

Variant 1

Type: boolean.

Variant 2

Type: boolean.

friendIncentive.expiresAfterDays

Variant 1

Type: null.

Variant 2

Type: number.

friendIncentive.returnOnFullRefund

Variant 1

Type: boolean.

Variant 2

Type: boolean.

friendIncentive.orderCategories

FieldTypeRequiredDetails
friendIncentive.orderCategories.includearrayNo
friendIncentive.orderCategories.excludearrayNo

Variant 2

FieldTypeRequiredDetails
friendIncentive.type"fixed"Yes
friendIncentive.amountCentsnumberYes
friendIncentive.minOrderCentsnumberNoThe friend's order total before the discount must reach this amount. Checked by the merchant's checkout.
friendIncentive.ordersnumberNoHow many of the friend's orders get the incentive.
friendIncentive.newCustomersOnlyunionNotrue: 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.
friendIncentive.expiresAfterDaysunionNoDays after the referral was captured, claimed or entered. null means it never expires.
friendIncentive.returnOnFullRefundunionNotrue: a full refund gives the use back, so the customer can get the offer again.
friendIncentive.orderCategoriesobjectNoOrder categories that get the discount. Checked apart from the program's own orderCategories, which decide rewards. Absent means every order qualifies.

friendIncentive.newCustomersOnly

Variant 1

Type: boolean.

Variant 2

Type: boolean.

friendIncentive.expiresAfterDays

Variant 1

Type: null.

Variant 2

Type: number.

friendIncentive.returnOnFullRefund

Variant 1

Type: boolean.

Variant 2

Type: boolean.

friendIncentive.orderCategories

FieldTypeRequiredDetails
friendIncentive.orderCategories.includearrayNo
friendIncentive.orderCategories.excludearrayNo

partnerOffer

Variant 1

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

partnerOffer.expiresAfterDays

Variant 1

Type: null.

Variant 2

Type: number.

partnerOffer.returnOnFullRefund

Variant 1

Type: boolean.

Variant 2

Type: boolean.

partnerOffer.orderCategories

FieldTypeRequiredDetails
partnerOffer.orderCategories.includearrayNo
partnerOffer.orderCategories.excludearrayNo

Variant 2

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

partnerOffer.expiresAfterDays

Variant 1

Type: null.

Variant 2

Type: number.

partnerOffer.returnOnFullRefund

Variant 1

Type: boolean.

Variant 2

Type: boolean.

partnerOffer.orderCategories

FieldTypeRequiredDetails
partnerOffer.orderCategories.includearrayNo
partnerOffer.orderCategories.excludearrayNo

Response schema

json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "companyId": {
      "type": "string"
    },
    "createdAt": {
      "type": "string"
    },
    "version": {
      "type": "number",
      "description": "1 when created. Every saved change except a rename adds 1. Rewards and incentive reservations\nrecord the version they were made under."
    },
    "updatedAt": {
      "type": "string",
      "description": "Last saved change, including renames."
    },
    "archivedAt": {
      "type": "string",
      "description": "When deleteProgram archived the program because it has history. An archived program stays\ninactive, has no placement keys and refuses changes. Its referrals, rewards and versions stay."
    },
    "currency": {
      "anyOf": [
        {
          "type": "string",
          "const": "CAD"
        },
        {
          "type": "string",
          "const": "USD"
        },
        {
          "type": "string",
          "const": "EUR"
        },
        {
          "type": "string",
          "const": "GBP"
        }
      ],
      "description": "Must match the company currency."
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "anyOf": [
        {
          "type": "string",
          "const": "referral"
        },
        {
          "type": "string",
          "const": "affiliate"
        },
        {
          "type": "string",
          "const": "both"
        }
      ]
    },
    "rewardType": {
      "anyOf": [
        {
          "type": "string",
          "const": "offer"
        },
        {
          "type": "string",
          "const": "cash"
        },
        {
          "type": "string",
          "const": "credit"
        }
      ]
    },
    "attributionWindowDays": {
      "anyOf": [
        {
          "type": "null"
        },
        {
          "type": "number"
        }
      ],
      "description": "Days after a referral that a first purchase, or a milestone, still counts. The latest\nreferral always wins until one qualifies. Only milestone programs may use null, which means\nthe referral never expires."
    },
    "active": {
      "type": "boolean"
    },
    "orderCategories": {
      "type": "object",
      "properties": {
        "include": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "exclude": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "description": "Order categories that earn rewards. Order programs only. The friend incentive has its own\norderCategories. Absent means every order can earn."
    },
    "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"
          ]
        }
      ]
    },
    "tracking": {
      "type": "object",
      "properties": {
        "links": {
          "anyOf": [
            {
              "type": "boolean",
              "const": false
            },
            {
              "type": "boolean",
              "const": true
            }
          ]
        },
        "qrCodes": {
          "anyOf": [
            {
              "type": "boolean",
              "const": false
            },
            {
              "type": "boolean",
              "const": true
            }
          ]
        },
        "attributionCodes": {
          "anyOf": [
            {
              "type": "boolean",
              "const": false
            },
            {
              "type": "boolean",
              "const": true
            }
          ]
        },
        "providerPromoCodes": {
          "anyOf": [
            {
              "type": "boolean",
              "const": false
            },
            {
              "type": "boolean",
              "const": true
            }
          ]
        }
      },
      "description": "Tracking methods are independent of kind. Provider discounts require a connected provider."
    },
    "destinationUrl": {
      "type": "string",
      "description": "The page partner links and QR codes open. A published signup page's destination takes\nprecedence. Without either, partners have no link."
    },
    "display": {
      "type": "object",
      "properties": {
        "en": {
          "type": "object",
          "properties": {
            "publicName": {
              "type": "string",
              "description": "The name partners and customers see. Falls back to the program name."
            },
            "headline": {
              "type": "string",
              "description": "Replaces the generated headline, such as \"Give 20%, get $10\"."
            },
            "milestoneLabel": {
              "type": "object",
              "properties": {
                "one": {
                  "type": "string"
                },
                "other": {
                  "type": "string"
                }
              },
              "required": [
                "one",
                "other"
              ],
              "description": "Milestone programs only. What one report counts, such as one: \"lesson\", other: \"lessons\".\nIn Russian, other is the genitive plural, such as \"уроков\", which reward terms put after\n\"число\"."
            }
          }
        },
        "fr-CA": {
          "type": "object",
          "properties": {
            "publicName": {
              "type": "string",
              "description": "The name partners and customers see. Falls back to the program name."
            },
            "headline": {
              "type": "string",
              "description": "Replaces the generated headline, such as \"Give 20%, get $10\"."
            },
            "milestoneLabel": {
              "type": "object",
              "properties": {
                "one": {
                  "type": "string"
                },
                "other": {
                  "type": "string"
                }
              },
              "required": [
                "one",
                "other"
              ],
              "description": "Milestone programs only. What one report counts, such as one: \"lesson\", other: \"lessons\".\nIn Russian, other is the genitive plural, such as \"уроков\", which reward terms put after\n\"число\"."
            }
          }
        },
        "hy": {
          "type": "object",
          "properties": {
            "publicName": {
              "type": "string",
              "description": "The name partners and customers see. Falls back to the program name."
            },
            "headline": {
              "type": "string",
              "description": "Replaces the generated headline, such as \"Give 20%, get $10\"."
            },
            "milestoneLabel": {
              "type": "object",
              "properties": {
                "one": {
                  "type": "string"
                },
                "other": {
                  "type": "string"
                }
              },
              "required": [
                "one",
                "other"
              ],
              "description": "Milestone programs only. What one report counts, such as one: \"lesson\", other: \"lessons\".\nIn Russian, other is the genitive plural, such as \"уроков\", which reward terms put after\n\"число\"."
            }
          }
        },
        "ru": {
          "type": "object",
          "properties": {
            "publicName": {
              "type": "string",
              "description": "The name partners and customers see. Falls back to the program name."
            },
            "headline": {
              "type": "string",
              "description": "Replaces the generated headline, such as \"Give 20%, get $10\"."
            },
            "milestoneLabel": {
              "type": "object",
              "properties": {
                "one": {
                  "type": "string"
                },
                "other": {
                  "type": "string"
                }
              },
              "required": [
                "one",
                "other"
              ],
              "description": "Milestone programs only. What one report counts, such as one: \"lesson\", other: \"lessons\".\nIn Russian, other is the genitive plural, such as \"уроков\", which reward terms put after\n\"число\"."
            }
          }
        }
      },
      "description": "Optional public name, headline and milestone label for partner and customer screens."
    },
    "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. Defaults to completed orders."
    },
    "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 fixed rewards change after a partial refund."
    },
    "duration": {
      "anyOf": [
        {
          "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"
          ]
        }
      ]
    },
    "delivery": {
      "type": "object",
      "properties": {
        "cash": {
          "anyOf": [
            {
              "type": "string",
              "const": "grizzlee_wallet"
            },
            {
              "type": "string",
              "const": "merchant"
            }
          ]
        },
        "credit": {
          "anyOf": [
            {
              "type": "string",
              "const": "grizzlee_wallet"
            },
            {
              "type": "string",
              "const": "merchant"
            }
          ]
        }
      },
      "description": "Who delivers approved rewards of each type. Defaults to the Grizzlee wallet for both."
    },
    "reviewRewards": {
      "anyOf": [
        {
          "type": "boolean",
          "const": false
        },
        {
          "type": "boolean",
          "const": true
        }
      ],
      "description": "When true, new rewards wait as pending until someone approves them. Otherwise they start approved."
    },
    "fraudChecks": {
      "type": "object",
      "properties": {
        "selfReferral": {
          "type": "object",
          "properties": {
            "action": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "review"
                },
                {
                  "type": "string",
                  "const": "block"
                },
                {
                  "type": "string",
                  "const": "flag"
                },
                {
                  "type": "string",
                  "const": "off"
                }
              ]
            }
          }
        },
        "duplicateAccounts": {
          "type": "object",
          "properties": {
            "action": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "review"
                },
                {
                  "type": "string",
                  "const": "block"
                },
                {
                  "type": "string",
                  "const": "flag"
                },
                {
                  "type": "string",
                  "const": "off"
                }
              ]
            },
            "accounts": {
              "type": "number",
              "description": "Customers sharing one card or device that trigger the rule. This one counts when referred inside the window."
            },
            "windowDays": {
              "type": "number"
            },
            "ipAccounts": {
              "anyOf": [
                {
                  "type": "null"
                },
                {
                  "type": "number"
                }
              ],
              "description": "Customers sharing one IP address that trigger the rule. null leaves IP addresses out."
            }
          }
        },
        "rapidRepeats": {
          "type": "object",
          "properties": {
            "action": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "review"
                },
                {
                  "type": "string",
                  "const": "block"
                },
                {
                  "type": "string",
                  "const": "flag"
                },
                {
                  "type": "string",
                  "const": "off"
                }
              ]
            },
            "referrals": {
              "type": "number",
              "description": "Referrals from one device that trigger the rule. This one counts when referred inside the window."
            },
            "windowMinutes": {
              "type": "number"
            },
            "ipReferrals": {
              "anyOf": [
                {
                  "type": "null"
                },
                {
                  "type": "number"
                }
              ],
              "description": "Referrals from one IP address that trigger the rule. null leaves IP addresses out."
            }
          }
        },
        "repeatCustomer": {
          "type": "object",
          "properties": {
            "action": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "review"
                },
                {
                  "type": "string",
                  "const": "block"
                },
                {
                  "type": "string",
                  "const": "flag"
                },
                {
                  "type": "string",
                  "const": "off"
                }
              ]
            }
          }
        },
        "disposableEmail": {
          "type": "object",
          "properties": {
            "action": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "review"
                },
                {
                  "type": "string",
                  "const": "flag"
                },
                {
                  "type": "string",
                  "const": "off"
                }
              ],
              "description": "A disposable address does not show a second person, so this rule cannot block."
            }
          }
        }
      },
      "description": "Self-referral and other fraud rules. Absent means every rule uses its default."
    },
    "performance": {
      "type": "object",
      "properties": {
        "metric": {
          "anyOf": [
            {
              "type": "string",
              "const": "orders"
            },
            {
              "type": "string",
              "const": "new_customers"
            }
          ]
        },
        "tiers": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "minValue": {
                "type": "number"
              },
              "bonusBps": {
                "type": "number"
              }
            },
            "required": [
              "name",
              "minValue",
              "bonusBps"
            ]
          }
        },
        "windowDays": {
          "type": "number"
        }
      },
      "required": [
        "metric",
        "tiers"
      ]
    },
    "limits": {
      "type": "object",
      "properties": {
        "customerCapCents": {
          "type": "number"
        },
        "partnerCapCents": {
          "type": "number"
        }
      }
    },
    "customTerms": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "target": {
                "type": "string",
                "const": "partner"
              },
              "targetId": {
                "type": "string"
              },
              "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"
                    ]
                  }
                ]
              },
              "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"
                    ]
                  }
                }
              },
              "customerCapCents": {
                "anyOf": [
                  {
                    "type": "null"
                  },
                  {
                    "type": "number"
                  }
                ]
              },
              "partnerCapCents": {
                "anyOf": [
                  {
                    "type": "null"
                  },
                  {
                    "type": "number"
                  }
                ]
              }
            },
            "required": [
              "target",
              "targetId"
            ]
          },
          {
            "type": "object",
            "properties": {
              "target": {
                "type": "string",
                "const": "customer"
              },
              "targetId": {
                "type": "string"
              },
              "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"
                    ]
                  }
                ]
              },
              "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"
                    ]
                  }
                }
              },
              "customerCapCents": {
                "anyOf": [
                  {
                    "type": "null"
                  },
                  {
                    "type": "number"
                  }
                ]
              }
            },
            "required": [
              "target",
              "targetId"
            ]
          }
        ]
      }
    },
    "friendIncentive": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "percent"
            },
            "rateBps": {
              "type": "number"
            },
            "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."
            },
            "orders": {
              "type": "number",
              "description": "How many of the friend's orders get the incentive."
            },
            "newCustomersOnly": {
              "anyOf": [
                {
                  "type": "boolean",
                  "const": false
                },
                {
                  "type": "boolean",
                  "const": true
                }
              ],
              "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": {
              "anyOf": [
                {
                  "type": "boolean",
                  "const": false
                },
                {
                  "type": "boolean",
                  "const": true
                }
              ],
              "description": "true: a full refund gives the use back, so the customer can get the offer again."
            },
            "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."
            }
          },
          "required": [
            "type",
            "rateBps"
          ]
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "fixed"
            },
            "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."
            },
            "orders": {
              "type": "number",
              "description": "How many of the friend's orders get the incentive."
            },
            "newCustomersOnly": {
              "anyOf": [
                {
                  "type": "boolean",
                  "const": false
                },
                {
                  "type": "boolean",
                  "const": true
                }
              ],
              "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": {
              "anyOf": [
                {
                  "type": "boolean",
                  "const": false
                },
                {
                  "type": "boolean",
                  "const": true
                }
              ],
              "description": "true: a full refund gives the use back, so the customer can get the offer again."
            },
            "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."
            }
          },
          "required": [
            "type",
            "amountCents"
          ]
        }
      ],
      "description": "Optional offer for the referred customer."
    },
    "partnerOffer": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "percent"
            },
            "rateBps": {
              "type": "number"
            },
            "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."
            },
            "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": {
              "anyOf": [
                {
                  "type": "boolean",
                  "const": false
                },
                {
                  "type": "boolean",
                  "const": true
                }
              ],
              "description": "true: a full refund gives the use back, so the customer can get the offer again."
            },
            "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."
            }
          },
          "required": [
            "type",
            "rateBps"
          ]
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "fixed"
            },
            "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."
            },
            "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": {
              "anyOf": [
                {
                  "type": "boolean",
                  "const": false
                },
                {
                  "type": "boolean",
                  "const": true
                }
              ],
              "description": "true: a full refund gives the use back, so the customer can get the offer again."
            },
            "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."
            }
          },
          "required": [
            "type",
            "amountCents"
          ]
        }
      ],
      "description": "Offer programs only. What the partner earns per qualifying referred order."
    }
  },
  "required": [
    "id",
    "companyId",
    "createdAt",
    "version",
    "updatedAt",
    "currency",
    "name",
    "kind",
    "rewardType",
    "attributionWindowDays",
    "active"
  ]
}

Errors

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