Skip to content

E-commerce Webhooks

SmartCut can send webhook notifications to your server when e-commerce events occur. Configure your webhook endpoint URL and the events you want to receive in your organisation settings.

Delivery

Webhooks are sent as POST requests with a JSON body. Each request includes the following headers:

HeaderDescription
Content-Typeapplication/json
X-SmartCut-TimestampUnix timestamp (ms) of the delivery attempt
X-SmartCut-DeliveryUnique delivery ID (UUID)

Failed deliveries (5xx or network errors) are retried up to 3 times with delays of 1s, 5s, and 30s. Client errors (4xx) are not retried.

Events

EventDescription
order.createdA new order has been placed
order.status_changedThe order status has been updated
order.payment_completedPayment has been received
inventory.decrementedStock quantities have been reduced after an order

Order Webhook

Sent for order.created, order.status_changed, and order.payment_completed events.

Payload

json
{
  "event": "order.created",
  "orderId": "abc123",
  "organisationId": "org456",
  "timestamp": "2026-03-06T12:00:00.000Z",
  "data": {
    "status": "pending",
    "previousStatus": "draft",
    "paymentStatus": "paid",
    "customer": {
      "name": "Jane Smith",
      "email": "[email protected]",
      "phone": "+44 7700 900000"
    },
    "pricing": {
      "total": 149.99,
      "currency": "GBP",
      "itemsSubtotal": 129.99,
      "shippingCost": 20.00
    },
    "shipping": {
      "method": "standard",
      "address": {
        "line1": "123 High Street",
        "city": "London",
        "postalCode": "SW1A 1AA",
        "country": "GB"
      }
    },
    "itemCount": 3,
    "partsCount": 24,
    "createdAt": "2026-03-06T11:55:00.000Z",
    "results": [
      {
        "jobId": 12345,
        "saw": {},
        "stock": [],
        "parts": [],
        "cuts": [],
        "offcuts": [],
        "unusableParts": [],
        "metadata": {}
      }
    ]
  }
}

Fields

Top-level

FieldTypeDescription
eventstringOne of order.created, order.status_changed, order.payment_completed
orderIdstringUnique order identifier
organisationIdstringYour organisation ID
timestampstringISO 8601 timestamp of when the webhook was sent

data

FieldTypeRequiredDescription
statusstringYesCurrent order status
previousStatusstringNoPrevious status (present on order.status_changed)
paymentStatusstringNoPayment status
itemCountnumberYesNumber of line items in the order
partsCountnumberYesTotal number of individual parts
createdAtstringYesISO 8601 timestamp of order creation
resultsarrayNoOptimisation results for each job in the order, in V3 API response format

data.results[]

Each entry is a full V3 API response containing the optimisation result for one job in the order. See the V3 API documentation for the complete response schema.

FieldTypeDescription
jobIdnumberJob identifier
sawobjectSaw configuration used
stockarrayStock items
partsarrayParts with coordinates and properties
cutsarrayCut instructions
offcutsarrayRemaining offcut pieces
unusablePartsarrayParts that could not be placed
metadataobjectComplete analysis and metrics (efficiency, waste, costs, material summary)

data.customer

FieldTypeRequiredDescription
namestringYesCustomer full name
emailstringYesCustomer email address
phonestringNoCustomer phone number

data.pricing

FieldTypeRequiredDescription
totalnumberYesOrder total
currencystringYesISO 4217 currency code
itemsSubtotalnumberNoSubtotal before shipping
shippingCostnumberNoShipping cost

data.shipping

Optional. Present when shipping details are available.

FieldTypeRequiredDescription
methodstringNoShipping method name
address.line1stringYesStreet address
address.citystringYesCity
address.postalCodestringYesPostal/ZIP code
address.countrystringYesISO 3166-1 alpha-2 country code

Inventory Webhook

Sent when stock quantities are decremented after an order is processed.

Payload

json
{
  "event": "inventory.decremented",
  "orderId": "abc123",
  "organisationId": "org456",
  "timestamp": "2026-03-06T12:01:00.000Z",
  "data": {
    "changes": [
      {
        "stockId": "stock789",
        "stockName": "18mm White Melamine",
        "material": "Melamine",
        "thickness": 18,
        "dimensions": {
          "length": 2440,
          "width": 1220
        },
        "previousQuantity": 50,
        "newQuantity": 47,
        "decrementedBy": 3,
        "deleted": false
      }
    ]
  }
}

data.changes[]

FieldTypeRequiredDescription
stockIdstringYesStock item ID
stockNamestringNoHuman-readable stock name
materialstringNoMaterial type
thicknessnumberNoMaterial thickness
dimensions.lengthnumberNoStock length
dimensions.widthnumberNoStock width
previousQuantitynumberYesQuantity before decrement
newQuantitynumberYesQuantity after decrement
decrementedBynumberYesNumber of units consumed
deletedbooleanNoWhether the stock item was fully consumed

Testing

Use the test endpoint to verify your webhook URL is reachable. A test webhook sends a simple payload:

json
{
  "event": "test",
  "timestamp": "2026-03-06T12:00:00.000Z",
  "message": "This is a test webhook from SmartCut"
}