WooCommerce

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.

 

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

 

You can not only create automations using OCP 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 OCP

In order to integrate OCP 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 OCP , 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": "DNK Black Shoes"
}
],
"tax_lines": [
],
"shipping_lines": [
],
"fee_lines": [
],
"coupon_lines": [
],
"refunds": [
],
"payment_url": "https://shop.businessautomated.io/checkout-2/order-pay/4597?pay_for_order=true&key=wc_order_5hKQmDkxUiesi",
"is_editable": true,
"needs_payment": true,
"needs_processing": true,
"date_created_gmt": "2023-04-14T11:01:51",
"date_modified_gmt": "2023-04-14T11:01:51",
"date_completed_gmt": null,
"date_paid_gmt": null,
"currency_symbol": "$"
}

 

Search For Coupons

This action is used to search for coupons available on your woocommerce store on various search parameters and queries.

 

 

Following response payload is received.

[
{
"id": 4592,
"code": "vipdiscount60fc",
"amount": "10.00",
"status": "publish",
"date_created": "2023-01-25T06:56:57",
"date_created_gmt": "2023-01-25T06:56:57",
"date_modified": "2023-01-25T06:56:57",
"date_modified_gmt": "2023-01-25T06:56:57",
"discount_type": "percent",
"description": "10% discount on entire order, single use",
"date_expires": null,
"date_expires_gmt": null,
"usage_count": 1,
"individual_use": false,
"product_ids": [
],
"excluded_product_ids": [
],
"usage_limit": 1,
"usage_limit_per_user": 1,
"limit_usage_to_x_items": null,
"free_shipping": false,
"product_categories": [
],
"excluded_product_categories": [
],
"exclude_sale_items": false,
"minimum_amount": "0.00",
"maximum_amount": "0.00",
"email_restrictions": [
],
"used_by": [
"mark@doe.com"
],
"meta_data": [
],
"_links": {
"self": [...], // 1 items
"collection": [...] // 1 items
}
}
]

 

Get Coupon Info

This action is used to fetch a particular coupon’s info using its coupon ID.

 

 

Following response payload is received.

 

{
"id": 4592,
"code": "vipdiscount60fc",
"amount": "10.00",
"status": "publish",
"date_created": "2023-01-25T06:56:57",
"date_created_gmt": "2023-01-25T06:56:57",
"date_modified": "2023-01-25T06:56:57",
"date_modified_gmt": "2023-01-25T06:56:57",
"discount_type": "percent",
"description": "10% discount on entire order, single use",
"date_expires": null,
"date_expires_gmt": null,
"usage_count": 1,
"individual_use": false,
"product_ids": [
],
"excluded_product_ids": [
],
"usage_limit": 1,
"usage_limit_per_user": 1,
"limit_usage_to_x_items": null,
"free_shipping": false,
"product_categories": [
],
"excluded_product_categories": [
],
"exclude_sale_items": false,
"minimum_amount": "0.00",
"maximum_amount": "0.00",
"email_restrictions": [
],
"used_by": [
"mark@doe.com"
],
"meta_data": [
]
}

 

Delete Coupon

This action is used to delete a coupon based on its coupon ID.

 

 

Following response payload is received.

 

{
"status": "ok"
}

 

Create Coupon

This action is used to create a coupon.

 


 

Following response payload is received.

 

{
"id": 4598,
"code": "test12",
"amount": "10.00",
"status": "publish",
"date_created": "2023-04-14T14:27:49",
"date_created_gmt": "2023-04-14T14:27:49",
"date_modified": "2023-04-14T14:27:49",
"date_modified_gmt": "2023-04-14T14:27:49",
"discount_type": "percent",
"description": "test coupon",
"date_expires": "2023-05-01T00:00:00",
"date_expires_gmt": "2023-05-01T00:00:00",
"usage_count": 0,
"individual_use": false,
"product_ids": [
],
"excluded_product_ids": [
],
"usage_limit": 1,
"usage_limit_per_user": 1,
"limit_usage_to_x_items": null,
"free_shipping": false,
"product_categories": [
],
"excluded_product_categories": [
],
"exclude_sale_items": false,
"minimum_amount": "0.00",
"maximum_amount": "0.00",
"email_restrictions": [
],
"used_by": [
],
"meta_data": [
]
}

 

Update Coupon

This action is used to update a coupon using its coupon ID.

 

 

Following response payload is received.

 

{
"id": 4598,
"code": "test12",
"amount": "15.00",
"status": "publish",
"date_created": "2023-04-14T14:27:49",
"date_created_gmt": "2023-04-14T14:27:49",
"date_modified": "2023-04-14T14:27:49",
"date_modified_gmt": "2023-04-14T14:27:49",
"discount_type": "percent",
"description": "test coupon",
"date_expires": "2023-05-01T00:00:00",
"date_expires_gmt": "2023-05-01T00:00:00",
"usage_count": 0,
"individual_use": false,
"product_ids": [
],
"excluded_product_ids": [
],
"usage_limit": 3,
"usage_limit_per_user": 1,
"limit_usage_to_x_items": null,
"free_shipping": false,
"product_categories": [
],
"excluded_product_categories": [
],
"exclude_sale_items": false,
"minimum_amount": "0.00",
"maximum_amount": "0.00",
"email_restrictions": [
],
"used_by": [
],
"meta_data": [
]
}

 

Search For Customers

This action is used to search for customers using various parameters and queries.

 

 

Following response payload was received.

 

