Skip to Content
Bhakti BaazarDevelopers
API referenceWebhooks

Add a webhook endpoint

POST
/webhook-endpoints

Scope: webhooks:manage

Up to five per seller. The signing secret is in this response only. Each request is a POST with a JSON body { id, type, created, data }, signed the Standard Webhooks way (https://www.standardwebhooks.com): headers webhook-id (the event id, the same on every retry), webhook-timestamp and webhook-signature. Any 2xx answer counts as received. Others are retried with growing waits for 24 hours; an endpoint that fails every attempt for 24 hours is switched off. Delivery is at least once and not in order: deduplicate on webhook-id, and read GET /orders/:id for the current state.

Authorization

sellerApiKey
headerAuthorizationBearer <bbsk_live_…>

A Seller API key, bbsk_live_…

Request Body

application/json
  1. body
url*string

Where to send events: an https:// URL on a public host, standard port. Redirects are not followed.

Lengthlength <= 2048
events*array<>

The event types to send here.

description?string
Lengthlength <= 120

Response Body

application/json
  1. response
id*string
Formatuuid
url*string
description*string|null
events*array<>
enabled*boolean
disabledReason*|

seller: you switched it off. failing: every attempt failed for 24 hours, so we switched it off.

Value in"seller""failing"
disabledAt*|
Formatdate-time
failingSince*|

When the current run of failures began; null after any success.

Formatdate-time
previousSecretExpiresAt*|

After a secret rotation, the old secret also signs until this time.

Formatdate-time
createdAt*string
Formatdate-time
updatedAt*string
Formatdate-time
secret*string

The signing secret, whsec_…. Shown only now; store it to verify the webhook-signature header.

Example Request
curl -X POST 'https://api.bhaktibaazar.com/seller-api/v1/webhook-endpoints' \  -H 'Content-Type: application/json' \  -d '{  "url": "https://erp.example.com/hooks/bhaktibaazar",  "events": [    "order.created"  ]}'
Example Response
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "url": "string",  "description": "string",  "events": [    "order.created"  ],  "enabled": true,  "disabledReason": "seller",  "disabledAt": "2019-08-24T14:15:22Z",  "failingSince": "2019-08-24T14:15:22Z",  "previousSecretExpiresAt": "2019-08-24T14:15:22Z",  "createdAt": "2019-08-24T14:15:22Z",  "updatedAt": "2019-08-24T14:15:22Z",  "secret": "string"}