Skip to main content

Webhooks

With a webhook, we send an event to your own system each time something happens on a return or a claim.

Written by August Lykke Amstrup

A webhook is set up under Settings → Integrations → Webhook. It applies to one shop.

With a webhook, we send an event to your own system each time something happens on a return or a claim. Your system can be an ERP, a CRM, Make, Zapier or an endpoint of your own. It needs an HTTPS address that accepts POST requests with a JSON body.

Add a webhook

  1. Select Install on Webhook.

  2. Enter the address of your system as Webhook URL.

  3. Enter a Secret Key.

  4. Choose the events you want under Events to Notify.

  5. If you want, set Retry limit and Retry delay, or add custom headers on the Advanced Settings tab.

  6. Save the webhook.

We sign every event with HMAC SHA256 and your secret key. The signature is in the header X-Webhook-Signature, as hex over the raw payload.

Your system has to answer with a 2xx status. If it doesn't, then we send the event again, up to the retry limit.

Events

Choose the events your system needs. The name is the value of event in the payload. Copy it as written, as return.canceled has one l and claim.cancelled has two.

We send these events on a return.

Event

When it is sent

return.created

Your customer starts a return

return.completed

The return is created, the emails are sent and the label is generated

return.label_generated

A label is generated for the return

return.edited

The return is edited, on its lines or its exchange items

return.paused

You pause the return for review

return.resumed

You resume a paused return

return.reset

The return is reset to its initial state

return.canceled

The return is cancelled

return.instant_exchange

The return package is set to in transit, and Instant Exchange is on

return.exchange_released

The hold on the exchange item is released

return.exchange_fulfilled

The exchange item is fulfilled in Shopify

return.auto_close_initiated

Auto Close is scheduled for the return

return.auto_close_cancelled

A scheduled Auto Close is cancelled

return.auto_close_completed

Auto Close has closed the return

return.closed

The return is closed and every return action is carried out

return.giftcard_code_sent

The gift card code is sent to your customer

We send these events on a claim.

Event

When it is sent

claim.created

Your customer starts a claim

claim.processed

Your customer has completed the claim, and it is ready for your review

claim.reviewed

You have reviewed the claim

claim.label_generated

A label is generated for the claim

claim.replacement_released

The hold on the replacement is released

claim.giftcard_code_sent

The gift card code is sent to your customer

claim.closed

The claim is closed and every resolution is carried out

claim.cancelled

You cancel the claim

We send these events on the return package of a return or a claim.

Event

When it is sent

shipment.event.in_transit

A tracking event shows that the return package is in transit

shipment.event.delivered

A tracking event shows that the return package is delivered

The two shipment events depend on tracking events from the carrier. Learn more in Tracking.

Payloads

The payload is the JSON body of the request we send. Every payload has these fields.

Field

What it holds

event

The name of the event

timestamp

When the event happened, as an ISO 8601 date and time

store

The myshopify domain of your shop

data

The details of the return or the claim

data holds the core details, not the full return or claim. A test event has test set to true in data.

The return reason is only in return.completed, as returnReasonId and returnReasonNote on each returned line. GET /return-reasons in the API gives the text of each id.

Every return event carries returnOrderId and shopifyOrderId, with these exceptions. return.created and return.giftcard_code_sent carry neither, only the order name. return.paused and return.resumed carry returnOrderId without shopifyOrderId.

The claim events carry the claim id as id. claim.cancelled carries it as claimId, and claim.label_generated as claimOrderId. claim.giftcard_code_sent carries the order name only.

The two shipment events carry entityType, which is RETURN or CLAIM, and entityId, which is the id of that return or claim.

return.closed carries who closed the return, the return actions, and each line with its SKU, its barcode and its quantity. The two gift card events carry the gift card code itself.

If you need more than the payload holds, then fetch the full return from the API with returnOrderId. Learn more in Custom Integrations and API.

The fields of every payload are listed as schemas at the bottom of the API docs.

Logs and retries

Select View Logs on the Webhook integration to see every event we sent and how your system answered. You can send a single event again from the log. The log keeps events for about 30 days.

Good to know

  • If you have more than one shop, then add a webhook in each.

  • Slack, Shopify Flow, Klaviyo and Drip receive events as well, and work alongside a webhook.

Did this answer your question?