HTTP endpoints
restoreCredits
POST /api/v1/credits/{id}/restore
Requires credits:write. Keep the Bearer key on your server.
SDK
ts
grizzlee.restoreCredits(id: string, input: { eventId: string; restoredCents: 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/{id}/restore' \
-H "Authorization: Bearer $GRIZZLEE_SERVER_KEY" \
-H 'Content-Type: application/json' \
--data '{"eventId":"payment-example","restoredCents":500}'Request body
| Field | Type | Required | Details |
|---|---|---|---|
eventId | string | Yes | |
restoredCents | integer | Yes | minimum 0. maximum 1000000000000 |
Request schema
json
{
"type": "object",
"properties": {
"eventId": {
"type": "string",
"minLength": 1,
"maxLength": 120
},
"restoredCents": {
"type": "integer",
"minimum": 0,
"maximum": 1000000000000
}
},
"required": [
"eventId",
"restoredCents"
],
"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.