Shopify
+
Arigato Automation

Relay A Shopify Webhook With Your Own Payload in Shopify by Using Arigato Automation

Don't bother setting up a whole server just to relay a webhook from Shopify another system. Let Arigato Automation do it for you instead. If you need to send order data from Shopify to another system, this automation will be a big time-saver for you.

Triggered When
Workflow Actions

Download Complete

You can now import the ".arigato" workflow file you downloaded into the app.

  1. Open the Arigato Automation app in your Shopify admin.
  2. Visit the "Import & Export" page within the app.
  3. Scroll to bottom and upload your file to import the workflow.

This example automation is triggered when an order is paid, but you can choose a different trigger if you'd like. It checks if the order contains your special product. If the product is found in the order, it sends a POST request to the URL of your choice, relaying the Shopify webhook with your own payload. The headers and the body data of the POST are fully configurable.

This example is an ideal starting point for any Shopify integration project that would normally require setting up a server just to manipulate Shopify webhook payload data before sending it to your own system or a third-party system. Instead of setting up and maintaining a server for such a simple task, you could easily change the payload into the format you need using the Arigato Automation app before sending it on to its final endpoint.

Testing your relayed webhook

To test this workflow, we recommend the handy tool at https://webhook.site which allows you to send it data that is displayed in real time. This is incredibly helpful for debugging. 

For testing, in the app, set up your POST URL to use the URL that the webhook.site tool assigns to you. Then, using our Test Center, trigger the action. You'll immediately see your payload posted on the testing website.

Formatting Your Payload

Usually, you'll want to send the payload as JSON, or sometimes as form data instead of JSON. Remember, Arigato Automation has a filter to convert object data to JSON. Here is an example where we simply build up an array of data and then convert it to JSON when we print it. Our example simply creates an array of all the SKUs in an order and prints the array as JSON.

{% set myarray = [] %}
{% for line_item in order.line_items %}
{% set myarray = myarray|merge([{ 'sku': line_item.sku }]) %}
{% endfor %}
{{ myarray | to_json }}

 

Setup to send a POST request from Shopify using Arigato Automation