Skip to content
Developer docs
⌘ K
Dashboard ↗

HTTP endpoints

attribute

POST /api/v1/attributions

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

SDK

ts
grizzlee.attribute(input: { programId: string; referralCode: string; customerId: string; occurredAt: string; channel: "link" | "qr" | "coupon" | "in_app"; providerPromoCodeId?: string | undefined; customerDisplayName?: string | undefined; orderId?: string | undefined; }): Promise<Attribution>

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/attributions' \
  -H "Authorization: Bearer $GRIZZLEE_SERVER_KEY" \
  -H 'Content-Type: application/json' \
  --data '{"programId":"program-example","customerId":"customer-example","orderId":"order-example","referralCode":"EXAMPLE","channel":"link","occurredAt":"2026-10-11T12:00:00.000Z"}'

Request body

FieldTypeRequiredDetails
programIdstringYes
customerIdstringYes
customerDisplayNamestringNo
orderIdstringNo
referralCodestringYes
providerPromoCodeIdstringNo
channel"link", "qr", "coupon", "in_app"Yes
occurredAtstringYesdate-time

Request schema

json
{
  "type": "object",
  "properties": {
    "programId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    },
    "customerId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    },
    "customerDisplayName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80
    },
    "orderId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    },
    "referralCode": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    },
    "providerPromoCodeId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    },
    "channel": {
      "type": "string",
      "enum": [
        "link",
        "qr",
        "coupon",
        "in_app"
      ]
    },
    "occurredAt": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "programId",
    "customerId",
    "referralCode",
    "channel",
    "occurredAt"
  ],
  "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
partnerIdstringYes
qualifiedAtstringNo
qualifiedOrderNumbernumberNo
programIdstringYes
referralCodestringYes
customerIdstringYes
occurredAtstringYes
channelunionYes
providerPromoCodeIdstringNo
customerDisplayNamestringNo
orderIdstringNo

channel

Variant 1

Type: string.

Variant 2

Type: string.

Variant 3

Type: string.

Variant 4

Type: string.

Response schema

json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "companyId": {
      "type": "string"
    },
    "partnerId": {
      "type": "string"
    },
    "qualifiedAt": {
      "type": "string"
    },
    "qualifiedOrderNumber": {
      "type": "number"
    },
    "programId": {
      "type": "string"
    },
    "referralCode": {
      "type": "string"
    },
    "customerId": {
      "type": "string"
    },
    "occurredAt": {
      "type": "string"
    },
    "channel": {
      "anyOf": [
        {
          "type": "string",
          "const": "link"
        },
        {
          "type": "string",
          "const": "qr"
        },
        {
          "type": "string",
          "const": "coupon"
        },
        {
          "type": "string",
          "const": "in_app"
        }
      ]
    },
    "providerPromoCodeId": {
      "type": "string"
    },
    "customerDisplayName": {
      "type": "string"
    },
    "orderId": {
      "type": "string"
    }
  },
  "required": [
    "id",
    "companyId",
    "partnerId",
    "programId",
    "referralCode",
    "customerId",
    "occurredAt",
    "channel"
  ]
}

Errors

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