Webhooks
Mantle currently provides a range of webhooks to deliver important notifications regarding activity within your app.
Event | Description |
---|---|
Plan created | Triggered when a new plan is generated. |
Plan updated | Triggered when an existing plan undergoes updates. |
Subscription activated | Triggered when a new subscription is initiated. |
Subscription cancelled | Triggered when a subscription is terminated. |
Subscription approaching capped amount | Triggered when the customer reaches 90% of their usage cap. Shopify sends an email to the merchant at this point to notify them. |
Subscription usage charge exceeds capped amount | Triggered when the charge for a subscription surpasses the amount merchants have previously agreed upon. |
Subscription capped amount updated | Triggered when the merchant updates the capped amount, through the Shopify Admin interface or the Mantle API. |
Invoice created | Triggered when an invoice is created. Mantle creates invoices to wrap pending charges during each subscription billing cycle. |
To subscribe to a webhook:
- Click on the app you’d like to use from Mantle’s left navigation.
- Navigate to Settings in the top right-hand corner.
- Select API keys.
- Click on Add webhook.
- Choose the webhook you’d like and enter the URL where you’d like to receive it.
The webhooks are signed using HMAC SHA256 in the X-Mantle-Hmac-SHA256 header
. The signing data consists of the X-Timestamp
header concatenated with the stringified JSON payload: timestamp.payload
.