Toggle menu

Writing Bookings Plugins

Post Payment Workflows

It's possible to start another workflow process once a booking has been made. Bookers will be taken straight to the first form in your workflow as soon as they press the "Book Now" button (if the event is free) or once they have been redirected back to your website after a successful payment.

To enable a workflow, enter the process identifier of the workflow you want to start in the plugin configuration (see the configuration section in the previous article). For example "postPaymentWorkflow": "timsexampleprocess".

The postPaymentWorkflowVars property in the configuration is a list of process variables from the booking you'd like to pass to the new workflow. The default fields/variables collected by Bookings are:

  • form_DATA - an object containing all of the data needed by the product
  • form_EMAIL - the booker's email address
  • form_NAME - the booker's name
  • form_TEL - the booker's phone number. This field is optional

The business key of the booking is always passed to the new workflow as the value of the BookingBK variable.

If your plugin has a pre-payment form (described previously) you can include any variables from that in exactly the same way.

In this example two fields from the booking form are being passed to the new workflow:

        "postPaymentWorkflow": "timsexampleprocess",
        "postPaymentWorkflowVars": ["form_NAME", "form_EMAIL"],

Which resulted in:

Post Booking Workflow

Last modified on 16 October 2024

Share this page

Facebook icon Twitter icon email icon

Print

print icon