Skip to content
Developer docs
⌘ K
Dashboard ↗

HTTP endpoints

deliverReward

Confirm that you delivered a merchant-mode reward. Needs the rewards:deliver scope.

POST /api/v1/rewards/{rewardId}/deliveries

Requires rewards:deliver. Keep the Bearer key on your server.

SDK

ts
grizzlee.deliverReward(rewardId: string, input: DeliverRewardInput): Promise<RewardDelivery>

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/rewards/{rewardId}/deliveries' \
  -H "Authorization: Bearer $GRIZZLEE_SERVER_KEY" \
  -H 'Content-Type: application/json' \
  --data '{"status":"delivered","externalReference":"externalReference-example"}'

Request body

Variant 1

FieldTypeRequiredDetails
status"delivered"Yes
externalReferencestringYes
deliveredAtstringNodate-time
nettedDebtCentsintegerNominimum 0. maximum 1000000000000

Variant 2

FieldTypeRequiredDetails
status"failed"Yes
reasonstringYes
externalReferencestringYes

Request schema

json
{
  "anyOf": [
    {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "const": "delivered"
        },
        "externalReference": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        },
        "deliveredAt": {
          "type": "string",
          "format": "date-time"
        },
        "nettedDebtCents": {
          "type": "integer",
          "minimum": 0,
          "maximum": 1000000000000
        }
      },
      "required": [
        "status",
        "externalReference"
      ],
      "additionalProperties": false
    },
    {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "const": "failed"
        },
        "reason": {
          "type": "string",
          "minLength": 1,
          "maxLength": 500
        },
        "externalReference": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        }
      },
      "required": [
        "status",
        "reason",
        "externalReference"
      ],
      "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
rewardIdstringYes
partnerIdstringYes
statusunionYes
externalReferencestringNoNew attempts require a reference. Older failures may have none.
amountCentsnumberYesGross amount delivered, amount owed for a failure, or cash returned by a transfer reversal.
currencyunionYes
rewardTypeunionYes
deliveredAtstringNoPresent when delivered.
failureReasonstringNoPresent when failed.
nettedDebtCentsnumberNoPresent when a delivery settled part of the partner's earlier delivery debt.
payoutIdstringNoPresent when a paid merchant payout recorded this delivery.
reversalOfIdstringNoOriginal delivery this append-only transfer reversal reduces.
createdAtstringYes

status

Variant 1

Type: string.

Variant 2

Type: string.

Variant 3

Type: string.

currency

Variant 1

Type: string.

Variant 2

Type: string.

Variant 3

Type: string.

Variant 4

Type: string.

rewardType

Variant 1

Type: string.

Variant 2

Type: string.

Response schema

json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "companyId": {
      "type": "string"
    },
    "rewardId": {
      "type": "string"
    },
    "partnerId": {
      "type": "string"
    },
    "status": {
      "anyOf": [
        {
          "type": "string",
          "const": "reversed"
        },
        {
          "type": "string",
          "const": "delivered"
        },
        {
          "type": "string",
          "const": "failed"
        }
      ]
    },
    "externalReference": {
      "type": "string",
      "description": "New attempts require a reference. Older failures may have none."
    },
    "amountCents": {
      "type": "number",
      "description": "Gross amount delivered, amount owed for a failure, or cash returned by a transfer reversal."
    },
    "currency": {
      "anyOf": [
        {
          "type": "string",
          "const": "CAD"
        },
        {
          "type": "string",
          "const": "USD"
        },
        {
          "type": "string",
          "const": "EUR"
        },
        {
          "type": "string",
          "const": "GBP"
        }
      ]
    },
    "rewardType": {
      "anyOf": [
        {
          "type": "string",
          "const": "cash"
        },
        {
          "type": "string",
          "const": "credit"
        }
      ]
    },
    "deliveredAt": {
      "type": "string",
      "description": "Present when delivered."
    },
    "failureReason": {
      "type": "string",
      "description": "Present when failed."
    },
    "nettedDebtCents": {
      "type": "number",
      "description": "Present when a delivery settled part of the partner's earlier delivery debt."
    },
    "payoutId": {
      "type": "string",
      "description": "Present when a paid merchant payout recorded this delivery."
    },
    "reversalOfId": {
      "type": "string",
      "description": "Original delivery this append-only transfer reversal reduces."
    },
    "createdAt": {
      "type": "string"
    }
  },
  "required": [
    "id",
    "companyId",
    "rewardId",
    "partnerId",
    "status",
    "amountCents",
    "currency",
    "rewardType",
    "createdAt"
  ]
}

Errors

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