Skip to content
Developer docs
⌘ K
Dashboard ↗

HTTP endpoints

reserveIncentive

Holds a friend or earned offer for a placed order until completion or release. An eligible friend offer wins. Earned holds include rewardId and incentiveKind. Repeating orderId returns the same hold. Other orders holding the remaining uses return eligible false. A supplied newCustomer must match the saved answer. Omit it on a replay to keep that answer.

POST /api/v1/referrals/incentive/reservations

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

SDK

ts
grizzlee.reserveIncentive(input: { customerId: string; orderId: string; programId?: string | undefined; candidates?: ({ type: "receipt"; receipt: string; } | { type: "code"; referralCode: string; programId?: string | undefined; providerPromoCodeId?: string | undefined; enteredAt?: string | undefined; })[] | undefined; signals?: { email?: string | undefined; phone?: string | undefined; phoneHash?: string | undefined; paymentFingerprint?: string | undefined; deviceId?: string | undefined; ipAddress?: string | undefined; } | undefined; newCustomer?: boolean | undefined; baseCents?: number | undefined; categories?: string[] | undefined; }): Promise<IncentiveReservationResult>

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 POST \
  'https://app.grizzlee.ca/api/v1/referrals/incentive/reservations' \
  -H "Authorization: Bearer $GRIZZLEE_SERVER_KEY" \
  -H 'Content-Type: application/json' \
  --data '{"customerId":"customer-example","orderId":"order-example"}'

Request body

FieldTypeRequiredDetails
customerIdstringYes
orderIdstringYes
newCustomerbooleanNo
candidatesarrayNo
programIdstringNo
baseCentsintegerNominimum 0. maximum 1000000000000
categoriesarrayNo
signalsobjectNo

candidates[]

Variant 1

FieldTypeRequiredDetails
candidates.type"receipt"Yes
candidates.receiptstringYes

Variant 2

FieldTypeRequiredDetails
candidates.type"code"Yes
candidates.referralCodestringYes
candidates.programIdstringNo
candidates.providerPromoCodeIdstringNo
candidates.enteredAtstringNodate-time

categories[]

Type: string.

Type: string.

signals

FieldTypeRequiredDetails
signals.emailstringNo
signals.phonestringNo
signals.phoneHashstringNo
signals.paymentFingerprintstringNo
signals.deviceIdstringNo
signals.ipAddressstringNo

Request schema

json
{
  "type": "object",
  "properties": {
    "customerId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    },
    "orderId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    },
    "newCustomer": {
      "type": "boolean"
    },
    "candidates": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "receipt"
              },
              "receipt": {
                "type": "string",
                "maxLength": 4096
              }
            },
            "required": [
              "type",
              "receipt"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "code"
              },
              "referralCode": {
                "type": "string",
                "maxLength": 120
              },
              "programId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              },
              "providerPromoCodeId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              },
              "enteredAt": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "type",
              "referralCode"
            ],
            "additionalProperties": false
          }
        ]
      },
      "maxItems": 50
    },
    "programId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    },
    "baseCents": {
      "type": "integer",
      "minimum": 0,
      "maximum": 1000000000000
    },
    "categories": {
      "type": "array",
      "items": {
        "allOf": [
          {
            "type": "string"
          },
          {
            "type": "string",
            "pattern": "^[a-z0-9][a-z0-9_-]{0,39}$"
          }
        ]
      },
      "maxItems": 20
    },
    "signals": {
      "type": "object",
      "properties": {
        "email": {
          "type": "string",
          "maxLength": 254
        },
        "phone": {
          "type": "string",
          "maxLength": 40
        },
        "phoneHash": {
          "type": "string",
          "pattern": "^[0-9a-fA-F]{64}$"
        },
        "paymentFingerprint": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255
        },
        "deviceId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255
        },
        "ipAddress": {
          "type": "string",
          "maxLength": 64
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "customerId",
    "orderId"
  ],
  "additionalProperties": false
}

Response

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

FieldTypeRequiredDetails
incentiveKindunionYes
rewardIdstringNoPresent only for earned offers.
reservationIdunionYesNull when the customer is not eligible. Nothing is held then. A replayed order returns its reservation with eligible false once it is consumed or released.
statusunionYes
orderIdunionYes
eligiblebooleanYes
reasonunionNo
programIdunionYes
partnerIdunionYes
termsunionYesThe terms the reservation holds, with currency, or the program's current offer when none is held.
programVersionnumberNoThe program version terms come from: the reservation's version, or the current version when nothing is held. Absent for reservations made before programs had versions.
suggestedDiscountCentsnumberNocomputeIncentiveCents(terms, baseCents). Present when baseCents was sent and the customer is eligible.
customerOrderNumbernumberYesThe purchase number Grizzlee expects for this order.
selfReferralobjectNoPresent when customer links or identity signals match the partner. Works like the lookup's.
fraudobjectNoPresent when fraud rules fired. Works like the lookup's.
referralSelectionobjectNo

