Webhooks are included in the Enterprise and Enterprise Plus plans. To use them on another plan, contact support@appstle.com.
Getting started
1
Configure your endpoint
Log in to your Appstle dashboard, go to More → Webhook Integration, click Enable Webhook, then click Launch webhook portal. In the webhook portal, add your webhook endpoint URL and select which events you want to receive.
2
Return 2xx quickly
Your endpoint must return a
2xx status code (e.g. 200 OK) to acknowledge receipt. Process the event asynchronously in a background job — slow responses will time out and trigger retries.3
Verify signatures
Every webhook request carries signature headers. Always verify the signature before processing to ensure the request is authentic. See Signature verification below.
Event types
Payload structure
All webhooks use this envelope:Subscription contract payloads
The following events carry a full subscription contract indata:
subscription.created, subscription.updated, subscription.activated, subscription.paused, subscription.cancelled, subscription.next-order-date-changed, subscription.billing-interval-changed
Subscription contract payload example
Subscription contract payload example
null; they’re never left out. Every object in data, data included, also has a __typename field with its Shopify GraphQL type, such as SubscriptionContract or MoneyV2. Where an object can be one of several types, such as customerPaymentMethod.instrument, deliveryMethod or a discount’s value, __typename tells you which one you have. The example shows __typename only there. It also leaves out some nested fields, such as the card’s billingAddress.
Lists hold only their first items: up to 50 lines by default, 25 discounts and 20 originOrder.fulfillmentOrders. Each of these three has a pageInfo object, and pageInfo.hasNextPage is true when there are more. billingAttempts holds only the latest attempt and has no pageInfo.
Subscription contract fields
Billing attempt payloads
The following events carry billing attempt data:subscription.billing-success, subscription.billing-failure, subscription.billing-skipped, subscription.upcoming-order-notification
- billing-success
- billing-failure
- billing-skipped
- upcoming-order-notification
When billing attempt events fire
subscription.billing-failurefires after every failed try. A retry works on the same billing attempt, soidstays the same,attemptCountgoes up andbillingAttemptIdchanges to the new Shopify attempt.retryingNeeded: truemeans Appstle has scheduled another try. Appstle can still drop that try without another event, for example when the subscription is paused or cancelled before it runs.retryingNeeded: falsemeans Appstle won’t try this attempt again. Out-of-stock failures (INSUFFICIENT_INVENTORYandINVENTORY_ALLOCATIONS_NOT_FOUND) are sent as this event too.- On the last failed try, Appstle also applies the store’s failed-payment action. It cancels the subscription and sends
subscription.cancelled, pauses it and sendssubscription.paused, or skips the order and sendssubscription.billing-skipped. When it skips the order, that try’s billing-failure event carriesstatus: SKIPPED_DUNNING_MGMTinstead ofFAILURE. subscription.upcoming-order-notificationfires when a queued billing attempt comes inside the upcoming-order notice period. The period is the contract’s own setting if it has one, otherwise the store’s upcoming-order email setting, otherwise 1 day, and never more than 30 days beforebillingDate. It fires once for each attempt and billing date. If the order is rescheduled, it can fire again for the newbillingDate, so key your own reminders oncontractIdandbillingDate. The event fires even when the store has turned the upcoming-order email off, so don’t read it as “an email was sent”. It doesn’t fire for a contract that isn’t active or one where upcoming-order emails are stopped.- 3D Secure and other payment challenges send no event. When Shopify reports that the customer must confirm the payment with their bank, the billing attempt moves to
SECURITY_CHALLENGE. From your server, find these attempts with the Admin API: call Get past orders report withstatus=SECURITY_CHALLENGE. On the storefront, with the customer signed in, readstatusfrom Get past orders and send the customer to the challenge with Get URL for 3DS / SCA security challenge.
Billing attempt fields
The
subscription.upcoming-order-notification event adds these contract fields to the billing attempt fields:
Signature verification
Appstle signs every webhook request. Verify the signature before you process the payload, so you know the request came from Appstle and wasn’t changed in transit. Each request carries three headers:
Find your webhook signing secret in the webhook portal: go to More → Webhook Integration, click Launch webhook portal, and open your endpoint.
To verify a request:
- Use the raw request body exactly as you received it, before any JSON parsing.
- Build the signed content from the
webhook-idheader, a period, thewebhook-timestampheader, a period and the raw body:<webhook-id>.<webhook-timestamp>.<raw body>. - Take your signing secret, remove its
whsec_prefix and base64-decode the rest. That is the key. - Compute the HMAC-SHA256 of the signed content with that key and base64-encode the result.
- The
webhook-signatureheader holds one or more space-separated entries in the formv1,<signature>. Accept the request if any entry matches your computed value. Use a constant-time comparison. - Reject the request if
webhook-timestampis more than five minutes from your server’s clock.
Node.js
Testing webhooks
Send a test event
The Send Example button on an endpoint’s Testing tab is disabled for everysubscription.* event type: the portal shows “There’s no schema defined for this event type.” and sends nothing. To test your endpoint, trigger a real event on a test subscription instead:
- Go to More → Webhook Integration in your Appstle dashboard and click Launch webhook portal.
- Add your endpoint, or open the one you already added.
- Pause a test subscription, then activate it again. You can do this in the Appstle dashboard or with Update subscription contract status. Wait until the pause’s events appear in the portal before you activate it.
- Open Logs in the portal, or open your endpoint and look at Message Attempts. Each event appears as a message with its event type and the response your endpoint gave. Verify that your endpoint received the request and returned
2xx.
subscription.paused and subscription.updated, and activating sends subscription.activated and subscription.updated. A real event is signed and delivered like any other, so it also tests your signature check and, if your endpoint fails, the retries.
Local development
Use ngrok or localtunnel to expose your local server:https://abc123.ngrok.io/webhooks/appstle), as an endpoint in the webhook portal.
Retries
Appstle counts a delivery as successful only when your endpoint returns a2xx status code. Any other status code counts as a failed attempt, and so does a response that doesn’t arrive in time. A redirect such as 302 also fails, so register the final URL as your endpoint.
Appstle makes up to 8 attempts to deliver each message, and stops at the first one that succeeds:
The delays are approximate: an attempt can arrive earlier or later than the table shows. The last attempt goes out about 27 hours and 35 minutes after the first. If it fails too, Appstle stops retrying the message, and you can still replay it from the webhook portal.
Every attempt carries the same
webhook-id and a new webhook-timestamp, so a duplicate check on webhook-id catches retries. Record an ID only after you’ve processed its event. If you record it first and processing fails, your check skips the next attempt and the event is lost.
In the webhook portal (More → Webhook Integration → Launch webhook portal), open Logs and select a message to see each attempt, its response and, while retries remain, the time of the next attempt. To resend that message now, click the icon in the Replay column. After an outage, open your endpoint, choose Replay → Recover failed messages, pick how far back to look (up to 2 weeks) and click Recover to resend every message that failed to that endpoint since then. The portal keeps message payloads for 30 days, so replay a message within 30 days of when it was sent.
Webhooks are the fast path, not a guarantee: if your endpoint stays down past the last attempt, you miss the event until you replay it. If a flow must never miss a new subscription or a status change, also reconcile from your server on a schedule, such as every hour. Call Retrieve subscription contracts with fromCreatedDate to find new subscriptions, and again with fromUpdatedDate to find contracts that changed. Compare each contract’s status with the one you stored, ignoring case: the list returns cancelled where webhook payloads have CANCELLED.
Set both filters to a few minutes before your last successful check started, so a change saved while it ran isn’t missed. The windows overlap, so some contracts come back again: match them by subscriptionContractId. Send the time in UTC with whole seconds, such as 2026-11-08T00:00:00Z. A time with milliseconds, like the one JavaScript’s toISOString() returns, gets 400, and so does an offset whose + isn’t encoded as %2B. Page through the results with page and size. Each page is a call and counts toward the rate limits.
Troubleshooting
Need help? Email support@appstle.com with your endpoint URL and the
webhook-id of any failing message. If your endpoint never received the message, send its Message ID from the webhook portal instead.
Next steps
Admin API integration guide
Manage subscriptions, products, discounts and shipping from your server.
Shopify Flow
Automate subscription workflows with Flow triggers and actions, without API tokens.
Authentication
Create API keys, send the
X-API-Key header and stay within the rate limits.API changelog
Dated changes to the Subscriptions APIs, Flow, JavaScript events and metafields, with what to do about each.