Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.sellfern.com/llms.txt

Use this file to discover all available pages before exploring further.

The Webhooks API lets you programmatically register and manage the HTTPS endpoints that Sellfern sends event notifications to. All operations require a token with the webhooks:manage scope.
For a conceptual overview of webhooks, event types, payload structures, and signature verification, see the Webhooks integration guide.

POST /api/v2/webhooks

Create a new webhook endpoint for your organization. Required scope: webhooks:manage
url
string
required
The HTTPS URL Sellfern will POST event payloads to. Must be publicly reachable.
events
array
required
Array of event names to subscribe to. Subscribe to one or more from: order.created, order.updated, order.status_changed, order.fulfillment.shipped, order.fulfillment.delivered, expense.created, ticket.created, ticket.updated.
curl -X POST "https://api.sellfern.com/api/v2/webhooks" \
  -H "Authorization: Bearer sk_live_YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/webhooks/sellfern",
    "events": ["order.created", "order.status_changed"]
  }'
Response (201 Created)
{
  "success": true,
  "data": {
    "id": "wh_abc123",
    "url": "https://example.com/webhooks/sellfern",
    "events": ["order.created", "order.status_changed"],
    "secret": "whsec_...",
    "enabled": true,
    "created_at": "2026-05-22T10:00:00Z"
  }
}
The secret field is only returned once at creation time. Store it securely — you will need it to verify incoming webhook signatures.

GET /api/v2/webhooks

List all registered webhook endpoints for your organization. Required scope: webhooks:manage
curl -X GET "https://api.sellfern.com/api/v2/webhooks" \
  -H "Authorization: Bearer sk_live_YOUR_TOKEN"
Response (200 OK)
{
  "success": true,
  "data": [
    {
      "id": "wh_abc123",
      "url": "https://example.com/webhooks/sellfern",
      "events": ["order.created", "order.status_changed"],
      "enabled": true,
      "created_at": "2026-05-22T10:00:00Z"
    }
  ]
}

PATCH /api/v2/webhooks/:id

Update the URL, events, or enabled state of an existing webhook endpoint. Required scope: webhooks:manage
id
string
required
The webhook endpoint ID returned when you created the endpoint.
url
string
New destination URL.
events
array
Replacement events array. This replaces the entire subscribed events list.
enabled
boolean
Set to false to pause delivery without deleting the endpoint.
curl -X PATCH "https://api.sellfern.com/api/v2/webhooks/wh_abc123" \
  -H "Authorization: Bearer sk_live_YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"events": ["order.status_changed", "order.fulfillment.shipped"]}'

DELETE /api/v2/webhooks/:id

Delete a webhook endpoint. Deliveries to this endpoint will stop immediately. Required scope: webhooks:manage
id
string
required
The webhook endpoint ID to delete.
curl -X DELETE "https://api.sellfern.com/api/v2/webhooks/wh_abc123?confirm=wh_abc123" \
  -H "Authorization: Bearer sk_live_YOUR_TOKEN"

POST /api/v2/webhooks/:id/test

Send a test event to the endpoint to verify it is reachable and your handler is working correctly. Required scope: webhooks:manage
curl -X POST "https://api.sellfern.com/api/v2/webhooks/wh_abc123/test" \
  -H "Authorization: Bearer sk_live_YOUR_TOKEN"

GET /api/v2/webhooks/:id/deliveries

Retrieve recent delivery attempts for a webhook endpoint, including HTTP response codes and any error details. Required scope: webhooks:manage
curl -X GET "https://api.sellfern.com/api/v2/webhooks/wh_abc123/deliveries" \
  -H "Authorization: Bearer sk_live_YOUR_TOKEN"

Error responses

StatusCodeDescription
401Token is invalid or revoked
403missing_scopeToken does not have webhooks:manage scope
404Webhook endpoint ID not found
400Validation error (invalid URL, unknown event name)