[
{
"id": 2,
"date_created": "2022-10-10T01:24:22",
"date_created_gmt": "2022-10-10T01:24:22",
"date_modified": "2022-10-10T01:24:22",
"date_modified_gmt": "2022-10-10T01:24:22",
"email": "test@test.com",
"first_name": "",
"last_name": "last",
"role": "customer",
"username": "test",
"billing": {
"first_name": "",
"last_name": "",
"company": "",
"address_1": "",
"address_2": "",
"city": "",
"postcode": "",
"country": "",
"state": "",
"email": "",
"phone": ""
},
"shipping": {
"first_name": "",
"last_name": "",
"company": "",
"address_1": "",
"address_2": "",
"city": "",
"postcode": "",
"country": "",
"state": "",
"phone": ""
},
"is_paying_customer": false,
"avatar_url": "https://secure.gravatar.com/avatar/b642b4217b34b1e8d3bd915fc65c4452?s=96&d=mm&r=g",
"meta_data": [
{...} // 3 keys
],
"_links": {
"self": [...], // 1 items
"collection": [...] // 1 items
}
},
{
"id": 5,
"date_created": "2022-10-12T16:32:26",
"date_created_gmt": "2022-10-12T16:32:26",
"date_modified": "2022-10-12T16:32:26",
"date_modified_gmt": "2022-10-12T16:32:26",
"email": "mark@OCP.com.au",
"first_name": "Mark",
"last_name": "van der Made",
"role": "customer",
"username": "markvdmade",
"billing": {
"first_name": "Mark",
"last_name": "van der Made",
"company": "",
"address_1": "palmonostora 143",
"address_2": "",
"city": "Palmonostora",
"postcode": "6112",
"country": "Hungary",
"state": "bacs-kiskun",
"email": "mark@OCP.com.au",
"phone": "+36707203759"
},
"shipping": {
"first_name": "Mark",
"last_name": "van der Made",
"company": "",
"address_1": "palmonostora 143",
"address_2": "",
"city": "Palmonostora",
"postcode": "6112",
"country": "Hungary",
"state": "bacs-kiskun",
"phone": ""
},
"is_paying_customer": false,
"avatar_url": "https://secure.gravatar.com/avatar/f96de5c9ef467d55b706b615b56a641b?s=96&d=mm&r=g",
"meta_data": [
],
"_links": {
"self": [...], // 1 items
"collection": [...] // 1 items
}
}
]

 

Get Customer Info

This action is used to fetch information for a customer using their customer ID.

 

 

{
"id": 2,
"date_created": "2022-10-10T01:24:22",
"date_created_gmt": "2022-10-10T01:24:22",
"date_modified": "2022-10-10T01:24:22",
"date_modified_gmt": "2022-10-10T01:24:22",
"email": "test@test.com",
"first_name": "",
"last_name": "last",
"role": "customer",
"username": "test",
"billing": {
"first_name": "",
"last_name": "",
"company": "",
"address_1": "",
"address_2": "",
"city": "",
"postcode": "",
"country": "",
"state": "",
"email": "",
"phone": ""
},
"shipping": {
"first_name": "",
"last_name": "",
"company": "",
"address_1": "",
"address_2": "",
"city": "",
"postcode": "",
"country": "",
"state": "",
"phone": ""
},
"is_paying_customer": false,
"avatar_url": "https://secure.gravatar.com/avatar/b642b4217b34b1e8d3bd915fc65c4452?s=96&d=mm&r=g",
"meta_data": [
{
"id": 62,
"key": "wc_last_active",
"value": "1665532800"
}
]
}

 

Create Customer

This action is used to create a customer.

 


 

Following response payload is received.

 

{
"id": 6,
"date_created": "2023-04-14T17:54:14",
"date_created_gmt": "2023-04-14T17:54:14",
"date_modified": "2023-04-14T17:54:14",
"date_modified_gmt": "2023-04-14T17:54:14",
"email": "hammadsiddiqui788@gmail.com",
"first_name": "Hammad",
"last_name": "Siddiqui",
"role": "customer",
"username": "HammadSiddiqui76",
"billing": {
"first_name": "Hammad",
"last_name": "Siddiqui",
"company": "",
"address_1": "abc road , garden city",
"address_2": "Maymar, Karachi",
"city": "Karachi",
"postcode": "78601",
"country": "Pakistan",
"state": "Sindh",
"email": "hammadsiddiqui788@gmail.com",
"phone": "+923032320964"
},
"shipping": {
"first_name": "Hammad",
"last_name": "Siddiqui",
"company": "",
"address_1": "abc road , garden city",
"address_2": "Maymar, Karachi",
"city": "Karachi",
"postcode": "78601",
"country": "Pakistan",
"state": "Sindh",
"phone": ""
},
"is_paying_customer": false,
"avatar_url": "https://secure.gravatar.com/avatar/f4c6265a08a9578979e81cc594810336?s=96&d=mm&r=g",
"meta_data": [
]
}

 

Update Customer

This action is used to update the details of a customer using their customer ID.

 

 

Once created, the username and password for the customer cannot be changed by the admin.

 

Following response payload is received.

 

{
"id": 6,
"date_created": "2023-04-14T17:54:14",
"date_created_gmt": "2023-04-14T17:54:14",
"date_modified": "2023-04-14T17:57:24",
"date_modified_gmt": "2023-04-14T17:57:24",
"email": "hammadsiddiqui788@gmail.com",
"first_name": "Hammad",
"last_name": "Siddiqui",
"role": "customer",
"username": "HammadSiddiqui76",
"billing": {
"first_name": "Hammad",
"last_name": "Siddiqui",
"company": "",
"address_1": "abc road , garden city",
"address_2": "Maymar, Karachi",
"city": "Karachi",
"postcode": "78601",
"country": "Pakistan",
"state": "Sindh",
"email": "hammadsiddiqui788@gmail.com",
"phone": "+923032320964"
},
"shipping": {
"first_name": "Hammad",
"last_name": "Siddiqui",
"company": "",
"address_1": "abc road , garden city",
"address_2": "Maymar, Karachi",
"city": "Karachi",
"postcode": "78601",
"country": "Pakistan",
"state": "Sindh",
"phone": ""
},
"is_paying_customer": false,
"avatar_url": "https://secure.gravatar.com/avatar/f4c6265a08a9578979e81cc594810336?s=96&d=mm&r=g",
"meta_data": [
]
}

 

