@extends('layouts.master') @section('page_title', 'Woocommerce') @section('title', 'Woocommerce') @section('main_item', 'Woocommerce') @section('sub_item', 'Woocommerce') @section('content')
@if (!empty($alerts['api_connection_fail']))
@elseif (!empty($alerts['api_connection_success']))
@endif

Sync Categories

@if (!empty($alerts['categoryNotSynced'])) @endif

Sync Attributes

@if (!empty($alerts['attributeNotSynced'])) @endif

Sync Products

@if (!empty($alerts['productsNotSynced'])) @endif

Sync Orders

@if (!empty($alerts['salesNotSynced'])) @endif

second_woocommerece_api_setting_enable != '1') style="display: none" @endif>Second Woocommerce


second_woocommerece_api_setting_enable != '1') style="display: none" @endif> @if (!empty($second_alerts['api_connection_fail']))
@elseif (!empty($second_alerts['api_connection_success']))
@endif

Sync Categories

@if (!empty($second_alerts['categoryNotSynced'])) @endif

Sync Attributes

@if (!empty($second_alerts['attributeNotSynced'])) @endif

Sync Products

@if (!empty($second_alerts['productsNotSynced'])) @endif

Sync Orders

@if (!empty($second_alerts['salesNotSynced'])) @endif
Date Sync Type Operation Synced By Records Operation Status Product Sku Sale Invoice No Sale ID
Id Queue Payload Attempts Reserved at Available at Created at
Id Connection Queue Payload Exception Failed at
@csrf
  • Do not refresh or leave the page while synchronizing
  • Timezone of COM should be same as timezone of the Woocommerce App
  • Get WooCommerce API details from, WooCommerce -> Settings -> Advance -> REST API . Enter description, select User & Provide Read/Write Permission Click Here for more info.
  • Change the permalinks option to "Post Name" in WordPress permalink option.
  • To Auto Sync categories, products and orders you must setup a cron job with this command:
    option
    • Set it in cron jobs tab in cpanel or directadmin or similar panel.
    • Or edit crontab if using cloud/dedicated hosting.
    • Or contact hosting for help with cron job settings.
Date Sync Type Operation Synced By Records Operation Status Product Sku Sale Invoice No Sale ID

Introduction

This is the documentation related to the API prepared for the website integration. It has created an API to create, read, update data using requests in JSON format.

Sync Type API Details Response Data(JSON)

Units

URL = http://localhost:8000/api/units;
Type = "GET" Method
API Token = "Your token hear"

Here you can use the URL and TOKEN mentioned above and make a request with the "GET" method to get the data related to the units. You can find the corresponding response from the Response Data (JSON) column. You can know the key related to the response and the description related to the key from the table below.

Key Description
id Units ID
actual_name Units Name
short_name Units Short Name

This is the response data related to your request.

"data": [
{ "id": 1, "actual_name": "Piece", "short_name": "PCS" },
{ "id": 2, "actual_name": "piece", "short_name": "PCS" },
]

Attributes

URL = http://localhost:8000/api/attributes;
Type = "GET" Method
API Token = "Your token hear";

Here you can make a request with the "GET" method using the above mentioned URL and TOKEN and get the data related to Attribute and Attribute value. You can find the corresponding response in the Response Data (JSON) column. You can find the key related to the response and the description related to the key from the table below.

Key Description
attribute_name Attribute Name
attribute_id Attribute ID
id Attribute Value ID
value Attribute value Name

This is the response data related to your request.

"data": [
{ "attribute_id": 1, "attribute_name": "Color", "id": 1, "value": "Black" },
{ "attribute_id": 1, "attribute_name": "Color", "id": 2, "value": "Red" },
]

Categories

URL = http://localhost:8000/api/categories;
Type = "GET" Method
API Token = "Your token hear";

Here you can make a request by "GET" method using the above mentioned URL and TOKEN and get the data related to Category and Sub Category. You can find the corresponding response in the Response Data (JSON) column. You can find the key related to the response and the description related to the key in the table below.

Key Description
category_id Category ID
category_name Category Name
id Sub Category ID
sub_category_name Sub Category Name

This is the response data related to your request.

"data": [
{ "category_id": 1, "category_name": "Baby Set Collection", "id": 1, "sub_category_name": "Baby Girl" },
{ "category_id": 1, "category_name": "Baby Set Collection", "id": 2, "sub_category_name": "Baby Boy" }
]

Products

