Any questions

We are happy to help!

Question about Gecko Booking?

If you are unsure whether Gecko Booking is right for you, or if you have other questions, we would love to hear from you!

All good!
Please enter your name.
All good!
Please enter your email.
All good!
All good!
Please enter your question.

Fields marked with an * are required


Guides

Trin for trin-vejledninger til opsætning og brug af systemet.

Guides - Online paid/cancelled orders with customer attached

Online paid/cancelled orders with customer attached

This webhook can be used to send data when an online order with an attached customer is paid or cancelled.

The webhook runs when:

  • an online order is paid at the payment gateway
  • an online booking is deleted and the payment is automatically refunded (the order is cancelled)
  • an online order is changed in the backend, so that it is marked as paid, or set to or from cancelled

The webhook is added to a queue that is processed every 5 minutes. It can therefore take up to about 5 minutes before the webhook is sent.

Example of JSON that can be sent:


		{
"orderId": [orderId],
"orderDateTime": "[orderDateTime]",
"orderStatusId": [orderStatusId],
"orderStatusName": "[orderStatusName]",
"orderPaid": [orderPaidShow_begin]true[orderPaidShow_end][noorderPaidShow_begin]false[noorderPaidShow_end],
"orderTotalAmount": "[orderTotalAmountRaw]",
"orderPgwTransact": "[pgwTransact]",
"orderLines": [
[each_orderLine_begin]
{
"itemNo": "[itemNo]",
"itemName": "[itemName]",
"itemCount": "[itemCount]",
"orderLineTotal": "[orderLineTotal]"
},
[each_orderLine_end]
{}
],
"customerId": [customerId],
"customerName": "[customerName]",
"customerEmail": "[customerEmail]"
}

The webhook only runs for orders with an attached customer. Orders without a customer, for example gift card purchases in the minishop, do not trigger this webhook. Changes made through the API do not trigger webhooks either.


The following replacement codes are specific to this webhook and can be used in addition to those in the example:

  • [orderStatusId] is replaced with the order's status (1 = not archived, 3 = cancelled).
  • [orderStatusName] is replaced with the name of the order's status.
  • [orderPaidShow_begin] [orderPaidShow_end] keeps the text in between if the order is marked as paid, otherwise it is removed. [noorderPaidShow_begin] [noorderPaidShow_end] does the opposite. The combination in the example gives true or false.
  • [each_orderLine_begin] [each_orderLine_end] is repeated for each order line on the order. The lines are joined without a separator, so each line must end with a comma itself, and an empty {} at the end keeps the JSON valid. The following replacement codes can be used in between:
    • [itemId] is replaced with the item's unique Id.
    • [itemNo] is replaced with the item number.
    • [itemName] is replaced with the item's name.
    • [itemPrice] is replaced with the order line's unit price including VAT.
    • [itemPriceExVat] is replaced with the order line's unit price excluding VAT.
    • [itemDiscount] is replaced with the order line's discount.
    • [itemCount] is replaced with the quantity on the order line.
    • [orderLineTotal] is replaced with the order line's total price including VAT.
    • [orderLineTotalExVat] is replaced with the order line's total price excluding VAT.
    Prices are text with a comma as decimal separator, for example 100,00.
  • [pgwTransact] is replaced with the payment gateway's transaction id. Empty if the order was marked as paid manually.
  • [customerId] is replaced with the customer's unique Id.
  • [ordersTotalCount] is replaced with the number of paid, non-cancelled online orders on the customer plus cash register receipts. The order that triggered the webhook is included if it is paid.
  • [ordersTotalValue] is replaced with the total purchase value including VAT for the orders and receipts above.
  • [ordersTotalValueExVat] is replaced with the total purchase value excluding VAT for the orders and receipts above.
  • [ordersLastDate] is replaced with the date of the customer's latest order or receipt in the format DD/MM-YYYY. Empty if the customer has none.
  • [customerLastBookingDate] is replaced with the date of the customer's latest booking before today in the format DD/MM-YYYY. Also available as [customerLastBookingDate_DD-MM-YYYY] and [customerLastBookingDate_YYYY-MM-DD].
  • [customerLastBookingService] is replaced with the service on the customer's latest booking before today.
  • [customerNextBookingDate] is replaced with the date of the customer's next booking in the format DD/MM-YYYY. Empty if the customer has none. Also available as [customerNextBookingDate_DD-MM-YYYY] and [customerNextBookingDate_YYYY-MM-DD].
  • [customerNextBookingService] is replaced with the service on the customer's next booking.
  • [customerAcceptsMarketingEmail] is replaced with the status of the customer's consent to marketing by email (0 = no, 1 = yes).
  • [customerAcceptsMarketingSms] is replaced with the status of the customer's consent to marketing by SMS (0 = no, 1 = yes).
  • [customerTag_begin] [lineBreak] [customerTag_end] is repeated for each customer tag in the system (see Customer tags). The following replacement codes can be used in between:
    • [customerTagId] is replaced with the customer tag's unique Id.
    • [customerTagName] is replaced with the customer tag's name.
    • [customerTagValue] is replaced with the status on the customer (0 = not set, 1 = set).
    [lineBreak] gives a comma between the customer tags.

In addition to the replacement codes above, you can freely use replacement codes from the following categories to build your own data:


 


Try a Free and Non-Binding Demo of Gecko Booking & Administration

Fill out the form, and you will receive a demo as soon as possible.

All good!
Please enter the company name.
All good!
Please enter your phone number.
All good!
Please enter your name.

Fields marked with an * are required