Launch Cart support various type of webhooks. Webhooks can be used to get notification about new orders .
To register an webhook you need to call POST /api/v1/store/{store_id}/webhooks
endpoint with form params: callback
and hook
.
callback
is an url where Launch Cart will send POST notification
hook
is an event name
Supported hooks
Hook name | Description |
---|---|
order/created | Sent when order is successfully created |
product/create | Sent when product is created |
product/update | Sent when product is updated |
client/unauthorize | Sent when user disable app from Super Powers page. |
newsletter/subscribe | User subscribed to newsletter |
newsletter/mailchimp/subscribe | User subscribed to mailchimp-supported form |
newsletter/mailchimp/accounts |
When webhook is sent, request payload contains information about context (product, order, store).
Webhook can be removed using DELETE /api/v1/store/{store_id}/webhooks/{webhook_id}
Each webhook call is signed by hmac. You can find hmac signing hash in X-LaunchCart-Hmac-SHA256
header.
We are using this formula to create base64 encoded binary hash:
hmac = base64_encode(hash_hmac('sha256', content, client_secret, isBinary: true))
content
contains json payload of request.