incentiveKind

Variant 1

Type: string.

Variant 2

Type: string.

reservationId

Variant 1

Type: null.

Variant 2

Type: string.

status

Variant 1

Type: null.

Variant 2

Type: string.

Variant 3

Type: string.

Variant 4

Type: string.

orderId

Variant 1

Type: null.

Variant 2

Type: string.

reason

Variant 1

Type: string.

Variant 2

Type: string.

Variant 3

Type: string.

Variant 4

Type: string.

Variant 5

Type: string.

Variant 6

Type: string.

Variant 7

Type: string.

Variant 8

Type: string.

Variant 9

Type: string.

Variant 10

Type: string.

Variant 11

Type: string.

Variant 12

Type: string.

Variant 13

Type: string.

programId

Variant 1

Type: null.

Variant 2

Type: string.

partnerId

Variant 1

Type: null.

Variant 2

Type: string.

terms

Variant 1

Type: null.

Variant 2

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

terms.expiresAfterDays

Variant 1

Type: null.

Variant 2

Type: number.

terms.orderCategories

FieldTypeRequiredDetails
terms.orderCategories.includearrayNo
terms.orderCategories.excludearrayNo

terms.currency

Variant 1

Type: string.

Variant 2

Type: string.

Variant 3

Type: string.

Variant 4

Type: string.

Variant 3

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

terms.expiresAfterDays

Variant 1

Type: null.

Variant 2

Type: number.

terms.orderCategories

FieldTypeRequiredDetails
terms.orderCategories.includearrayNo
terms.orderCategories.excludearrayNo

terms.currency

Variant 1

Type: string.

Variant 2

Type: string.

Variant 3

Type: string.

Variant 4

Type: string.

Variant 4

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

terms.expiresAfterDays

Variant 1

Type: null.

Variant 2

Type: number.

terms.orderCategories

FieldTypeRequiredDetails
terms.orderCategories.includearrayNo
terms.orderCategories.excludearrayNo

terms.currency

Variant 1

Type: string.

Variant 2

Type: string.

Variant 3

Type: string.

Variant 4

Type: string.

Variant 5

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

terms.expiresAfterDays

Variant 1

Type: null.

Variant 2

Type: number.

terms.orderCategories

FieldTypeRequiredDetails
terms.orderCategories.includearrayNo
terms.orderCategories.excludearrayNo

terms.currency

Variant 1

Type: string.

Variant 2

Type: string.

Variant 3

Type: string.

Variant 4

Type: string.

selfReferral

FieldTypeRequiredDetails
selfReferral.actionunionYes
selfReferral.signalsarrayYes

selfReferral.action

Variant 1

Type: string.

Variant 2

Type: string.

Variant 3

Type: string.

selfReferral.signals[]

Variant 1

Type: string.

Variant 2

Type: string.

Variant 3

Type: string.

Variant 4

Type: string.

Variant 5

Type: string.

Variant 6

Type: string.

fraud

FieldTypeRequiredDetails
fraud.actionunionYes
fraud.rulesarrayYes

fraud.action

Variant 1

Type: string.

Variant 2

Type: string.

Variant 3

Type: string.

fraud.rules[]

FieldTypeRequiredDetails
fraud.rules.actionunionYes
fraud.rules.ruleunionYes
fraud.rules.signalsarrayYesMatching signal types, never values. Empty for disposable_email.
fraud.rules.countnumberNoCustomers counted, this one included when referred inside the window. Velocity rules only.

fraud.rules.action

Variant 1

Type: string.

Variant 2

Type: string.

Variant 3

Type: string.

fraud.rules.rule

Variant 1

Type: string.

Variant 2

Type: string.

Variant 3

Type: string.

Variant 4

Type: string.

fraud.rules.signals[]

Variant 1

Type: string.

Variant 2

Type: string.

Variant 3

Type: string.

Variant 4

Type: string.

Variant 5

Type: string.

referralSelection

FieldTypeRequiredDetails
referralSelection.winnerunionYes
referralSelection.skippedarrayYes

referralSelection.winner

Variant 1

Type: null.

Variant 2

FieldTypeRequiredDetails
referralSelection.winner.programIdstringYes
referralSelection.winner.partnerIdstringYes
referralSelection.winner.occurredAtstringYes
referralSelection.winner.typeunionNo
referralSelection.winner.providerPromoCodeIdstringNo
referralSelection.winner.indexnumberNoAbsent when the customer's recorded attribution is retained.

