Skip to main content
Webhooks let you receive real-time HTTP notifications when subscription events happen in your Appstle account. Instead of polling the API, you register an endpoint URL and Appstle sends an HTTP POST request to it whenever an event occurs. Appstle signs every webhook request, retries failed deliveries automatically, and keeps a delivery log you can replay from the webhook portal.
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 in data: subscription.created, subscription.updated, subscription.activated, subscription.paused, subscription.cancelled, subscription.next-order-date-changed, subscription.billing-interval-changed
Fields with no value arrive as 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

When billing attempt events fire

  • subscription.billing-failure fires after every failed try. A retry works on the same billing attempt, so id stays the same, attemptCount goes up and billingAttemptId changes to the new Shopify attempt. retryingNeeded: true means 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: false means Appstle won’t try this attempt again. Out-of-stock failures (INSUFFICIENT_INVENTORY and INVENTORY_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 sends subscription.paused, or skips the order and sends subscription.billing-skipped. When it skips the order, that try’s billing-failure event carries status: SKIPPED_DUNNING_MGMT instead of FAILURE.
  • subscription.upcoming-order-notification fires 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 before billingDate. It fires once for each attempt and billing date. If the order is rescheduled, it can fire again for the new billingDate, so key your own reminders on contractId and billingDate. 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 with status=SECURITY_CHALLENGE. On the storefront, with the customer signed in, read status from 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:
  1. Use the raw request body exactly as you received it, before any JSON parsing.
  2. Build the signed content from the webhook-id header, a period, the webhook-timestamp header, a period and the raw body: <webhook-id>.<webhook-timestamp>.<raw body>.
  3. Take your signing secret, remove its whsec_ prefix and base64-decode the rest. That is the key.
  4. Compute the HMAC-SHA256 of the signed content with that key and base64-encode the result.
  5. The webhook-signature header holds one or more space-separated entries in the form v1,<signature>. Accept the request if any entry matches your computed value. Use a constant-time comparison.
  6. Reject the request if webhook-timestamp is more than five minutes from your server’s clock.
Node.js
Pass the raw request body to the verification function, before JSON parsing. Parsing the body and serializing it again can change its bytes (for example 15.0 becomes 15), and a correct signature then fails to verify. In Express, use express.raw() on the webhook route, and register that route before any app-wide express.json(), which would otherwise parse the body first.

Testing webhooks

Send a test event

The Send Example button on an endpoint’s Testing tab is disabled for every subscription.* 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:
  1. Go to More → Webhook Integration in your Appstle dashboard and click Launch webhook portal.
  2. Add your endpoint, or open the one you already added.
  3. 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.
  4. 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.
Pausing sends 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.
Test on a development store, or on a subscription whose customer is you. A real change goes to every endpoint and integration subscribed to the event, and it can send the customer the store’s pause or resume email.

Local development

Use ngrok or localtunnel to expose your local server:
Then add the public URL it prints, plus your route path (for example 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 a 2xx 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

Log the raw webhook payload during development so you can inspect the exact data structure. Test with a simple endpoint that just logs and returns 200 OK before adding business logic.
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.