Add a webhook endpoint
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.
sellerApiKeyAuthorizationBearer <bbsk_live_…>A Seller API key, bbsk_live_…
application/json- body
url*stringWhere to send events: an https:// URL on a public host, standard port. Redirects are not followed.
length <= 2048events*array<>The event types to send here.
description?stringlength <= 120application/json- response
id*stringuuidurl*stringdescription*string|nullevents*array<>enabled*booleandisabledReason*|seller: you switched it off. failing: every attempt failed for 24 hours, so we switched it off.
"seller""failing"disabledAt*|date-timefailingSince*|When the current run of failures began; null after any success.
date-timepreviousSecretExpiresAt*|After a secret rotation, the old secret also signs until this time.
date-timecreatedAt*stringdate-timeupdatedAt*stringdate-timesecret*stringThe signing secret, whsec_…. Shown only now; store it to verify the webhook-signature header.
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" ]}'{ "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"}