referralSelection.winner.type

Variant 1

Type: string.

Variant 2

Type: string.

referralSelection.skipped[]

FieldTypeRequiredDetails
referralSelection.skipped.indexnumberYes
referralSelection.skipped.reasonunionYes

referralSelection.skipped.reason

Variant 1

Type: string.

Variant 2

Type: string.

Variant 3

Type: string.

Variant 4

Type: string.

Variant 5

Type: string.

Variant 6

Type: string.

Variant 7

Type: string.

Variant 8

Type: string.

Variant 9

Type: string.

Response schema

json
{
  "type": "object",
  "properties": {
    "incentiveKind": {
      "anyOf": [
        {
          "type": "string",
          "const": "friend"
        },
        {
          "type": "string",
          "const": "earned"
        }
      ]
    },
    "rewardId": {
      "type": "string",
      "description": "Present only for earned offers."
    },
    "reservationId": {
      "anyOf": [
        {
          "type": "null"
        },
        {
          "type": "string"
        }
      ],
      "description": "Null when the customer is not eligible. Nothing is held then. A replayed order returns its\nreservation with eligible false once it is consumed or released."
    },
    "status": {
      "anyOf": [
        {
          "type": "null"
        },
        {
          "type": "string",
          "const": "open"
        },
        {
          "type": "string",
          "const": "consumed"
        },
        {
          "type": "string",
          "const": "released"
        }
      ]
    },
    "orderId": {
      "anyOf": [
        {
          "type": "null"
        },
        {
          "type": "string"
        }
      ]
    },
    "eligible": {
      "type": "boolean"
    },
    "reason": {
      "anyOf": [
        {
          "type": "string",
          "const": "expired"
        },
        {
          "type": "string",
          "const": "self_referral"
        },
        {
          "type": "string",
          "const": "program_inactive"
        },
        {
          "type": "string",
          "const": "partner_inactive"
        },
        {
          "type": "string",
          "const": "fraud"
        },
        {
          "type": "string",
          "const": "no_referral"
        },
        {
          "type": "string",
          "const": "category_not_eligible"
        },
        {
          "type": "string",
          "const": "no_incentive"
        },
        {
          "type": "string",
          "const": "not_new_customer"
        },
        {
          "type": "string",
          "const": "order_limit_reached"
        },
        {
          "type": "string",
          "const": "uses_exhausted"
        },
        {
          "type": "string",
          "const": "reservation_open"
        },
        {
          "type": "string",
          "const": "offer_voided"
        }
      ]
    },
    "programId": {
      "anyOf": [
        {
          "type": "null"
        },
        {
          "type": "string"
        }
      ]
    },
    "partnerId": {
      "anyOf": [
        {
          "type": "null"
        },
        {
          "type": "string"
        }
      ]
    },
    "terms": {
      "anyOf": [
        {
          "type": "null"
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "percent"
            },
            "rateBps": {
              "type": "number"
            },
            "orders": {
              "type": "number",
              "description": "How many of the friend's orders get the incentive."
            },
            "expiresAfterDays": {
              "anyOf": [
                {
                  "type": "null"
                },
                {
                  "type": "number"
                }
              ],
              "description": "Days after the referral was captured, claimed or entered. null means it never expires."
            },
            "returnOnFullRefund": {
              "type": "boolean",
              "description": "true: a full refund gives the use back, so the customer can get the offer again."
            },
            "maxDiscountCents": {
              "type": "number",
              "description": "Largest discount for one order."
            },
            "minOrderCents": {
              "type": "number",
              "description": "The friend's order total before the discount must reach this amount. Checked by the merchant's checkout."
            },
            "orderCategories": {
              "type": "object",
              "properties": {
                "include": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "exclude": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              },
              "description": "Order categories that get the discount. Checked apart from the program's own orderCategories,\nwhich decide rewards. Absent means every order qualifies."
            },
            "currency": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "CAD"
                },
                {
                  "type": "string",
                  "const": "USD"
                },
                {
                  "type": "string",
                  "const": "EUR"
                },
                {
                  "type": "string",
                  "const": "GBP"
                }
              ]
            }
          },
          "required": [
            "type",
            "rateBps",
            "orders",
            "expiresAfterDays",
            "returnOnFullRefund",
            "currency"
          ]
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "fixed"
            },
            "orders": {
              "type": "number",
              "description": "How many of the friend's orders get the incentive."
            },
            "expiresAfterDays": {
              "anyOf": [
                {
                  "type": "null"
                },
                {
                  "type": "number"
                }
              ],
              "description": "Days after the referral was captured, claimed or entered. null means it never expires."
            },
            "returnOnFullRefund": {
              "type": "boolean",
              "description": "true: a full refund gives the use back, so the customer can get the offer again."
            },
            "amountCents": {
              "type": "number"
            },
            "minOrderCents": {
              "type": "number",
              "description": "The friend's order total before the discount must reach this amount. Checked by the merchant's checkout."
            },
            "orderCategories": {
              "type": "object",
              "properties": {
                "include": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "exclude": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              },
              "description": "Order categories that get the discount. Checked apart from the program's own orderCategories,\nwhich decide rewards. Absent means every order qualifies."
            },
            "currency": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "CAD"
                },
                {
                  "type": "string",
                  "const": "USD"
                },
                {
                  "type": "string",
                  "const": "EUR"
                },
                {
                  "type": "string",
                  "const": "GBP"
                }
              ]
            }
          },
          "required": [
            "type",
            "orders",
            "expiresAfterDays",
            "returnOnFullRefund",
            "amountCents",
            "currency"
          ]
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "percent"
            },
            "rateBps": {
              "type": "number"
            },
            "orders": {
              "type": "number",
              "description": "How many of the friend's orders get the incentive."
            },
            "newCustomersOnly": {
              "type": "boolean",
              "description": "true: use the merchant's newCustomer answer, or recorded purchases when omitted. false:\nreturning customers qualify too. A supplied answer uses the order limit after the referral."
            },
            "expiresAfterDays": {
              "anyOf": [
                {
                  "type": "null"
                },
                {
                  "type": "number"
                }
              ],
              "description": "Days after the referral was captured, claimed or entered. null means it never expires."
            },
            "returnOnFullRefund": {
              "type": "boolean",
              "description": "true: a full refund gives the use back, so the customer can get the offer again."
            },
            "maxDiscountCents": {
              "type": "number",
              "description": "Largest discount for one order."
            },
            "minOrderCents": {
              "type": "number",
              "description": "The friend's order total before the discount must reach this amount. Checked by the merchant's checkout."
            },
            "orderCategories": {
              "type": "object",
              "properties": {
                "include": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "exclude": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              },
              "description": "Order categories that get the discount. Checked apart from the program's own orderCategories,\nwhich decide rewards. Absent means every order qualifies."
            },
            "currency": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "CAD"
                },
                {
                  "type": "string",
                  "const": "USD"
                },
                {
                  "type": "string",
                  "const": "EUR"
                },
                {
                  "type": "string",
                  "const": "GBP"
                }
              ]
            }
          },
          "required": [
            "type",
            "rateBps",
            "orders",
            "newCustomersOnly",
            "expiresAfterDays",
            "returnOnFullRefund",
            "currency"
          ]
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "fixed"
            },
            "orders": {
              "type": "number",
              "description": "How many of the friend's orders get the incentive."
            },
            "newCustomersOnly": {
              "type": "boolean",
              "description": "true: use the merchant's newCustomer answer, or recorded purchases when omitted. false:\nreturning customers qualify too. A supplied answer uses the order limit after the referral."
            },
            "expiresAfterDays": {
              "anyOf": [
                {
                  "type": "null"
                },
                {
                  "type": "number"
                }
              ],
              "description": "Days after the referral was captured, claimed or entered. null means it never expires."
            },
            "returnOnFullRefund": {
              "type": "boolean",
              "description": "true: a full refund gives the use back, so the customer can get the offer again."
            },
            "amountCents": {
              "type": "number"
            },
            "minOrderCents": {
              "type": "number",
              "description": "The friend's order total before the discount must reach this amount. Checked by the merchant's checkout."
            },
            "orderCategories": {
              "type": "object",
              "properties": {
                "include": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "exclude": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              },
              "description": "Order categories that get the discount. Checked apart from the program's own orderCategories,\nwhich decide rewards. Absent means every order qualifies."
            },
            "currency": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "CAD"
                },
                {
                  "type": "string",
                  "const": "USD"
                },
                {
                  "type": "string",
                  "const": "EUR"
                },
                {
                  "type": "string",
                  "const": "GBP"
                }
              ]
            }
          },
          "required": [
            "type",
            "orders",
            "newCustomersOnly",
            "expiresAfterDays",
            "returnOnFullRefund",
            "amountCents",
            "currency"
          ]
        }
      ],
      "description": "The terms the reservation holds, with currency, or the program's current offer when none is held."
    },
    "programVersion": {
      "type": "number",
      "description": "The program version terms come from: the reservation's version, or the current version when\nnothing is held. Absent for reservations made before programs had versions."
    },
    "suggestedDiscountCents": {
      "type": "number",
      "description": "computeIncentiveCents(terms, baseCents). Present when baseCents was sent and the customer is eligible."
    },
    "customerOrderNumber": {
      "type": "number",
      "description": "The purchase number Grizzlee expects for this order."
    },
    "selfReferral": {
      "type": "object",
      "properties": {
        "action": {
          "anyOf": [
            {
              "type": "string",
              "const": "blocked"
            },
            {
              "type": "string",
              "const": "review"
            },
            {
              "type": "string",
              "const": "flagged"
            }
          ]
        },
        "signals": {
          "type": "array",
          "items": {
            "anyOf": [
              {
                "type": "string",
                "const": "email"
              },
              {
                "type": "string",
                "const": "phone"
              },
              {
                "type": "string",
                "const": "card"
              },
              {
                "type": "string",
                "const": "device"
              },
              {
                "type": "string",
                "const": "ip"
              },
              {
                "type": "string",
                "const": "customer_id"
              }
            ]
          }
        }
      },
      "required": [
        "action",
        "signals"
      ],
      "description": "Present when customer links or identity signals match the partner. Works like the lookup's."
    },
    "fraud": {
      "type": "object",
      "properties": {
        "action": {
          "anyOf": [
            {
              "type": "string",
              "const": "blocked"
            },
            {
              "type": "string",
              "const": "review"
            },
            {
              "type": "string",
              "const": "flagged"
            }
          ]
        },
        "rules": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "action": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "blocked"
                  },
                  {
                    "type": "string",
                    "const": "review"
                  },
                  {
                    "type": "string",
                    "const": "flagged"
                  }
                ]
              },
              "rule": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "duplicate_accounts"
                  },
                  {
                    "type": "string",
                    "const": "rapid_repeats"
                  },
                  {
                    "type": "string",
                    "const": "repeat_customer"
                  },
                  {
                    "type": "string",
                    "const": "disposable_email"
                  }
                ]
              },
              "signals": {
                "type": "array",
                "items": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "email"
                    },
                    {
                      "type": "string",
                      "const": "phone"
                    },
                    {
                      "type": "string",
                      "const": "card"
                    },
                    {
                      "type": "string",
                      "const": "device"
                    },
                    {
                      "type": "string",
                      "const": "ip"
                    }
                  ]
                },
                "description": "Matching signal types, never values. Empty for disposable_email."
              },
              "count": {
                "type": "number",
                "description": "Customers counted, this one included when referred inside the window. Velocity rules only."
              }
            },
            "required": [
              "action",
              "rule",
              "signals"
            ]
          }
        }
      },
      "required": [
        "action",
        "rules"
      ],
      "description": "Present when fraud rules fired. Works like the lookup's."
    },
    "referralSelection": {
      "type": "object",
      "properties": {
        "winner": {
          "anyOf": [
            {
              "type": "null"
            },
            {
              "type": "object",
              "properties": {
                "programId": {
                  "type": "string"
                },
                "partnerId": {
                  "type": "string"
                },
                "occurredAt": {
                  "type": "string"
                },
                "type": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "code"
                    },
                    {
                      "type": "string",
                      "const": "receipt"
                    }
                  ]
                },
                "providerPromoCodeId": {
                  "type": "string"
                },
                "index": {
                  "type": "number",
                  "description": "Absent when the customer's recorded attribution is retained."
                }
              },
              "required": [
                "programId",
                "partnerId",
                "occurredAt"
              ]
            }
          ]
        },
        "skipped": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "index": {
                "type": "number"
              },
              "reason": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "expired"
                  },
                  {
                    "type": "string",
                    "const": "invalid"
                  },
                  {
                    "type": "string",
                    "const": "self_referral"
                  },
                  {
                    "type": "string",
                    "const": "wrong_program"
                  },
                  {
                    "type": "string",
                    "const": "program_inactive"
                  },
                  {
                    "type": "string",
                    "const": "partner_inactive"
                  },
                  {
                    "type": "string",
                    "const": "fraud"
                  },
                  {
                    "type": "string",
                    "const": "customer_already_referred"
                  },
                  {
                    "type": "string",
                    "const": "older"
                  }
                ]
              }
            },
            "required": [
              "index",
              "reason"
            ]
          }
        }
      },
      "required": [
        "winner",
        "skipped"
      ]
    }
  },
  "required": [
    "incentiveKind",
    "reservationId",
    "status",
    "orderId",
    "eligible",
    "programId",
    "partnerId",
    "terms",
    "customerOrderNumber"
  ]
}

Errors

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