Delete Customer

This action is used to delete a particular customer using their customer ID.

 

Following response payload is received.

 

{
"id": 2,
"date_created": "2022-10-10T01:24:22",
"date_created_gmt": "2022-10-10T01:24:22",
"date_modified": "2022-10-10T01:24:22",
"date_modified_gmt": "2022-10-10T01:24:22",
"email": "test@test.com",
"first_name": "",
"last_name": "last",
"role": "customer",
"username": "test",
"billing": {
"first_name": "",
"last_name": "",
"company": "",
"address_1": "",
"address_2": "",
"city": "",
"postcode": "",
"country": "",
"state": "",
"email": "",
"phone": ""
},
"shipping": {
"first_name": "",
"last_name": "",
"company": "",
"address_1": "",
"address_2": "",
"city": "",
"postcode": "",
"country": "",
"state": "",
"phone": ""
},
"is_paying_customer": false,
"avatar_url": "https://secure.gravatar.com/avatar/b642b4217b34b1e8d3bd915fc65c4452?s=96&d=mm&r=g",
"meta_data": [
{
"id": 62,
"key": "wc_last_active",
"value": "1665532800"
}
]
}

 

Search For Orders

This action is used to search for orders using various parameters and queries.

 

 

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": [
{...} // 3 keys
],
"line_items": [
{...} // 16 keys
],
"tax_lines": [
],
"shipping_lines": [
],
"fee_lines": [
],
"coupon_lines": [
],
"refunds": [
],
"payment_url": "https://shop.businessautomated.io/checkout-2/order-pay/4597?pay_for_order=true&key=wc_order_5hKQmDkxUiesi",
"is_editable": true,
"needs_payment": true,
"needs_processing": true,
"date_created_gmt": "2023-04-14T11:01:51",
"date_modified_gmt": "2023-04-14T11:01:51",
"date_completed_gmt": null,
"date_paid_gmt": null,
"currency_symbol": "$",
"_links": {
"self": [...], // 1 items
"collection": [...] // 1 items
}
}
]

 

Get Order Info

This action is used to fetch order information using order ID.

 

 

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": "DNK Black Shoes"
}
],
"tax_lines": [
],
"shipping_lines": [
],
"fee_lines": [
],
"coupon_lines": [
],
"refunds": [
],
"payment_url": "https://shop.businessautomated.io/checkout-2/order-pay/4597?pay_for_order=true&key=wc_order_5hKQmDkxUiesi",
"is_editable": true,
"needs_payment": true,
"needs_processing": true,
"date_created_gmt": "2023-04-14T11:01:51",
"date_modified_gmt": "2023-04-14T11:01:51",
"date_completed_gmt": null,
"date_paid_gmt": null,
"currency_symbol": "$"
}

 

Create Order From Single Product

This action is used to crate an order of one item or product only. (For multiple items, use create order from cart action).

 

 

Following response payload is received.

 

{
"id": 4599,
"parent_id": 0,
"status": "pending",
"currency": "AUD",
"version": "6.9.4",
"prices_include_tax": false,
"date_created": "2023-04-14T18:13:13",
"date_modified": "2023-04-14T18:13:13",
"discount_total": "0.00",
"discount_tax": "0.00",
"shipping_total": "0.00",
"shipping_tax": "0.00",
"cart_tax": "0.00",
"total": "175.00",
"total_tax": "0.00",
"customer_id": 4,
"order_key": "wc_order_yhGfOfZ0eoCYe",
"billing": {
"first_name": "",
"last_name": "",
"company": "",
"address_1": "",
"address_2": "",
"city": "",
"state": "",
"postcode": "",
"country": "",
"email": "mark@OCP.com",
"phone": ""
},
"shipping": {
"first_name": "",
"last_name": "",
"company": "",
"address_1": "",
"address_2": "",
"city": "",
"state": "",
"postcode": "",
"country": "",
"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": "4599",
"meta_data": [
],
"line_items": [
{
"id": 260,
"name": "DNK Black Shoes - blue",
"product_id": 375,
"variation_id": 4120,
"quantity": 1,
"tax_class": "",
"subtotal": "175.00",
"subtotal_tax": "0.00",
"total": "175.00",
"total_tax": "0.00",
"taxes": [...], // 0 items
"meta_data": [...], // 1 items
"sku": "",
"price": 175,
"image": {...}, // 2 keys
"parent_name": "DNK Black Shoes"
}
],
"tax_lines": [
],
"shipping_lines": [
],
"fee_lines": [
],
"coupon_lines": [
],
"refunds": [
],
"payment_url": "https://shop.businessautomated.io/checkout-2/order-pay/4599?pay_for_order=true&key=wc_order_yhGfOfZ0eoCYe",
"is_editable": true,
"needs_payment": true,
"needs_processing": true,
"date_created_gmt": "2023-04-14T18:13:13",
"date_modified_gmt": "2023-04-14T18:13:13",
"date_completed_gmt": null,
"date_paid_gmt": null,
"currency_symbol": "$"
}

 

Update Order

This action is used to update the order information and status using order ID

 

 

Following response payload is received.

 

{
"id": 4597,
"parent_id": 0,
"status": "completed",
"currency": "AUD",
"version": "6.9.4",
"prices_include_tax": false,
"date_created": "2023-04-14T11:01:51",
"date_modified": "2023-04-14T18:16:14",
"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": "2023-04-14T18:16:14",
"date_paid": "2023-04-14T18:16:14",
"cart_hash": "",
"number": "4597",
"meta_data": [
{
"id": 6465,
"key": "user_ns",
"value": "f12372u15376836"
},
{
"id": 6499,
"key": "_new_order_email_sent",
"value": "true"
}
],
"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": "DNK Black Shoes"
}
],
"tax_lines": [
],
"shipping_lines": [
],
"fee_lines": [
],
"coupon_lines": [
],
"refunds": [
],
"payment_url": "https://shop.businessautomated.io/checkout-2/order-pay/4597?pay_for_order=true&key=wc_order_5hKQmDkxUiesi",
"is_editable": false,
"needs_payment": false,
"needs_processing": true,
"date_created_gmt": "2023-04-14T11:01:51",
"date_modified_gmt": "2023-04-14T18:16:14",
"date_completed_gmt": "2023-04-14T18:16:14",
"date_paid_gmt": "2023-04-14T18:16:14",
"currency_symbol": "$"
}

 

