WooCommerce

 

WooCommerce is an open-source e-commerce plugin for WordPress. It is designed for small to large-sized online merchants using WordPress. The plugin quickly became popular for its simplicity to install and customize and for the market position of the base product as freeware.

Woocommerce is now one of the leading options for online stores and for people who want to open there store online and fufill orders from it.

 

UChat supports WooCommerce integration natively along with all the actions the current WooCommerce api supports in its endpoints.

 

You can not only create automations using UChat for your WooCommerce store but also be able to create, edit, update orders, fullfill them, keep track of the orders, shipments , reviews etc.

Integrating Your WooCommerce Store With UChat

In order to integrate Uchat with your WooCommerce store, you need to log in to your store and click on WooCommerce Tab.

 

 

 

Click on Settings > Advanced > REST API tab

 

 

Click on Add Key

 

Enter the details and create your API Key.

 

 

Save and copy the details.

 

 

 

On UChat, Click on Integrations tab and click on WooCommerce to integrate your store.

 

 

Using WooCommerce Actions

To use WooCommerce actions, create an action node and then click on integrations to find WooCommerce tab and click on it.

 

WooCommerce Native Actions

 

WooCommerce supports the following actions from their API endpoints as follows.

 

We will now explore each on of them in detail.

 

Add To Cart

This action is used to add an item or product to the user’s cart.

 

 

Following response payload is received

 

{
"variant_id": 4120,
"product_id": 375,
"quantity": 1,
"previous_quantity": 0
}

 

 

Remove Cart By Variant

This action is used to remove an item or product from cart using its variant and product ID.

 

 

Following response payload is received.

 

{
"variant_id": 4120,
"product_id": 375,
"quantity": 1,
"previous_quantity": 3
}

 

 

Remove Cart By Product

This action is used to remove an item or product from cart using product ID only.

 

 

Following response payload is received.

 

{
"product_id": 375,
"removed_variants": [
{
"variant_id": 4120,
"quantity": 1
}
]
}

 

 

Empty Cart

This action is used to empty the complete cart.

 

 

Following response payload is received.

 

{
"status": "ok"
}

 

 

Get Cart Items

This action is used to fetch all the details for items present in the cart

 

 

Following response payload is received.

 

[
{
"id": 258,
"name": "DNK Black Shoes - blue",
"product_id": 375,
"variation_id": 4120,
"quantity": 2,
"subtotal": "350.00",
"subtotal_tax": "0.00",
"total": "350.00",
"total_tax": "0.00",
"sku": "",
"price": 175,
"image": "https://shop.businessautomated.io/wp-content/uploads/2021/03/sports-shoe5.jpg",
"parent_name": "DNK Black Shoes"
}
]

 

Get Cart Item IDs and Quantity

This action is used to get item’s IDs and quantity which are present in the cart.

 

 

Following response payload is received.

 

[
{
"product_id": 375,
"quantity": 2,
"variation_id": 4120
}
]

 

Create Order From Cart

This action is used to create an order using cart items.

 

 

Following response payload is received.

 

{
"id": 4597,
"parent_id": 0,
"status": "pending",
"currency": "AUD",
"version": "6.9.4",
"prices_include_tax": false,
"date_created": "2023-04-14T11:01:51",
"date_modified": "2023-04-14T11:01:51",
"discount_total": "0.00",
"discount_tax": "0.00",
"shipping_total": "0.00",
"shipping_tax": "0.00",
"cart_tax": "0.00",
"total": "350.00",
"total_tax": "0.00",
"customer_id": 0,
"order_key": "wc_order_5hKQmDkxUiesi",
"billing": {
"first_name": "Hammad",
"last_name": "Siddiqui",
"company": "",
"address_1": "ABC Road, Garden City",
"address_2": "",
"city": "Karachi",
"state": "Sindh",
"postcode": "",
"country": "Pakistan",
"email": "hammadsiddiqui788@gmail.com",
"phone": "+9230302320964"
},
"shipping": {
"first_name": "Hammad",
"last_name": "Siddiqui",
"company": "",
"address_1": "ABC Road, Garden City",
"address_2": "",
"city": "Karachi",
"state": "Sindh",
"postcode": "",
"country": "Pakistan",
"phone": ""
},
"payment_method": "",
"payment_method_title": "",
"transaction_id": "",
"customer_ip_address": "",
"customer_user_agent": "",
"created_via": "rest-api",
"customer_note": "",
"date_completed": null,
"date_paid": null,
"cart_hash": "",
"number": "4597",
"meta_data": [
{
"id": 6465,
"key": "user_ns",
"value": "f12372u15376836"
}
],
"line_items": [
{
"id": 259,
"name": "DNK Black Shoes - blue",
"product_id": 375,
"variation_id": 4120,
"quantity": 2,
"tax_class": "",
"subtotal": "350.00",
"subtotal_tax": "0.00",
"total": "350.00",
"total_tax": "0.00",
"taxes": [...], // 0 items
"meta_data": [...], // 1 items
"sku": "",
"price": 175,
"image": {...}, // 2 keys
"parent_name":