What data can I send in the delivery webhook payload?
When you check Customize this event payload on a webhook delivery, you write the JSON that Clickmax sends and fill in values with variables in the {{variable}} format. This page lists every variable and how to build lists with @each.
Workspace role: Owner, Administrator, Editor or Collaborator.
How values are filled in
Money values are always in cents: 59700 is R$ 597.00.
When the webhook fires
The webhook fires once for each offer in the order that has this delivery: the main offer and each order bump. In these deliveries, offerId is the offer that fired that delivery, while items and orderBumps always carry the whole order.
Variables
General
Buyer
Transaction
These are null on the subscription canceled event, which has no transaction.
Order items
items is the list with the main offer first, then each order bump. Use it inside an @each block (see below).
orderBumps is still available with only the order bumps, through item.offerId, item.offerName, item.productId, item.productName and item.value.
Subscription
Filled on the subscription canceled event.
Tracking / UTM
Building a list with @each
An array with a single object that has the "@each" key becomes a list with one entry per element. Inside the block, use {{item.field}}. The @each block must be the only element of the array, and one @each cannot be nested inside another.
Example payload in another platform's format, with every item of the order:
In a sale with one order bump, trans_items comes out with two objects: the main offer and the bump.