Delete Order

This action is used to delete an order using order ID.

 

 

Following response payload is received.

 

{
"id": 4597,
"parent_id": 0,
"status": "completed",
"currency": "AUD",
"version": "6.9.4",
"prices_include_tax": false,
"date_created": "2023-04-14T11:01:51",
"date_modified": "2023-04-14T18:16:14",
"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": "2023-04-14T18:16:14",
"date_paid": "2023-04-14T18:16:14",
"cart_hash": "",
"number": "4597",
"meta_data": [
{
"id": 6465,
"key": "user_ns",
"value": "f12372u15376836"
},
{
"id": 6499,
"key": "_new_order_email_sent",
"value": "true"
}
],
"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": "DNK Black Shoes"
}
],
"tax_lines": [
],
"shipping_lines": [
],
"fee_lines": [
],
"coupon_lines": [
],
"refunds": [
],
"payment_url": "https://shop.businessautomated.io/checkout-2/order-pay/4597?pay_for_order=true&key=wc_order_5hKQmDkxUiesi",
"is_editable": false,
"needs_payment": false,
"needs_processing": true,
"date_created_gmt": "2023-04-14T11:01:51",
"date_modified_gmt": "2023-04-14T18:16:14",
"date_completed_gmt": "2023-04-14T18:16:14",
"date_paid_gmt": "2023-04-14T18:16:14",
"currency_symbol": "$"
}

 

Create Order Note

This action is used to create an order note using order ID.

 

 

Following response payload is received.

 

{
"id": 65,
"author": "WooCommerce",
"date_created": "2023-04-14T18:21:24",
"date_created_gmt": "2023-04-14T18:21:24",
"note": "This is a test order",
"customer_note": false
}

 

Search For Products

This action is used to search for products using various parameters and queries.

 


 

Following response payload is received.

 

[
{
"id": 375,
"name": "DNK Black Shoes",
"slug": "dnk-black-shoes",
"permalink": "https://shop.businessautomated.io/product/dnk-black-shoes",
"type": "variable",
"status": "publish",
"featured": false,
"catalog_visibility": "visible",
"description": "",
"short_description": "",
"sku": "",
"price": "175",
"regular_price": "",
"sale_price": "",
"date_on_sale_from": null,
"date_on_sale_from_gmt": null,
"date_on_sale_to": null,
"date_on_sale_to_gmt": null,
"on_sale": false,
"purchasable": true,
"total_sales": 30,
"virtual": false,
"downloadable": false,
"downloads": [
],
"download_limit": -1,
"download_expiry": -1,
"external_url": "",
"button_text": "",
"tax_status": "taxable",
"tax_class": "",
"manage_stock": false,
"stock_quantity": null,
"backorders": "no",
"backorders_allowed": false,
"backordered": false,
"low_stock_amount": null,
"sold_individually": false,
"weight": "",
"dimensions": {
"length": "",
"width": "",
"height": ""
},
"shipping_required": true,
"shipping_taxable": true,
"shipping_class": "",
"shipping_class_id": 0,
"reviews_allowed": true,
"average_rating": "0.00",
"rating_count": 0,
"parent_id": 0,
"purchase_note": "",
"attributes": [
],
"variations": [
4120,
4119,
4122,
4121
],
"grouped_products": [
],
"menu_order": 0,
"related_ids": [
242,
229,
86,
211,
79
],
"stock_status": "instock",
"has_options": true,
"image": "https://shop.businessautomated.io/wp-content/uploads/2021/03/sports-shoe5.jpg"
}
]

 

Get Product Info

This action is used to fetch product information using the product ID.

 

 

Following response payload is received.

 

