HTTP endpoints
createWebhook
POST /api/v1/webhooks
Requires settings:write. Keep the Bearer key on your server.
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/webhooks' \
-H "Authorization: Bearer $GRIZZLEE_SERVER_KEY" \
-H 'Content-Type: application/json' \
--data '{"name":"Example referral program","url":"https://shop.example.com","events":["partner.created"]}'Request body
| Field | Type | Required | Details |
|---|---|---|---|
name | string | Yes | |
url | string | Yes | uri |
events | array | Yes |
Request schema
{
"type": "object",
"properties": {
"name": {
"type": "string",
"minLength": 2,
"maxLength": 80
},
"url": {
"type": "string",
"format": "uri"
},
"events": {
"type": "array",
"items": {
"type": "string",
"enum": [
"partner.created",
"order.completed",
"order.refunded",
"order.adjusted",
"reward.created",
"reward.approved",
"reward.reversed",
"reward.restored",
"reward.adjusted",
"reward.delivered",
"reward.delivery_failed",
"reward.debt_recorded",
"reward.debt_settled",
"payout.created",
"payout.paid",
"payout.reversed",
"payout.failed",
"payout.needs_action",
"payout.cancelled",
"payout.account_required",
"credit.redeemed",
"credit.restored",
"incentive.flagged",
"self_referral.detected",
"fraud.flagged",
"referral.displaced",
"milestone.reported",
"milestone.revoked",
"milestone.reinstated",
"milestone.reversed",
"partner.erased",
"customer.erased"
]
},
"minItems": 1,
"maxItems": 32
}
},
"required": [
"name",
"url",
"events"
],
"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 |
|---|---|---|---|
endpoint | object | Yes | |
secret | string | Yes |
endpoint
| Field | Type | Required | Details |
|---|---|---|---|
endpoint.id | string | Yes | |
endpoint.companyId | string | Yes | |
endpoint.name | string | Yes | |
endpoint.url | string | Yes | |
endpoint.events | array | Yes | |
endpoint.active | boolean | Yes | |
endpoint.createdAt | string | Yes |
endpoint.events[]
Variant 1
Type: string.
Variant 2
Type: string.
Variant 3
Type: string.
Variant 4
Type: string.
Variant 5
Type: string.
Variant 6
Type: string.
Variant 7
Type: string.
Variant 8
Type: string.
Variant 9
Type: string.
Variant 10
Type: string.
Variant 11
Type: string.
Variant 12
Type: string.
Variant 13
Type: string.
Variant 14
Type: string.
Variant 15
Type: string.
Variant 16
Type: string.
Variant 17
Type: string.
Variant 18
Type: string.
Variant 19
Type: string.
Variant 20
Type: string.
Variant 21
Type: string.
Variant 22
Type: string.
Variant 23
Type: string.
Variant 24
Type: string.
Variant 25
Type: string.
Variant 26
Type: string.
Variant 27
Type: string.
Variant 28
Type: string.
Variant 29
Type: string.
Variant 30
Type: string.
Variant 31
Type: string.
Variant 32
Type: string.
Response schema
{
"type": "object",
"properties": {
"endpoint": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"companyId": {
"type": "string"
},
"name": {
"type": "string"
},
"url": {
"type": "string"
},
"events": {
"type": "array",
"items": {
"anyOf": [
{
"type": "string",
"const": "order.refunded"
},
{
"type": "string",
"const": "order.adjusted"
},
{
"type": "string",
"const": "order.completed"
},
{
"type": "string",
"const": "partner.created"
},
{
"type": "string",
"const": "reward.created"
},
{
"type": "string",
"const": "reward.approved"
},
{
"type": "string",
"const": "reward.reversed"
},
{
"type": "string",
"const": "reward.restored"
},
{
"type": "string",
"const": "reward.adjusted"
},
{
"type": "string",
"const": "reward.delivered"
},
{
"type": "string",
"const": "reward.delivery_failed"
},
{
"type": "string",
"const": "reward.debt_recorded"
},
{
"type": "string",
"const": "reward.debt_settled"
},
{
"type": "string",
"const": "payout.created"
},
{
"type": "string",
"const": "payout.paid"
},
{
"type": "string",
"const": "payout.reversed"
},
{
"type": "string",
"const": "payout.failed"
},
{
"type": "string",
"const": "payout.needs_action"
},
{
"type": "string",
"const": "payout.cancelled"
},
{
"type": "string",
"const": "payout.account_required"
},
{
"type": "string",
"const": "credit.redeemed"
},
{
"type": "string",
"const": "credit.restored"
},
{
"type": "string",
"const": "incentive.flagged"
},
{
"type": "string",
"const": "self_referral.detected"
},
{
"type": "string",
"const": "fraud.flagged"
},
{
"type": "string",
"const": "referral.displaced"
},
{
"type": "string",
"const": "milestone.reported"
},
{
"type": "string",
"const": "milestone.revoked"
},
{
"type": "string",
"const": "milestone.reinstated"
},
{
"type": "string",
"const": "milestone.reversed"
},
{
"type": "string",
"const": "partner.erased"
},
{
"type": "string",
"const": "customer.erased"
}
]
}
},
"active": {
"type": "boolean"
},
"createdAt": {
"type": "string"
}
},
"required": [
"id",
"companyId",
"name",
"url",
"events",
"active",
"createdAt"
]
},
"secret": {
"type": "string"
}
},
"required": [
"endpoint",
"secret"
]
}Errors
Failures return { "error": { "code": "...", "message": "...", "details": {} } }. Details are optional. See error statuses. Reuse an unchanged event payload when retrying.