HTTP endpoints
recoverPartnerDebts
Recover delivery debts of one type, oldest first. Needs rewards:deliver.
POST /api/v1/partners/by-external-id/{externalId}/debts/recover
Requires rewards:deliver. Keep the Bearer key on your server.
SDK
grizzlee.recoverPartnerDebts(externalId: string, input: { amountCents: number; currency: "CAD" | "USD" | "EUR" | "GBP"; rewardType: "cash" | "credit"; externalReference: string; }): Promise<PartnerDebtRecoveryResult>HTTP
Use your backend's HTTP client. The cURL request shows the wire format. Replace path parameters and example values.
curl --fail-with-body --request POST \
'https://app.grizzlee.ca/api/v1/partners/by-external-id/{externalId}/debts/recover' \
-H "Authorization: Bearer $GRIZZLEE_SERVER_KEY" \
-H 'Content-Type: application/json' \
--data '{"externalReference":"externalReference-example","amountCents":10000,"currency":"CAD","rewardType":"cash"}'Request body
| Field | Type | Required | Details |
|---|---|---|---|
externalReference | string | Yes | |
amountCents | integer | Yes | minimum 0. maximum 1000000000000 |
currency | "CAD", "USD", "EUR", "GBP" | Yes | |
rewardType | "cash", "credit" | Yes |
Request schema
{
"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"
]
},
"rewardType": {
"type": "string",
"enum": [
"cash",
"credit"
]
}
},
"required": [
"externalReference",
"amountCents",
"currency",
"rewardType"
],
"additionalProperties": false
}Response
HTTP responses wrap this value in data. The SDK returns the value directly unless the note above describes a wrapper.
| Field | Type | Required | Details |
|---|---|---|---|
partnerId | string | Yes | |
externalReference | string | Yes | |
amountCents | number | Yes | |
currency | union | Yes | |
rewardType | union | Yes | |
settlements | array | Yes | One settlement per allocated debt, oldest debt first. |
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.
settlements[]
| Field | Type | Required | Details |
|---|---|---|---|
settlements.id | string | Yes | |
settlements.companyId | string | Yes | |
settlements.debtId | string | Yes | |
settlements.partnerId | string | Yes | |
settlements.kind | union | Yes | |
settlements.amountCents | number | Yes | |
settlements.externalReference | string | No | Present on recovered settlements. |
settlements.deliveryId | string | No | Present on netted settlements. |
settlements.eventId | string | No | Reward restoration or transfer reversal event. Present on restored settlements. |
settlements.createdAt | string | Yes |
settlements.kind
Variant 1
Type: string.
Variant 2
Type: string.
Variant 3
Type: string.
Response schema
{
"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"
}
]
},
"rewardType": {
"anyOf": [
{
"type": "string",
"const": "cash"
},
{
"type": "string",
"const": "credit"
}
]
},
"settlements": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"companyId": {
"type": "string"
},
"debtId": {
"type": "string"
},
"partnerId": {
"type": "string"
},
"kind": {
"anyOf": [
{
"type": "string",
"const": "restored"
},
{
"type": "string",
"const": "netted"
},
{
"type": "string",
"const": "recovered"
}
]
},
"amountCents": {
"type": "number"
},
"externalReference": {
"type": "string",
"description": "Present on recovered settlements."
},
"deliveryId": {
"type": "string",
"description": "Present on netted settlements."
},
"eventId": {
"type": "string",
"description": "Reward restoration or transfer reversal event. Present on restored settlements."
},
"createdAt": {
"type": "string"
}
},
"required": [
"id",
"companyId",
"debtId",
"partnerId",
"kind",
"amountCents",
"createdAt"
]
},
"description": "One settlement per allocated debt, oldest debt first."
}
},
"required": [
"partnerId",
"externalReference",
"amountCents",
"currency",
"rewardType",
"settlements"
]
}Errors
Failures return { "error": { "code": "...", "message": "...", "details": {} } }. Details are optional. See error statuses. Reuse an unchanged event payload when retrying.