# WooCommerce

## Integrating with WooCommerce (WordPress)

In order to import orders directly into Wakilni portal from your WooCommerce (WordPress) project, please follow the steps below:

### Prerequisite

1. WordPress project
2. WooCommerce plugin used for your shop
3. Wakilni account

### Steps

1. Generate WooCommerce/Wakilni key

   1. Click on **WooCommerce** on the left menu side, then click on **Settings**, then choose **Advanced** tab.\
      Click on **Rest API**, then **Add Key** and add the below details:

      * **Description:** Wakilni
      * **User:** *Leave it as it is*
      * **Permission:** Read Write

      <figure><img src="https://3381381143-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4xqCEYxcz3jqSLeeThRF%2Fuploads%2FBY3jTjCshEC96S2Bhda1%2Fimage.png?alt=media&#x26;token=01ade7c2-5635-4ca8-b852-1bf44e20024f" alt=""><figcaption></figcaption></figure>

      * Click on **Generate API Key**

      <figure><img src="https://3381381143-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4xqCEYxcz3jqSLeeThRF%2Fuploads%2FpSxXpcHAuEaLW9KajnYY%2Fimage.png?alt=media&#x26;token=6557c528-0d5b-4934-bd4f-252bb141d988" alt=""><figcaption></figcaption></figure>
   2. After clicking on **Generate API Key** and before closing the above page, open your Wakilni Portal, click on **Settings** on the left menu side, click on **App Tokens**, then click on **Add Thirdparty App** button and add the below details:
      * **Thirdparty app:** WooCommerce
      * **Shop:** *(The website URL, example: <https://www.wakilni.com/>)*
        * Make sure the URL ends with "/"
      * **Key:** *(paste the **Customer Key** in here)*
      * **Secret:** *(paste the **Customer Secret** in here)*

   **NOTE:** Below sections require yearly subscription to the plugin. For more info, check the following link <https://www.zorem.com/product/woocommerce-advanced-shipment-tracking>

2. Download needed plugin in your WordPress website

   1. Click on **Plugins** on the left side menu
   2. click **Add New** button
   3. Search: **woo-advanced-shipment-tracking**
   4. Choose **Advanced Shipment Tracking for WooCommerce**, click **Install Now** then **Activate** buttons
   5. Plugin will be downloaded successfully

   <figure><img src="https://3381381143-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4xqCEYxcz3jqSLeeThRF%2Fuploads%2FNY884A5OFyBBaGbh86lR%2Fimage.png?alt=media&#x26;token=4bf03b09-9c12-47b7-b4eb-4a4d9d8ab86b" alt=""><figcaption></figcaption></figure>

3. Configure **Fullfillement Settings**

   1. click **WooCommerce** on the left side menu
   2. click om **Shipment Tracking** on the left side menu
   3. Open **Settings** tab
   4. Expand **Order Statuses & Notifications** section and change configuration as below:
   5. Change configuration as below:

   <figure><img src="https://3381381143-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4xqCEYxcz3jqSLeeThRF%2Fuploads%2Fn23uS5v8h0MeTlyAcCiD%2FShipment%20Tracking.png?alt=media&#x26;token=1258a3ee-6ff2-47f3-9552-87479bbac785" alt=""><figcaption></figcaption></figure>

   1. Expand **Shipment Tracking API** and change configuration as below:

   <figure><img src="https://3381381143-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4xqCEYxcz3jqSLeeThRF%2Fuploads%2FyhobySYTwtjeBDh5ZgmP%2FShipment%20tracking%20API.png?alt=media&#x26;token=5a43f0c5-9843-4bd1-9f30-751b76565341" alt=""><figcaption></figcaption></figure>

4. &#x20;(Optional) If you have the paid version of the Plugin, add Wakilni as a Custom Shipping Carrier

   1. Go to **Shipping Carriers** Section next to **Settings**
   2. Click on **the three dots** on the right side of the page next to Shipping Carriers

   <figure><img src="https://3381381143-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4xqCEYxcz3jqSLeeThRF%2Fuploads%2FH7LA15L4QOhVlhpUzQjv%2FAdding%20Shipping%20Carrier.png?alt=media&#x26;token=aa0e5295-46f9-4ca7-b594-3d95a8f74eb6" alt=""><figcaption></figcaption></figure>

   1. Add below information:

      1. **Shipping Carrier:** Wakilni
      2. **Custom Display Name:** Wakilni
      3. **Shipping Country:** Lebanon
      4. **Image:** *You can add Wakilni logo*
      5. **Tracking URL:** [https://portal.wakilni.com/orders/%number% ](https://portal.wakilni.com/orders/%number%)

      Then click on the **Submit** button

<figure><img src="https://3381381143-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4xqCEYxcz3jqSLeeThRF%2Fuploads%2FHvwrzJKihUZJItuLcPgo%2Fimage.png?alt=media&#x26;token=a2a0a547-bf6e-4ca4-96a2-1ed12f749e46" alt=""><figcaption></figcaption></figure>

### The Flow

Whenever a new order created on your **WordPress Shop**, it will directly be shown in **Wakilni Portal** under **Thirparty -> Shop URL (WooCommerce) -> Unshipped**. Here you will find all your unhandled orders with Wakilni. You should fix the data and select multiple or one by one to send shipment request.

Your job is done, now Wakilni will handle your request.

### Statuses Used

In order to track the orders, you will have 4 statuses:

**`Processing`** Order is created and waiting you to handle shipping through Wakilni, the payment is paid by credit card, or the payment is on delivery.

**`Partially Shipped`** You have created this order in Wakilni portal and currently Wakilni is handling your order.

**`Delivered`** This order is delivered to the shopper. But you didn’t get your money from Wakilni yet.

**`Completed/Shipped`** This status you will set it manually from your shop. Whenever you get your piggy bank from Wakilni, you will be checking the payments for each order and the order you got your money from you can select multiple orders and set them as shipped. So, you can be sure that these orders are completed, and your money is received.

### Self-Pickup

To set up the self-pickup from Wakilni option, kindly follow the instructions here:&#x20;

{% content-ref url="../release-notes/create-self-pickup-from-wakilni-option-on-woocommerce-july-2023" %}
[create-self-pickup-from-wakilni-option-on-woocommerce-july-2023](https://wiki.wakilni.com/release-notes/create-self-pickup-from-wakilni-option-on-woocommerce-july-2023)
{% endcontent-ref %}