URL = http://localhost:8000/api/products;
Type = "GET" Method
API Token = "Your token hear";

Here you can make a request by "GET" method using the above mentioned URL and TOKEN and get the data related to Category and Sub Category. You can find the corresponding response in the Response Data (JSON) column. You can find the key related to the response and the description related to the key in the table below.u can make a request by "GET" method using the above mentioned URL and TOKEN and get the data related to Products. Here there are 2 types called single products and variable products. You can find the corresponding response in the Response Data (JSON) c

Key Description
id Product ID
product_name Product Name
product_type Product Type(single or Variyable)
sku Product Sku(unik)
unit_id Product Units ID
category_id Product Category ID
sub_category_id Product Sub Category ID
attribute_id Product Attribute ID
attribute_value_id Product Attribute Value ID
reorder_level Product Reorder level
descrption Product Descrption
qty Product Stock QTY
unit_cost Product Cost Price
unit_price Product Selling Price
second_woocomerece_unit_price Product Second Selling Price

This is the response data related to your request.

"data": [
{ "id": 248,
"product_name": "WERFEGFT",
"product_type": "variable",
"sku": "WM_90 - 1",
"unit_id": 3,
"category_id": 1,
"sub_category_id": 2,
"attribute_id": 17,
"attribute_value_id": 69,
"reorder_level": 3,
"descrption": This is WERFEGFT Product,
"qty": 10,
"unit_cost": 150,
"unit_price": 200,
"second_woocomerece_unit_price": 0
},
{ "id": 249,
"product_name": "WERFEGFT",
"product_type": variable,
"sku": "WM_90 - 2",
"unit_id": 3,
"category_id": 1,
"sub_category_id": 2,
"attribute_id": 17,
"attribute_value_id": 68,
"reorder_level": 3,
"descrption": This is WERFEGFT Product,
"qty": -10,
"unit_cost": 5,
"unit_price": 10,
"second_woocomerece_unit_price": 0
},
{ "id": 291,
"product_name": "Model Product",
"product_type": "single",
"sku": "M_401",
"unit_id": 2,
"category_id": 1,
"sub_category_id": 2,
"attribute_id": null,
"attribute_value_id": null,
"reorder_level": 34,
"descrption": This is Model Product,
"qty": 0,
"unit_cost": 250,
"unit_price": 500,
"second_woocomerece_unit_price": 0
},
]

Stocks

URL = http://localhost:8000/api/stocks;
Type = "GET" Method
API Token = "Your token hear";

Here you can make a request by "GET" method using the above mentioned URL and TOKEN and get the stock data related to the product. You can find the corresponding response in the Response Data (JSON) column. You can find the key related to the response and the description related to the key in the table below.

Key Description
product_id Product ID
qty Product Stock QTY
unit_cost Product Cost price
unit_price Product Selling price
second_woocomerece_unit_price Product Second Selling price

This is the response data related to your request.

"data": [
{ "product_id": 248, "qty": 10, "unit_cost": 5, "unit_price": 10, "second_woocomerece_unit_price": null },
{ "product_id": 249, "qty": 3, "unit_cost": 15, "unit_price": 20, "second_woocomerece_unit_price": null },
]

Order Create

URL = http://localhost:8000/api/create/order;
Type = "POST" Method
API Token = "Your token hear";

Here you can send a request by "POST" method using the above mentioned URL and TOKEN and send the data related to order creation in the following manner and create the order. You can find the corresponding response in the corresponding response data (JSON) column. You can find the key related to the response and the description related to the key in the table below.

"id": 727,
"order_number": "727",
"status": "processing",
"currency": "LKR",
"date_created": "2017-03-22T16:28:02",
"discount_total": "0.00",
"shipping_total": "10.00",
"total": "29.35",
"customer_user_agent": "",
"billing": {
"first_name": "John",
"last_name": "Doe",
"company": "Clicky",
"address_1": "969 Market",
"address_2": "",
"city": "San Francisco",
"state": "CA",
"postcode": "94103",
"country": "US",
"email": "john.doe@example.com",
"phone": "(555) 555-5555"
}, "shipping": {
"first_name": "John",
"last_name": "Doe",
"company": "Clicky",
"address_1": "969 Market",
"address_2": "",
"city": "San Francisco",
"state": "CA",
"postcode": "94103",
"country": "US"
}, "user_agent": {
"id": 1,
"username": "Done",
"email": "Done@gmail.com",
"role": "role"
},
"payment_method": "bacs",
"payment_method_title": "Direct Bank Transfer",
"date_paid": "2017-03-22T16:28:08",
"line_items": [
{
"id": 315,
"name": "Woo Single #1",
"product_id": 248,
"quantity": 2,
"subtotal": "6.00",
"total": "6.00",
"price": 3
},
{ "id": 316,
"name": "Ship Your Idea", "product_id": 249,
"quantity": 1,
"subtotal": "12.00",
"total": "12.00",
"price": 12
}
]

