← Back to website
02
Documentation / Shopify events

Webhooks

How order and refund events enter Diesel, become durable jobs, and reach the correct tenant instance.

Updated July 20265 min read

What webhooks do

Checkout exchange is only the first half of the workflow. Diesel uses Shopify webhooks to learn what ultimately happened to the order, then moves the corresponding operation into the shared queue.

Webhook handlers acknowledge valid requests quickly. Slow work is performed asynchronously so a temporary dependency issue does not cause Shopify to repeatedly deliver the same event while it is being processed.

Required topics

  1. 01

    Order creation

    Queues completion, finalises the exchange, and marks the Shopify order with the diesel tag.

  2. 02

    Refund creation

    Queues restoration of the refunded amount to the original stored-value card.

Authentication and isolation

Each tenant instance has its own server configuration and tenant identifier.

Duplicate and out-of-order delivery

Webhook delivery is not assumed to be exactly once. A repeated order or refund event must resolve to the same logical operation rather than moving value twice.

Queue consumers also re-check current state before taking financial action. This is especially important when completion and abort become runnable close together: the current completed state takes precedence over the order in which jobs happen to arrive.