Skip to content
Developer docs
⌘ K
Dashboard ↗

HTTP endpoints

deliverPartnerCredit

Confirm credit added to merchant billing. Allocates oldest approval first. Needs rewards:deliver.

POST /api/v1/partners/by-external-id/{externalId}/credit/deliveries

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

SDK

ts
grizzlee.deliverPartnerCredit(externalId: string, input: { amountCents: number; currency: "CAD" | "USD" | "EUR" | "GBP"; externalReference: string; }): Promise<PartnerCreditDeliveryResult>

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/partners/by-external-id/{externalId}/credit/deliveries' \
  -H "Authorization: Bearer $GRIZZLEE_SERVER_KEY" \
  -H 'Content-Type: application/json' \
  --data '{"externalReference":"externalReference-example","amountCents":10000,"currency":"CAD"}'

Request body

FieldTypeRequiredDetails
externalReferencestringYes
amountCentsintegerYesminimum 0. maximum 1000000000000
currency"CAD", "USD", "EUR", "GBP"Yes

Request schema

json
{
  "type": "object",
  "properties": {
    "externalReference": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
    },
    "amountCents": {
      "type": "integer",
      "minimum": 0,
      "maximum": 1000000000000
    },
    "currency": {
      "type": "string",
      "enum": [
        "CAD",
        "USD",
        "EUR",
        "GBP"
      ]
    }
  },
  "required": [
    "externalReference",
    "amountCents",
    "currency"
  ],
  "additionalProperties": false
}

Response

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

FieldTypeRequiredDetails
partnerIdstringYes
externalReferencestringYes
amountCentsnumberYes
currencyunionYes
deliveriesarrayYesOne delivery per allocated reward, oldest approval first.

currency

Variant 1

Type: string.

Variant 2

Type: string.

Variant 3

Type: string.

Variant 4

Type: string.

deliveries[]

FieldTypeRequiredDetails
deliveries.idstringYes
deliveries.companyIdstringYes
deliveries.rewardIdstringYes
deliveries.partnerIdstringYes
deliveries.statusunionYes
deliveries.externalReferencestringNoNew attempts require a reference. Older failures may have none.
deliveries.amountCentsnumberYesGross amount delivered, amount owed for a failure, or cash returned by a transfer reversal.
deliveries.currencyunionYes
deliveries.rewardTypeunionYes
deliveries.deliveredAtstringNoPresent when delivered.
deliveries.failureReasonstringNoPresent when failed.
deliveries.nettedDebtCentsnumberNoPresent when a delivery settled part of the partner's earlier delivery debt.
deliveries.payoutIdstringNoPresent when a paid merchant payout recorded this delivery.
deliveries.reversalOfIdstringNoOriginal delivery this append-only transfer reversal reduces.
deliveries.createdAtstringYes

deliveries.status

Variant 1

Type: string.

Variant 2

Type: string.

Variant 3

Type: string.

deliveries.currency

Variant 1

Type: string.

Variant 2

Type: string.

Variant 3

Type: string.

Variant 4

Type: string.

deliveries.rewardType

Variant 1

Type: string.

Variant 2

Type: string.

Response schema

json
{
  "type": "object",
  "properties": {
    "partnerId": {
      "type": "string"
    },
    "externalReference": {
      "type": "string"
    },
    "amountCents": {
      "type": "number"
    },
    "currency": {
      "anyOf": [
        {
          "type": "string",
          "const": "CAD"
        },
        {
          "type": "string",
          "const": "USD"
        },
        {
          "type": "string",
          "const": "EUR"
        },
        {
          "type": "string",
          "const": "GBP"
        }
      ]
    },
    "deliveries": {
      "type": "array",
      "items": {
        "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"
        ]
      },
      "description": "One delivery per allocated reward, oldest approval first."
    }
  },
  "required": [
    "partnerId",
    "externalReference",
    "amountCents",
    "currency",
    "deliveries"
  ]
}

Errors

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