# Webhook endpoints

> Create, update, test and rotate the endpoints NinjaBuy sends events to.

Source: https://www.ninjabuy.com/business/docs/api/webhooks-endpoints

The URLs we POST events to. The events, their payloads, signing and retries are on [Webhooks](https://www.ninjabuy.com/business/docs/webhooks.md).

> Create, test and delete endpoints through this API. Manage the remaining settings and resend deliveries on your Business account's [Webhooks page](https://www.ninjabuy.com/business/developers/webhooks) .

Endpoints

- POST /v1/webhook\_endpoints Create an endpoint
- GET /v1/webhook\_endpoints List endpoints
- GET /v1/webhook\_endpoints/{id} Retrieve an endpoint
- PATCH /v1/webhook\_endpoints/{id} Coming soon Update an endpoint
- DELETE /v1/webhook\_endpoints/{id} Delete an endpoint
- POST /v1/webhook\_endpoints/{id}/rotate\_secret Coming soon Rotate the secret
- POST /v1/webhook\_endpoints/{id}/test Send a test event
- GET /v1/webhook\_endpoints/{id}/deliveries Coming soon List deliveries
- POST /v1/webhook\_endpoints/{id}/deliveries/{delivery}/retry Coming soon Send a delivery again

## The Webhook endpoint object

- `id` string

  Starts we\_.

- `url` string

  An https URL of yours that answers 2xx.

- `description` string|null

  For you.

- `events[]` array

  The event types to send, or `*` for all, including types added later: order.created, order.paid, order.bought, order.held, order.cancelled, order.shipped, product.cost\_changed, product.repriced, product.out\_of\_stock, product.paused, product.resumed, product.removed.

- `status` string

  enabled, or disabled (by you, or by us after five days in which every delivery failed; we email you).

- `api_version` string

  The version event payloads are written in. There is one so far, 2026-11.

- `secret` string

  The signing secret. Only in the answers to create and rotate.

webhook\_endpoint

```json
{  "id": "we_3d8s",  "url": "https://acme-goods.com/hooks/ninjabuy",  "description": "Order sync",  "events": ["order.shipped", "product.out_of_stock", "product.paused"],  "status": "enabled",  "api_version": "2026-11",  "created_at": "2026-11-01T08:00:00Z"}
```

## Create an endpoint

POST /v1/webhook\_endpoints

Answers the signing secret once: store it now. Up to 16 endpoints per account.

Scope webhooks:write

### Body

- `url` string required

  https only.

- `events[]` array required

  Event types, or \["\*"].

- `description` string

  Optional.

### Errors

| Status | Type          | When                                               |
| ------ | ------------- | -------------------------------------------------- |
| 400    | bad-body      | The URL is not https, or an event type is unknown. |
| 409    | invalid-state | The account has 16 endpoints already.              |

```bash
curl -X POST "https://www.ninjabuy.com/api/v1/webhook_endpoints" \  -H "Authorization: Bearer " \  -H "NinjaBuy-Version: 2026-11" \  -H "Idempotency-Key: $(uuidgen)" \  -H "Content-Type: application/json" \  -d '{    "url": "https://acme-goods.com/hooks/ninjabuy",    "events": ["order.shipped", "product.out_of_stock", "product.paused"],    "description": "Order sync"  }'
```

Response · 201

```
HTTP/2 201 Created​{  "id": "we_3d8s",  "url": "https://acme-goods.com/hooks/ninjabuy",  "description": "Order sync",  "events": ["order.shipped", "product.out_of_stock", "product.paused"],  "status": "enabled",  "api_version": "2026-11",  "created_at": "2026-11-01T08:00:00Z",  "secret": "whsec_MfKQ9r8GKYqrTwjUPD8ILPZIo2LaLaSw"}
```

## List endpoints

GET /v1/webhook\_endpoints

Every endpoint on the account, without secrets.

Scope webhooks:write

```bash
curl "https://www.ninjabuy.com/api/v1/webhook_endpoints" \  -H "Authorization: Bearer " \  -H "NinjaBuy-Version: 2026-11"
```

Response · 200

```
HTTP/2 200 OK​{  "data": [    {      "id": "we_3d8s",      "url": "https://acme-goods.com/hooks/ninjabuy",      "description": "Order sync",      "events": [        "order.shipped",        "product.out_of_stock",        "product.paused"      ],      "status": "enabled",      "api_version": "2026-11",      "created_at": "2026-11-01T08:00:00Z"    }  ],  "has_more": false,  "cursor": null}
```

## Retrieve an endpoint

GET /v1/webhook\_endpoints/{id}

One endpoint, without its secret.

Scope webhooks:write

### Path parameters

- `id` string required

  The endpoint's id.

### Errors

| Status | Type      | When                              |
| ------ | --------- | --------------------------------- |
| 404    | not-found | No such endpoint on this account. |

```bash
curl "https://www.ninjabuy.com/api/v1/webhook_endpoints/we_3d8s" \  -H "Authorization: Bearer " \  -H "NinjaBuy-Version: 2026-11"
```

Response · 200

```
HTTP/2 200 OK​{  "id": "we_3d8s",  "url": "https://acme-goods.com/hooks/ninjabuy",  "description": "Order sync",  "events": ["order.shipped", "product.out_of_stock", "product.paused"],  "status": "enabled",  "api_version": "2026-11",  "created_at": "2026-11-01T08:00:00Z"}
```

## Update an endpoint

PATCH /v1/webhook\_endpoints/{id} Coming soon

Change its URL or events, or disable and enable it. Enabling sends what it missed in the last 3 days.

Scope webhooks:write

### Path parameters

- `id` string required

  The endpoint's id.

### Body

- `url` string

  https only.

- `events[]` array

  Event types, or \["\*"].

- `description` string

  Optional.

- `status` string

  Optional. enabled or disabled.

### Errors

| Status | Type      | When                              |
| ------ | --------- | --------------------------------- |
| 404    | not-found | No such endpoint on this account. |

```bash
curl -X PATCH "https://www.ninjabuy.com/api/v1/webhook_endpoints/we_3d8s" \  -H "Authorization: Bearer " \  -H "NinjaBuy-Version: 2026-11" \  -H "Content-Type: application/json" \  -d '{ "events": ["*"] }'
```

Response · 200

```
HTTP/2 200 OK​{  "id": "we_3d8s",  "url": "https://acme-goods.com/hooks/ninjabuy",  "description": "Order sync",  "events": ["*"],  "status": "enabled",  "api_version": "2026-11",  "created_at": "2026-11-01T08:00:00Z"}
```

## Delete an endpoint

DELETE /v1/webhook\_endpoints/{id}

Stops every delivery to it at once, retries included.

Scope webhooks:write

### Path parameters

- `id` string required

  The endpoint's id.

### Errors

| Status | Type      | When                              |
| ------ | --------- | --------------------------------- |
| 404    | not-found | No such endpoint on this account. |

```bash
curl -X DELETE "https://www.ninjabuy.com/api/v1/webhook_endpoints/we_3d8s" \  -H "Authorization: Bearer " \  -H "NinjaBuy-Version: 2026-11"
```

Response · 200

```
HTTP/2 200 OK​{ "id": "we_3d8s", "deleted": true }
```

## Rotate the secret

POST /v1/webhook\_endpoints/{id}/rotate\_secret Coming soon

Answers a new secret. For 24 hours we sign with both, so the webhook-signature header carries two signatures and either verifies: deploy the new one, then let the old one lapse.

Scope webhooks:write

### Path parameters

- `id` string required

  The endpoint's id.

### Errors

| Status | Type      | When                              |
| ------ | --------- | --------------------------------- |
| 404    | not-found | No such endpoint on this account. |

```bash
curl -X POST "https://www.ninjabuy.com/api/v1/webhook_endpoints/we_3d8s/rotate_secret" \  -H "Authorization: Bearer " \  -H "NinjaBuy-Version: 2026-11" \  -H "Idempotency-Key: $(uuidgen)"
```

Response · 200

```
HTTP/2 200 OK​{  "id": "we_3d8s",  "secret": "whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD",  "previous_expires_at": "2026-11-05T09:30:00Z"}
```

## Send a test event

POST /v1/webhook\_endpoints/{id}/test

Queues a sample of one event type, signed like any other, with test: true. The receiver confirms delivery when it arrives.

Scope webhooks:write

### Path parameters

- `id` string required

  The endpoint's id.

### Body

- `type` string required

  An event type.

### Errors

| Status | Type      | When                              |
| ------ | --------- | --------------------------------- |
| 404    | not-found | No such endpoint on this account. |

```bash
curl -X POST "https://www.ninjabuy.com/api/v1/webhook_endpoints/we_3d8s/test" \  -H "Authorization: Bearer " \  -H "NinjaBuy-Version: 2026-11" \  -H "Idempotency-Key: $(uuidgen)" \  -H "Content-Type: application/json" \  -d '{ "type": "order.shipped" }'
```

Response · 202

```
HTTP/2 202 Accepted​{ "delivery": "dlv_0k2p", "status": "pending" }
```

## List deliveries

GET /v1/webhook\_endpoints/{id}/deliveries Coming soon

Every attempt of the last 30 days, newest first: what we sent, how you answered and when we retry.

Scope webhooks:write

### Path parameters

- `id` string required

  The endpoint's id.

### Query parameters

- `status` string

  Optional. succeeded, retrying or failed.

- `event` string

  Optional. An event id.

- `limit, cursor`

  [Pagination](https://www.ninjabuy.com/business/docs/api.md#pagination)

### Errors

| Status | Type      | When                              |
| ------ | --------- | --------------------------------- |
| 404    | not-found | No such endpoint on this account. |

```bash
curl "https://www.ninjabuy.com/api/v1/webhook_endpoints/we_3d8s/deliveries?status=retrying" \  -H "Authorization: Bearer " \  -H "NinjaBuy-Version: 2026-11"
```

Response · 200

```
HTTP/2 200 OK​{  "data": [    {      "id": "dlv_0k3a",      "event": "evt_4m2x",      "type": "order.shipped",      "status": "retrying",      "attempts": 3,      "last_response_status": 502,      "next_attempt_at": "2026-11-03T08:35:00Z"    }  ],  "has_more": false,  "cursor": null}
```

## Send a delivery again

POST /v1/webhook\_endpoints/{id}/deliveries/{delivery}/retry Coming soon

Sends the event now, with the same webhook-id, whatever its state. Retries already scheduled go on.

Scope webhooks:write

### Path parameters

- `id` string required

  The endpoint's id.

- `delivery` string required

  A delivery id.

### Errors

| Status | Type      | When                              |
| ------ | --------- | --------------------------------- |
| 404    | not-found | No such endpoint on this account. |

```bash
curl -X POST "https://www.ninjabuy.com/api/v1/webhook_endpoints/we_3d8s/deliveries/dlv_0k3a/retry" \  -H "Authorization: Bearer " \  -H "NinjaBuy-Version: 2026-11" \  -H "Idempotency-Key: $(uuidgen)"
```

Response · 202

```
HTTP/2 202 Accepted​{  "delivery": "dlv_0k3a",  "status": "retrying",  "next_attempt_at": "2026-11-03T08:01:10Z"}
```

- The API is open on request. Our team sets up your Business account and issues its API keys.

  [Contact sales](https://www.ninjabuy.com/business#contact)
