Best answer

How to call WooCommerce REST API in Zap?

  • 26 November 2020
  • 2 replies
  • 6637 views

Userlevel 3
Badge

We want to connect WooCommerce with Zapier. We need to add a customer to our community (third-party) when s/he makes a purchase.

We have used WooCommerce webhook which gives us customer details when a purchase is made. We use “Webhook by Zapier” to catch the data. But the problem is that the WooCommerce webhook doesn’t provide customer email, and we can’t add customer to our community without email.

Now, to get the customer details including email, we need to use WooCommerce’s REST APIs. Is there a way to call the REST APIs in Zap that we create?

Thanks in advance.

icon

Best answer by SamB 7 March 2022, 17:15

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

2 replies

Userlevel 7
Badge +12

Hi @thinker500 - Yes, you can add a Webhooks by Zapier step to send a GET request to fetch the customer by ID if the webhook data you’re receiving from WooCommerce contains the customer ID.

Userlevel 7
Badge +11

Hey all! Just following up here to add some further details for anyone also looking to get the customer email address associated with a WooCommerce order.

You’d need to add a GET (Webhooks by Zapier) action and follow the instructions outlined in WooCommerce’s API documentation to make a GET request to the Retrieve an order endpoint: https://woocommerce.github.io/woocommerce-rest-api-docs/#create-an-order

That should give you the available details for the order, including customer details such as their email address.

Alternatively if you’re able to get the ID for the customer from your trigger step, then you can use the Retrieve a customer endpoint to search for the customer ID to get their email address: https://woocommerce.github.io/woocommerce-rest-api-docs/#retrieve-a-customer

You can find out more about using Webhooks by Zapier actions here: Send webhooks in Zaps

Also, I wanted to note that the latest version of the WooCommerce integration has an Order trigger and Find Customer search action which could also be used to see customer details like their email address without the need to set up any webhook actions.

For example, you can see customer information like their email address in the billing details section:
5d64b613cc138ee40f33ac07e40fef94.png

You can find out more about the different trigger and actions available for the WooCommerce integration here: WooCommerce - Supported triggers and actions