{
"id": 375,
"name": "DNK Black Shoes",
"slug": "dnk-black-shoes",
"permalink": "https://shop.businessautomated.io/product/dnk-black-shoes",
"type": "variable",
"status": "publish",
"featured": false,
"catalog_visibility": "visible",
"description": "",
"short_description": "",
"sku": "",
"price": "175",
"regular_price": "",
"sale_price": "",
"date_on_sale_from": null,
"date_on_sale_from_gmt": null,
"date_on_sale_to": null,
"date_on_sale_to_gmt": null,
"on_sale": false,
"purchasable": true,
"total_sales": 30,
"virtual": false,
"downloadable": false,
"downloads": [
],
"download_limit": -1,
"download_expiry": -1,
"external_url": "",
"button_text": "",
"tax_status": "taxable",
"tax_class": "",
"manage_stock": false,
"stock_quantity": null,
"backorders": "no",
"backorders_allowed": false,
"backordered": false,
"low_stock_amount": null,
"sold_individually": false,
"weight": "",
"dimensions": {
"length": "",
"width": "",
"height": ""
},
"shipping_required": true,
"shipping_taxable": true,
"shipping_class": "",
"shipping_class_id": 0,
"reviews_allowed": true,
"average_rating": "0.00",
"rating_count": 0,
"parent_id": 0,
"purchase_note": "",
"attributes": [
],
"variations": [
4120,
4119,
4122,
4121
],
"grouped_products": [
],
"menu_order": 0,
"related_ids": [
247,
209,
160,
169,
109
],
"stock_status": "instock",
"has_options": true,
"image": "https://shop.businessautomated.io/wp-content/uploads/2021/03/sports-shoe5.jpg"
}

 

Create Product

This action is used to create a product on you woocommerce store.

 


 

Following response payload is received.

{
"id": 4600,
"name": "Test Product",
"slug": "test-product",
"permalink": "https://shop.businessautomated.io/product/test-product",
"type": "simple",
"status": "publish",
"featured": false,
"catalog_visibility": "visible",
"description": "this is a test product",
"short_description": "",
"sku": "123456",
"price": "10",
"regular_price": "10",
"sale_price": "",
"date_on_sale_from": null,
"date_on_sale_from_gmt": null,
"date_on_sale_to": null,
"date_on_sale_to_gmt": null,
"on_sale": false,
"purchasable": true,
"total_sales": 0,
"virtual": false,
"downloadable": false,
"downloads": [
],
"download_limit": -1,
"download_expiry": -1,
"external_url": "",
"button_text": "",
"tax_status": "taxable",
"tax_class": "",
"manage_stock": false,
"stock_quantity": null,
"backorders": "no",
"backorders_allowed": false,
"backordered": false,
"low_stock_amount": null,
"sold_individually": false,
"weight": "",
"dimensions": {
"length": "",
"width": "",
"height": ""
},
"shipping_required": true,
"shipping_taxable": true,
"shipping_class": "",
"shipping_class_id": 0,
"reviews_allowed": true,
"average_rating": "0",
"rating_count": 0,
"parent_id": 0,
"purchase_note": "",
"attributes": [
],
"variations": [
],
"grouped_products": [
],
"menu_order": 0,
"related_ids": [
109,
212,
157,
210,
229
],
"stock_status": "instock",
"has_options": false,
"image": null
}

 

Update Product

This action is used to update the product details using product ID

 

 

Following response payload is received.

 

{
"id": 4600,
"name": "Test Product",
"slug": "test-product",
"permalink": "https://shop.businessautomated.io/?post_type=product&p=4600",
"type": "simple",
"status": "pending",
"featured": false,
"catalog_visibility": "visible",
"description": "this is a test product",
"short_description": "",
"sku": "123456",
"price": "10",
"regular_price": "10",
"sale_price": "",
"date_on_sale_from": null,
"date_on_sale_from_gmt": null,
"date_on_sale_to": null,
"date_on_sale_to_gmt": null,
"on_sale": false,
"purchasable": true,
"total_sales": 0,
"virtual": false,
"downloadable": false,
"downloads": [
],
"download_limit": -1,
"download_expiry": -1,
"external_url": "",
"button_text": "",
"tax_status": "taxable",
"tax_class": "",
"manage_stock": false,
"stock_quantity": null,
"backorders": "no",
"backorders_allowed": false,
"backordered": false,
"low_stock_amount": null,
"sold_individually": false,
"weight": "",
"dimensions": {
"length": "",
"width": "",
"height": ""
},
"shipping_required": true,
"shipping_taxable": true,
"shipping_class": "",
"shipping_class_id": 0,
"reviews_allowed": true,
"average_rating": "0",
"rating_count": 0,
"parent_id": 0,
"purchase_note": "",
"attributes": [
],
"variations": [
],
"grouped_products": [
],
"menu_order": 0,
"related_ids": [
252,
86,
247,
95,
242
],
"stock_status": "instock",
"has_options": false,
"image": null
}

 

Delete Product

This action is used to delete a product using product ID.

 

 

Following response payload is received.

 

{
"id": 4600,
"name": "Test Product",
"slug": "test-product",
"permalink": "https://shop.businessautomated.io/?post_type=product&p=4600",
"date_created": "2023-04-15T01:02:07",
"date_created_gmt": "2023-04-15T01:02:07",
"date_modified": "2023-04-15T01:03:28",
"date_modified_gmt": "2023-04-15T01:03:28",
"type": "simple",
"status": "pending",
"featured": false,
"catalog_visibility": "visible",
"description": "this is a test product",
"short_description": "",
"sku": "123456",
"price": "10",
"regular_price": "10",
"sale_price": "",
"date_on_sale_from": null,
"date_on_sale_from_gmt": null,
"date_on_sale_to": null,
"date_on_sale_to_gmt": null,
"on_sale": false,
"purchasable": true,
"total_sales": 0,
"virtual": false,
"downloadable": false,
"downloads": [
],
"download_limit": -1,
"download_expiry": -1,
"external_url": "",
"button_text": "",
"tax_status": "taxable",
"tax_class": "",
"manage_stock": false,
"stock_quantity": null,
"backorders": "no",
"backorders_allowed": false,
"backordered": false,
"low_stock_amount": null,
"sold_individually": false,
"weight": "",
"dimensions": {
"length": "",
"width": "",
"height": ""
},
"shipping_required": true,
"shipping_taxable": true,
"shipping_class": "",
"shipping_class_id": 0,
"reviews_allowed": true,
"average_rating": "0",
"rating_count": 0,
"upsell_ids": [
],
"cross_sell_ids": [
],
"parent_id": 0,
"purchase_note": "",
"categories": [
{
"id": 49,
"name": "Women",
"slug": "women"
}
],
"tags": [
{
"id": 57,
"name": "Test Product",
"slug": "test-product"
}
],
"images": [
],
"attributes": [
],
"default_attributes": [
],
"variations": [
],
"grouped_products": [
],
"menu_order": 0,
"price_html": "<span class="woocommerce-Price-amount amount"><bdi><span class="woocommerce-Price-currencySymbol">&#36;</span>10.00</bdi></span>",
"related_ids": [
160,
157,
194,
210,
252
],
"meta_data": [
],
"stock_status": "instock",
"has_options": false
}

 

