Toki.

Docs/Merchants/Integrations & API

Webhook logs

Webhooks let Toki tell another system when something happens in your loyalty program, such as a member earning a tier. The Webhooks Logs pages show every subscription on your store, every delivery Toki sent, and the exact response the receiving system gave. When a connected tool stops receiving events, this is where you look first.

These pages are for monitoring. Subscriptions are created and managed through the Toki API. For what webhooks are and how to set one up, see Webhooks.

Open the webhook logs

  1. Open Integrations.
  2. In the Toki API Key card, click Webhooks Logs.

You land on the Webhook Subscriptions page. From there you drill down in three levels: subscriptions, then the deliveries of one subscription, then the response logs of one delivery.

Subscriptions

The Webhook Subscriptions page lists every active subscription on your store, newest first.

ColumnWhat it shows
TopicThe event the subscription listens for, for example TIER_EARNED.
EndpointThe web address Toki sends the event to.
CreatedWhen the subscription was created.
  • Use Search subscriptions to narrow the list. Type part of the topic as it appears in the Topic column, for example TIER.
  • Click a row to open that subscription's deliveries.
  • The list shows 20 subscriptions per page. Use the arrows below the table to move between pages.

If your store has no subscriptions yet, the page reads "No webhook subscriptions found" and "Webhook subscriptions will appear here when they are created."

Deliveries

Click a subscription to open its deliveries page. The page title is Webhooks: followed by the topic, and the endpoint appears under it. Each row is one event Toki delivered, or is delivering, to that endpoint. Deliveries are listed newest first, 20 per page.

ColumnWhat it shows
IDThe unique ID of the delivery.
StatusSent or Pending (see below).
CreatedWhen the event happened.
PayloadThe first 50 characters of the data Toki sent, with a copy button next to it.

Delivery status

StatusColorMeaning
SentGreenYour endpoint accepted the delivery with a success response.
PendingYellowYour endpoint has not accepted the delivery yet. Either Toki has not sent it yet, or no attempt so far was accepted.

A delivery stays Pending until your endpoint accepts it. To see what happened on each attempt, open the delivery's logs.

Find a delivery

Search webhooks finds deliveries two ways. Paste a delivery's full ID to jump straight to it. Or type text exactly as it appears in the delivered data, such as a customer email or an order number, to list every delivery that contains it.

Copy a payload

The Payload column shows a short preview. To get the full data Toki sent, click the copy button next to the preview. The full payload is copied to your clipboard, and the row stays closed so you can keep scanning the list. Paste it into your own system, or share it with whoever maintains the endpoint, to see exactly what the endpoint received.

Click anywhere else on the row to open the delivery's logs.

Response logs

Click a delivery to open its logs. The page title is Webhook Logs: followed by the delivery ID, and the topic appears under it. Each row is one attempt to deliver that event to your endpoint, newest first, 20 per page.

When an endpoint does not accept a delivery, Toki tries again several times over the following hours. That is why one delivery can have several log entries: one for each attempt.

ColumnWhat it shows
IDThe unique ID of this attempt.
Status CodeThe status code your endpoint returned for this attempt.
CreatedWhen the attempt was made.
Response BodyThe text your endpoint sent back. Shows - when there was none.

Reading the status code

  • Green means your endpoint answered with a success code (200 to 299). This is the attempt that moved the delivery to Sent.
  • Red means your endpoint answered, but with a code outside the success range. The Response Body often explains why, for example a message from your server about a rejected request.
  • N/A (also red) means Toki did not get a response at all. The endpoint could not be reached, or the connection failed before a response arrived.

Use Search logs to find one attempt by pasting its ID.

Find out why an endpoint is not receiving events

  1. Open Integrations, then click Webhooks Logs in the Toki API Key card.
  2. Check that a subscription with the topic you expect exists, and that its Endpoint is the address your system listens on.
  3. Click the subscription. If the deliveries page is empty, Toki has not recorded an event for that subscription yet.
  4. Look at the Status column. Sent deliveries were accepted by your endpoint, so the event arrived. For a Pending delivery, click the row.
  5. On the logs page, read the Status Code and Response Body of the latest attempt. A red code or N/A tells you how your endpoint answered, or that it could not be reached.
  6. Go back to the deliveries page and use the copy button in the Payload column to grab the full payload. Whoever maintains your endpoint can use it to reproduce the request.

If your endpoint starts accepting deliveries while Toki is still retrying one, that delivery turns Sent on the next successful attempt. Each new event gets its own delivery and its own attempts.

Related

Didn't find what you need? Chat with us — a human answers, usually within the hour.