Set up webhooks

A webhook lets another system know straight away when something happens at your shop,
such as a new order or a payment. You add the web address of that system in the Manager
app, and Loving Loyalty sends the details there each time.

You only need this if you use another system that should get your shop's data, for
example your own bookkeeping or stock system. If you are not sure, you do not need it.

Before you start

  • Ask whoever runs the other system for the web address to use. It starts with https://.
  • You need to be a manager of the shop in the Manager app.

1. Open Webhooks

In the sidebar, open Shop, then Integrations and Webhooks. If none are set up
yet, the page says No webhook endpoints configured.

The Webhooks page with no endpoints configured

2. Add the web address

Select Add endpoint and paste the address into Endpoint URL.

The add endpoint form, with its event list

Under Events, switch on only what the other system needs and leave the rest off. You
need at least one. Each group has one event for something new and one for a change:

Group Sent when
Orders An order is placed or changes, for example its status
Payments A payment is taken or changes, for example it is settled
Refunds A refund is made or changes
Accounts A customer joins your loyalty program, or their points or tier change
Campaigns A campaign is created or changes
Bookings A booking is made or changes

Select Save.

3. Copy the signing secret

After saving, a Signing secret is shown. It is shown only this once.

  1. Select Copy.
  2. Send it to whoever runs the other system. They use it to check that the messages really come from us.
  3. Select I've saved it — dismiss.

Keep the secret private, like a password.

Pause, change or remove a webhook

On the Webhooks list, each web address has:

  • A switch to pause it. While it is off, nothing is sent, and what happens in that time is not sent later.
  • Delivery log, to see what was sent.
  • Edit, to change the address or the events.
  • Delete, to remove it.

If the secret is lost, or someone who should not have it has seen it, open the webhook with
Edit and select Rotate secret. You get a new secret and the old one stops working
straight away, so send the new one to the other system at once.

Check that it works

Select Delivery log on a webhook. Each row is one message, newest first.

  • Delivered means the other system received it.
  • Pending means we are still trying to send it.
  • Failed means we tried five times over about an hour and the other system did not accept it. It will not be sent again.

Select a row to see what the other system answered. If you see Failed, send that answer
to whoever runs the other system.

What to tell the person who runs the other system

Send them this list together with the signing secret:

  • Each message is an HTTPS POST with a JSON body holding eventType and data.
  • Each message is signed with HMAC-SHA256 in the webhook-signature header, using the signing secret. Check it before using the message.
  • Answer within 10 seconds with a 2xx code. Otherwise the message is sent again, up to five tries over about an hour.
  • The same message can arrive twice, so handling it twice must do no harm.
  • For the full technical details, they can contact Loving Loyalty support.

If something goes wrong

What you see What to do
Use an https:// address The address starts with http://. Ask for the https:// one
Use a public address, not one inside your own network The address only works inside your own network. Ask for one that works from the internet
Select at least one event type Switch on at least one event
Nothing arrives at the other system Check that the switch is on and the right events are ticked, then open Delivery log
Failed in the delivery log Send the answer shown in the row to whoever runs the other system
The other system says the messages are not signed correctly It may have an old secret. Use Rotate secret and send them the new one