Search For Product Variants

This action is used for searching product variants based on various filters.

 


 

Following response payload is received.

 

[
{
"id": 4122,
"date_created": "2022-08-17T08:01:49",
"date_created_gmt": "2022-08-17T08:01:49",
"date_modified": "2022-08-17T08:01:49",
"date_modified_gmt": "2022-08-17T08:01:49",
"description": "",
"permalink": "https://shop.businessautomated.io/product/dnk-black-shoes?attribute_pa_color=red",
"sku": "",
"price": "195",
"regular_price": "195",
"sale_price": "",
"date_on_sale_from": null,
"date_on_sale_from_gmt": null,
"date_on_sale_to": null,
"date_on_sale_to_gmt": null,
"on_sale": false,
"status": "publish",
"purchasable": true,
"virtual": false,
"downloadable": false,
"downloads": [
],
"download_limit": -1,
"download_expiry": -1,
"tax_status": "taxable",
"tax_class": "",
"manage_stock": false,
"stock_quantity": null,
"stock_status": "instock",
"backorders": "no",
"backorders_allowed": false,
"backordered": false,
"low_stock_amount": null,
"weight": "",
"dimensions": {
"length": "",
"width": "",
"height": ""
},
"shipping_class": "",
"shipping_class_id": 0,
"image": {
"id": 2462,
"date_created": "2021-03-05T07:22:32",
"date_created_gmt": "2021-03-05T07:22:32",
"date_modified": "2021-03-05T07:22:32",
"date_modified_gmt": "2021-03-05T07:22:32",
"src": "https://shop.businessautomated.io/wp-content/uploads/2021/03/sports-shoe2.jpg",
"name": "sports-shoe2",
"alt": ""
},
"attributes": [
{...} // 3 keys
],
"menu_order": 3,
"meta_data": [
{...}, // 3 keys
{...}, // 3 keys
{...} // 3 keys
],
"_links": {
"self": [...], // 1 items
"collection": [...], // 1 items
"up": [...] // 1 items
}
}
]

 

Get Product Variant Info

This action is used to fetch information for a variant using its variant ID and product ID

 

 

Following response payload is received.

 

{
"id": 4122,
"date_created": "2022-08-17T08:01:49",
"date_created_gmt": "2022-08-17T08:01:49",
"date_modified": "2022-08-17T08:01:49",
"date_modified_gmt": "2022-08-17T08:01:49",
"description": "",
"permalink": "https://shop.businessautomated.io/product/dnk-black-shoes?attribute_pa_color=red",
"sku": "",
"price": "195",
"regular_price": "195",
"sale_price": "",
"date_on_sale_from": null,
"date_on_sale_from_gmt": null,
"date_on_sale_to": null,
"date_on_sale_to_gmt": null,
"on_sale": false,
"status": "publish",
"purchasable": true,
"virtual": false,
"downloadable": false,
"downloads": [
],
"download_limit": -1,
"download_expiry": -1,
"tax_status": "taxable",
"tax_class": "",
"manage_stock": false,
"stock_quantity": null,
"stock_status": "instock",
"backorders": "no",
"backorders_allowed": false,
"backordered": false,
"low_stock_amount": null,
"weight": "",
"dimensions": {
"length": "",
"width": "",
"height": ""
},
"shipping_class": "",
"shipping_class_id": 0,
"image": {
"id": 2462,
"date_created": "2021-03-05T07:22:32",
"date_created_gmt": "2021-03-05T07:22:32",
"date_modified": "2021-03-05T07:22:32",
"date_modified_gmt": "2021-03-05T07:22:32",
"src": "https://shop.businessautomated.io/wp-content/uploads/2021/03/sports-shoe2.jpg",
"name": "sports-shoe2",
"alt": ""
},
"attributes": [
{
"id": 0,
"name": "color",
"option": "red"
}
],
"menu_order": 3,
"meta_data": [
{
"id": 3030,
"key": "_wxr_import_user_slug",
"value": "alex"
},
{
"id": 3031,
"key": "_astra_sites_imported_post",
"value": "1"
},
{
"id": 3032,
"key": "_astra_sites_enable_for_batch",
"value": "1"
}
]
}

 

Search For Categories

This action is used to fetch categories using various parameters and queries.

 

 

Following response payload is received.

 

