I’m currently building a RMA Request system using Gravity Forms, Gravity Flow, and WooCommerce.
Whenever a new step is “Approved” in the flow I need to send an outgoing webhook to a 3rd party service that passes information about the order along.
I’ve got the bulk of the frontend setup and I’m automatically passing the Order ID into the Order ID field (from Gravity Flow).
Everything I need to send along I can easily pull from the WC Order Object but I’m not sure the best way to gather that information. Gravity Flow uses the merge tag system to build the body of the outgoing webhook, is it possible to pull information from an order into those - or - does anybody know where I should start looking?
It would appear you’re able to use shortcodes in the raw body with outgoing webhooks in Gravity Flow, so I’m putting together a shortcode that’ll generate the webhook body needed from the Order ID that’s passed.
Two others doc links that may prove fruitful if you want to refactor or for others finding this forum post later on…
gravityflow_webhook_args filter would let you use similar logic to the shortcode without the need of a separate shortcode. Changing the $args[‘body’] value is probably what you’d want to focus on with the values needed from the WC Order Object.
If the API you’re connecting to provides things back in a straight forward JSON response (body), the webhook response mapping doc will let you use array notation within the step settings to pick/store that back into entry fields. If you need to do something more complex, check out gravityflow_entry_webhook_response_mapping for adjusting what the $entry to be updated at the conclusion of the step has.