Key Description
id Order ID
order_number Order Number
status Order status (pending, processing, cancelled, on-hold, failed, refunded, completed)
Use only this status when sending the status.
currency Order Currency (Only LKR & USD can be used)
date_created Order Created Date
discount_total Order Discount Total
shipping_total Order Shipping Total
total Order Total Invoice
customer_user_agent User Agent
billing->first_name Customer Frist Name
billing->last_name Customer Last Name
billing->company Customer Company Name
billing->address_1 Customer Address line 1
billing->address_2 Customer Address line 2
billing->city Customer city
billing->state Customer state
billing->postcode Customer postel code
billing->country Customer country code
billing->email Customer Email
billing->phone Customer Phone Number
shipping->first_name Customer Frist Name
shipping->last_name Customer Last Name
shipping->company Customer Company Name
shipping->address_1 Customer Address line 1
shipping->address_2 Customer Address line 2
shipping->city Customer city
shipping->state Customer state
shipping->postcode Customer postel code
shipping->country Customer country code
shipping->first_name Customer Frist Name
user_agent->id User Id
user_agent->username Create User username
user_agent->email Create User email
user_agent->role Create User role
payment_method Order place to Payment Method Code
(cod = cash on delivery
bacs = bank transfer
genie_ipg = online
payhere = online payhere)
payment_method_title Order place to Payment Method Title
date_paid Order Paid Date
date_completed Order Completed Date
line_items->id product ID of website the place order
line_items->name product name of the place order
line_items->product_id product ID of the place order in our product ID
line_items->quantity product quantity of the place order
line_items->subtotal product subtotal of the place order
line_items->total product total of the place order
line_items->price product price of the place order

This is the response data related to your request.

Status Code Response
201 Product ID is Invalid
204 Order Created Successfully
205 Payment Method is Empty
206 Order Status is Empty
207 Order Number is Empty
208 Order Total Amount is Empty
209 Order ID is Empty
209 Order ID is Empty
210 Order created date is Empty
211 Order currency Type is Empty
212 Order Phone Number is Empty
213 Order Status is Invalid
214 Order currency Type is Invalid
215 Order Payment Method is Invalid
216 Agent User ID Can not be Null.

Order Status Change

URL = http://localhost:8000/api/update/order/status;
Type = "POST" Method
API Token = "Your token hear";

Here you can send a request by "POST" method using the above mentioned URL and TOKEN and update the order status by sending the relevant data to update the order status as follows. You can find the corresponding response in the corresponding response data (JSON) column. You can find the key related to the response and the description related to the key in the table below.

{
"id": 727,
"order_number": "727",
"status": "processing",
"payment_method": "genie_ipg",
"payment_method_title": "Direct Bank Transfer"
}
Key Description
id Order ID
order_number Order Number
status Order status (pending, processing, cancelled, on-hold, failed, refunded, completed)
Use only this status when sending the status.
payment_method Order place to Payment Method Code
(cod = cash on delivery
bacs = bank transfer
genie_ipg = online
payhere = online payhere)
payment_method_title Order place to Payment Method Title

This is the response data related to your request.

Status Code Response
203 Order Updated Successfully
205 Payment Method is Empty
206 Order Status is Empty
207 Order Number is Empty
213 Order Status is Invalid
215 Order Payment Method is Invalid

delivery Status

URL = http://localhost:8000/api/delivery/status;
Type = "GET" Method
API Token = "Your token hear"

.

{{-- --}}
Key Description
woocommerce_sale_id Your Website ID
full_waybill_no Tarking Number
status delivery Status
(pending,
dispatched,
returned,
delivered,
canceled)
short_name Units Short Name

This is the response data related to your request.

{ "data": [
{
"woocommerce_sale_id": "251547",
"full_waybill_no": "79",
"status": "returned"
},
{
"woocommerce_sale_id": "7",
"full_waybill_no": "14793390",
"status": "dispatched"
}
]
}

@endsection @section('scripts') @endsection