[
{
"id": 49,
"name": "Women",
"slug": "women",
"parent": 0,
"description": " Nam nec tellus a odio tincidunt auctor a ornare odio. Sed non mauris vitae erat consequat auctor eu in elit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Mauris in erat justo. Nullam ac urna eu felis dapibus condimentum sit amet a augue. Sed non neque elit sed ut. ",
"display": "default",
"image": {
"id": 500,
"date_created": "2018-12-06T05:50:12",
"date_created_gmt": "2018-12-06T05:50:12",
"date_modified": "2022-10-06T23:57:20",
"date_modified_gmt": "2022-10-06T23:57:20",
"src": "https://shop.businessautomated.io/wp-content/uploads/2018/12/women-fashion-free-img.jpg",
"name": "women-fashion-free-img",
"alt": ""
},
"menu_order": 0,
"count": 17,
"_links": {
"self": [...], // 1 items
"collection": [...] // 1 items
}
}
]

 

Get Category Info

This action is used to fetch information for a category using its category ID.

 

 

Following response payload is received.

 

[
{
"id": 49,
"name": "Women",
"slug": "women",
"parent": 0,
"description": " Nam nec tellus a odio tincidunt auctor a ornare odio. Sed non mauris vitae erat consequat auctor eu in elit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Mauris in erat justo. Nullam ac urna eu felis dapibus condimentum sit amet a augue. Sed non neque elit sed ut. ",
"display": "default",
"image": {
"id": 500,
"date_created": "2018-12-06T05:50:12",
"date_created_gmt": "2018-12-06T05:50:12",
"date_modified": "2022-10-06T23:57:20",
"date_modified_gmt": "2022-10-06T23:57:20",
"src": "https://shop.businessautomated.io/wp-content/uploads/2018/12/women-fashion-free-img.jpg",
"name": "women-fashion-free-img",
"alt": ""
},
"menu_order": 0,
"count": 17,
"_links": {
"self": [...], // 1 items
"collection": [...] // 1 items
}
}
]

 

Get Product Tag Info

This action is used to fetch information for product tags using tag ID.

 

 

Following response payload is received.

 

[
{
"id": 49,
"name": "Women",
"slug": "women",
"parent": 0,
"description": " Nam nec tellus a odio tincidunt auctor a ornare odio. Sed non mauris vitae erat consequat auctor eu in elit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Mauris in erat justo. Nullam ac urna eu felis dapibus condimentum sit amet a augue. Sed non neque elit sed ut. ",
"display": "default",
"image": {
"id": 500,
"date_created": "2018-12-06T05:50:12",
"date_created_gmt": "2018-12-06T05:50:12",
"date_modified": "2022-10-06T23:57:20",
"date_modified_gmt": "2022-10-06T23:57:20",
"src": "https://shop.businessautomated.io/wp-content/uploads/2018/12/women-fashion-free-img.jpg",
"name": "women-fashion-free-img",
"alt": ""
},
"menu_order": 0,
"count": 17,
"_links": {
"self": [...], // 1 items
"collection": [...] // 1 items
}
}
]

 

Create Product Tag

This action is used to create a product tag.

 

 

Following response payload is received.

 

{
"id": 57,
"name": "Test Product",
"slug": "test-product",
"description": "this is a test product",
"count": 0
}

 

List All Shipping Methods

This action is used to list all the shipping methods available for the store.

 

 

Following response payload is received.

 

[
{
"id": "flat_rate",
"title": "Flat rate",
"description": "Lets you charge a fixed rate for shipping.",
"_links": {
"self": [...], // 1 items
"collection": [...] // 1 items
}
},
{
"id": "free_shipping",
"title": "Free shipping",
"description": "Free shipping is a special method which can be triggered with coupons and minimum spends.",
"_links": {
"self": [...], // 1 items
"collection": [...] // 1 items
}
},
{
"id": "local_pickup",
"title": "Local pickup",
"description": "Allow customers to pick up orders themselves. By default, when using local pickup store base taxes will apply regardless of customer address.",
"_links": {
"self": [...], // 1 items
"collection": [...] // 1 items
}
}
]

 

Create A Product Review

This action is used to create a review for a product.

 

 

Following response payload is received.

 

{
"id": 66,
"date_created": "2023-04-15T02:02:44",
"date_created_gmt": "2023-04-15T02:02:44",
"product_id": 375,
"product_name": "DNK Black Shoes",
"product_permalink": "https://shop.businessautomated.io/product/dnk-black-shoes",
"status": "approved",
"reviewer": "John Jigga",
"reviewer_email": "jigga69@gmail.com",
"review": "This is a very good product, me likes",
"rating": 4,
"verified": false,
"reviewer_avatar_urls": {
"24": "https://secure.gravatar.com/avatar/fbe4f4181cb19f28ab07c9b4967048ab?s=24&d=mm&r=g",
"48": "https://secure.gravatar.com/avatar/fbe4f4181cb19f28ab07c9b4967048ab?s=48&d=mm&r=g",
"96": "https://secure.gravatar.com/avatar/fbe4f4181cb19f28ab07c9b4967048ab?s=96&d=mm&r=g"
}
}

 

Search Product Reviews

This action is used to fetch product reviews using various filters and parameters.

 

 

Following response payload is received.

 

[
{
"id": 66,
"date_created": "2023-04-15T02:02:44",
"date_created_gmt": "2023-04-15T02:02:44",
"product_id": 375,
"product_name": "DNK Black Shoes",
"product_permalink": "https://shop.businessautomated.io/product/dnk-black-shoes",
"status": "approved",
"reviewer": "John Jigga",
"reviewer_email": "jigga69@gmail.com",
"review": "<p>This is a very good product, me likes</p> ",
"rating": 4,
"verified": false,
"reviewer_avatar_urls": {
"24": "https://secure.gravatar.com/avatar/fbe4f4181cb19f28ab07c9b4967048ab?s=24&d=mm&r=g",
"48": "https://secure.gravatar.com/avatar/fbe4f4181cb19f28ab07c9b4967048ab?s=48&d=mm&r=g",
"96": "https://secure.gravatar.com/avatar/fbe4f4181cb19f28ab07c9b4967048ab?s=96&d=mm&r=g"
},
"_links": {
"self": [...], // 1 items
"collection": [...], // 1 items
"up": [...] // 1 items
}
}
]

 

 

