HTTP endpoints
redeemCredits
POST /api/v1/credits/redeem
Requires credits:write. Keep the Bearer key on your server.
SDK
ts
grizzlee.redeemCredits(input: { partnerId: string; orderId: string; eventId: string; amountCents: number; }): Promise<CreditRedemption>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/credits/redeem' \
-H "Authorization: Bearer $GRIZZLEE_SERVER_KEY" \
-H 'Content-Type: application/json' \
--data '{"partnerId":"partner-example","eventId":"payment-example","orderId":"order-example","amountCents":10000}'Request body
| Field | Type | Required | Details |
|---|---|---|---|
partnerId | string | Yes | |
eventId | string | Yes | |
orderId | string | Yes | |
amountCents | integer | Yes | maximum 1000000000000 |
Request schema
json
{
"type": "object",
"properties": {
"partnerId": {
"type": "string",
"minLength": 1,
"maxLength": 120
},
"eventId": {
"type": "string",
"minLength": 1,
"maxLength": 120
},
"orderId": {
"type": "string",
"minLength": 1,
"maxLength": 120
},
"amountCents": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 1000000000000
}
},
"required": [
"partnerId",
"eventId",
"orderId",
"amountCents"
],
"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 |
|---|---|---|---|
id | string | Yes | |
companyId | string | Yes | |
partnerId | string | Yes | |
eventId | string | Yes | |
orderId | string | Yes | |
currency | union | Yes | |
amountCents | number | Yes | |
restoredCents | number | Yes | |
createdAt | string | Yes |
currency
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"
},
"eventId": {
"type": "string"
},
"orderId": {
"type": "string"
},
"currency": {
"anyOf": [
{
"type": "string",
"const": "CAD"
},
{
"type": "string",
"const": "USD"
},
{
"type": "string",
"const": "EUR"
},
{
"type": "string",
"const": "GBP"
}
]
},
"amountCents": {
"type": "number"
},
"restoredCents": {
"type": "number"
},
"createdAt": {
"type": "string"
}
},
"required": [
"id",
"companyId",
"partnerId",
"eventId",
"orderId",
"currency",
"amountCents",
"restoredCents",
"createdAt"
]
}Errors
Failures return { "error": { "code": "...", "message": "...", "details": {} } }. Details are optional. See error statuses. Reuse an unchanged event payload when retrying.