Skip to content
  • Why WPGetAPI?
  • Examples
  • Pricing
  • Plugins
    • PRO Plugin
    • API to Posts Plugin
    • OAuth 2.0 Plugin
  • Docs
  • Support
    • Frequently Asked Questions
    • Feature Request
    • Support Ticket
  • account_circle
PRO Plugin
Howdy! How can we help you?
  • Introduction

    • Quick Start
    • Frequently Asked Questions
    • Will this work with my API?
    • Understanding API docs
    • Step by Step Example
  • Setup

    • Setup Page
    • Endpoint Page
    • Parameters - Query String
    • Parameters - Headers
    • Parameters - Body POST
    • Shortcode
    • Template Tag
    • Gutenberg Block
  • Connecting your API

    • API Key in Headers
    • API Key in Query String
    • Authentication & Authorization
  • Output API Data

    • Format API to HTML
    • Format API to HTML Table
    • Format API to Image Gallery
    • Format JSON Data
  • Integrations

    • Send form data to API
    • WPForms to API
    • Gravity Forms to API
    • Contact Form 7 to API
    • WooCommerce to API
    • WooCommerce API Product Sync
    • wpDataTables to API
    • Connect WordPress to OpenAI
    • Connect RapidAPI to WordPress
    • Connect Zoho CRM to WordPress
    • Page Builders (Elementor, DIVI)
    • Formidable Forms to API
    • Elementor Form to API
    • JetFormBuilder to API
    • Fluent Forms to API
    • WS Form to API
    • Ninja Tables to API
    • Easy Digital Downloads(EDD) API Product Sync
    • Ultimate Member Forms to API
  • Tips & Tricks

    • Filters & Action Hooks
    • Code Snippets Plugin
    • Troubleshooting
    • Code Snippets
  • PRO Plugin

    • Installation
    • Actions
    • Tokens
    • Caching
    • Nested data
    • Chaining API calls
    • Dynamic Variables
    • Format API to HTML
    • Call API on user registration
    • Using AJAX to trigger API call
    • Base64 Encoding
    • Licensing
    • Filters & Action Hooks
  • OAuth 2.0 Plugin

    • Installation
    • How it works
    • Grant Type - Client Credentials
    • Grant Type - Authorization Code
    • Licensing
  • API to Posts Plugin

    • Installation
    • Getting Started
    • Multiple Endpoints
    • Mapping Fields
    • Filters & Action Hooks
    • Pagination
Features in this article are available in the PRO Plugin.
Also see our article on how to sync WooCommerce products from an API.

Send WooCommerce data to any API
Our PRO plugin includes a feature called Actions that allows you to send WooCommerce data (and other WordPress data) to your API without writing a single line of code.

This allows you to easily integrate your WooCommerce store with any REST API and trigger your API calls when you get a new order, add an order from the admin area, create a new product or change the status of a product or an order.

Let’s look at how some of these Actions work.

Firstly you need to setup the endpoint that you want to send the data to. If you have not done that, you can view the Quick Start guide here.


Call API on new WooCommerce order

To call your API when you get a new WooCOmmerce order, you simply need to select WooCommerce – New Order Created from the dropdown within your endpoint. Save the endpoint and now any time a new WooCommerce order is created, this endpoint is called.


Call API when WooCommerce order status changes

Within your endpoint, you simply select WooCommerce – Order Status Changed from the dropdown.

After selecting that option, you will see the Old Order Status and New Order Status options. This allows you to fine tune when you want to call this API. In our example we are only calling this endpoint when the status changes from ‘Any Status’ to ‘Completed’ status.

We can save this endpoint and now any time a WooCommerce order is changed to ‘Completed’ this endpoint is called.


Send WooCommerce order data to the API

Now that we have seen how to setup the order Actions, we will most likely want to send this order data to the API. To do this, we use a ‘Token’ within the endpoint settings page that grabs any piece of data related to a particular order.

In the screenshot below we are sending a few details about the order to the API within the Body POST Fields. It is simply sending the order date, the total of the order and the order_key. We are doing this by using tokens such as (action:total).

Each token within Action starts with (action: and then the name of the data that we want to get.

You can do a test to see the full list of data available by:

  1. creating a new order in your admin (or frontend)
  2. check the WPGetAPI > Actions Log page which contains all the data that is available to send

Please also see our docs on Actions for a more comprehensive write up.


Getting all line items

If you wanted to only get the SKU of the first product purchased within an order, you can use this exact token: (action:line_items:0:sku)

But usually the number of products within an order will be dynamic and will often change. There could be one product or there could be 10. To overcome this and to be sure that we grab the details of each product in an order, we have a special (line_items) token we can use that looks something like this:

(line_items:start)
    (get:sku)
    (get:qty)
    (get:subtotal) 
    (get:image_url)
(line_items:end)

And here is what it looks like within the admin of the endpoint settings page, with some extra JSON formatting thrown in such as commas, quotes and curly braces:


Call API when WooCommerce product is created

Within your endpoint, you simply select WooCommerce – New Product Created from the dropdown.

Sending product data to API

Now once this action happens, we are able to grab any data we like that is related to that particular product.

In the screenshot below we are sending a bunch of different details about the product that was just created. You can add unlimited details about the product.

For a full list of the data available that you can send, please see our docs on Actions. You can also test this by adding a new product in your admin and then checking the WPGetAPI Action Log which contains all the data available to send.

On this page
contact_support

Still not sure?

APIs can be daunting and sometimes downright confusing.

But we are here to help! Our support is amazing and we can assist you with any setup required and ensure your API integrations are a success!

Ask Us Anything

Connect your WordPress website to external APIs without writing a single line of code. Send data from WordPress to your API or display data from your API within WordPress.

Support

  • Documentation
  • Support Ticket
  • Refund Policy
  • Contact Us
  • About Us
  • Affiliates

Articles

  • Quick Start Guide
  • WooCommerce Orders to API
  • WooCommerce API Products Sync
  • Contact Form 7 to API
  • WPForms to API
  • Gravity Forms to API
  • WordPress to RapidAPI

WordPress API Plugins

  • Free WPGetAPI Plugin
  • PRO Plugin
  • API to Posts Plugin Plugin
  • OAuth 2.0 Authorization Plugin

© 2025 WPGetAPI. All Rights Reserved.

"*" indicates required fields

Name*
This field is for validation purposes and should be left unchanged.