WooCommerce Native Triggers

Woocommerce integrates natively with OCP to provide webhook triggers. These triggers are triggered whenever an event is carried out on the woocommerce store either via an api or directly from the store.

 

WooCommerce support following native triggers

 

Order Creation

This trigger is fired whenever an order is created on woocommerce store either via an api or directly from store.

 

 

Following response payload is received.

 

 

{
"id": 4599,
"parent_id": 0,
"status": "pending",
"currency": "AUD",
"version": "6.9.4",
"prices_include_tax": false,
"date_created": "2023-04-14T18:13:13",
"date_modified": "2023-04-14T18:13:13",
"discount_total": "0.00",
"discount_tax": "0.00",
"shipping_total": "0.00",
"shipping_tax": "0.00",
"cart_tax": "0.00",
"total": "175.00",
"total_tax": "0.00",
"customer_id": 4,
"order_key": "wc_order_yhGfOfZ0eoCYe",
"billing": {
"first_name": "",
"last_name": "",
"company": "",
"address_1": "",
"address_2": "",
"city": "",
"state": "",
"postcode": "",
"country": "",
"email": "mark@OCP.com",
"phone": ""
},
"shipping": {
"first_name": "",
"last_name": "",
"company": "",
"address_1": "",
"address_2": "",
"city": "",
"state": "",
"postcode": "",
"country": "",
"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": "4599",
"meta_data": [
],
"line_items": [
{
"id": 260,
"name": "DNK Black Shoes - blue",
"product_id": 375,
"variation_id": 4120,
"quantity": 1,
"tax_class": "",
"subtotal": "175.00",
"subtotal_tax": "0.00",
"total": "175.00",
"total_tax": "0.00",
"taxes": [...], // 0 items
"meta_data": [...], // 1 items
"sku": "",
"price": 175,
"image": {...}, // 2 keys
"parent_name": "DNK Black Shoes"
}
],
"tax_lines": [
],
"shipping_lines": [
],
"fee_lines": [
],
"coupon_lines": [
],
"refunds": [
],
"payment_url": "https://shop.businessautomated.io/checkout-2/order-pay/4599?pay_for_order=true&key=wc_order_yhGfOfZ0eoCYe",
"is_editable": true,
"needs_payment": true,
"needs_processing": true,
"date_created_gmt": "2023-04-14T18:13:13",
"date_modified_gmt": "2023-04-14T18:13:13",
"date_completed_gmt": null,
"date_paid_gmt": null,
"currency_symbol": "$"
}

 

Order Update

This trigger is fired whenever an order is updated in woocommerce store either via an api or directly from the store itself.

 

 

Following response payload is received.

 

 

{
"id": 4597,
"parent_id": 0,
"status": "completed",
"currency": "AUD",
"version": "6.9.4",
"prices_include_tax": false,
"date_created": "2023-04-14T11:01:51",
"date_modified": "2023-04-14T18:16:14",
"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": "2023-04-14T18:16:14",
"date_paid": "2023-04-14T18:16:14",
"cart_hash": "",
"number": "4597",
"meta_data": [
{
"id": 6465,
"key": "user_ns",
"value": "f12372u15376836"
},
{
"id": 6499,
"key": "_new_order_email_sent",
"value": "true"
}
],
"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": "DNK Black Shoes"
}
],
"tax_lines": [
],
"shipping_lines": [
],
"fee_lines": [
],
"coupon_lines": [
],
"refunds": [
],
"payment_url": "https://shop.businessautomated.io/checkout-2/order-pay/4597?pay_for_order=true&key=wc_order_5hKQmDkxUiesi",
"is_editable": false,
"needs_payment": false,
"needs_processing": true,
"date_created_gmt": "2023-04-14T11:01:51",
"date_modified_gmt": "2023-04-14T18:16:14",
"date_completed_gmt": "2023-04-14T18:16:14",
"date_paid_gmt": "2023-04-14T18:16:14",
"currency_symbol": "$"
}

User Creation Using Triggers

OCP identifies the information coming from the trigger payload and matches it with the existing bot users. If found , the flow is executed for that user. If the user is not found then a user is created using the information that comes with in payload.

If email and phone are both available then a user is created under Web channel, if only email is available then user is still created under Web channel. If phone only is available then the user is created as Whatsapp channel.

If the above required minimum information does not come with the payload, then the trigger is unable to either identify or create a user and hence the trigger is not fired.

 

 

WooCommerce Native Integration Course

 

 

 

 


    • Related Articles

    • Error with Woocommerce Action

      If you are having an issue with Woocommerce action: Get customer information Create customer It’s most likely you are seeing the below error message: It’s because the permission of your Woocommerce integration, you need to give “Read & Write” right ...
    • Intercom

      Intercom is a popular live chat platform, OCP integration with Intercom will help reduce 80% of the support through chatbot automation & A.I. Key Benefits Solve the customer's support issues in the chatbot automation and Google Artificial ...
    • Intercom (integration)

      Intercom is a popular live chat platform, OCP integration with Intercom will help reduce 80% of the support through chatbot automation & A.I. Key Benefits Solve the customer's support issues in the chatbot automation and Google Artificial ...