NAV Navbar
shell php

Introduction

Youbeli Store API V3

This documentation provides an integration guide for Youbeli Seller which want to manage their store using API. Youbeli Store API provides the following functionalities for our partners:

Not a seller yet? Sign Up now.

Changelog

January 23, 2019

API URL

December 19, 2018

Product API

Logistics API

Order API

November 16, 2018

Order API

Authentication

Authentication

curl <api-endpoint>
  -H "Content-Type: application/json; charset=UTF-8"
$headers = array('Content-Type: application/json; charset=UTF-8');
$data = array(
  'sku' => 'testing',
  'timestamp' => time(),
  'store_id' => 123,
);
$sign = hash_hmac('sha256', json_encode($data), <secret-key>);
$data['sign'] = $sign;

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, <api-endpoint>);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_ENCODING, 'UTF-8');
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
$result = curl_exec($ch);

JSON request body:

{
  "sku": "testing",
  "timestamp": 1533704044,
  "store_id": 123,
  "sign": "e1f415f44d78a323d9befe1ef9db9f6da78f2d0b97c64b71c1add3326c9ec91a"
}

Youbeli Store API use HMAC-SHA256 signature to authenticate HTTP request. All endpoints must be called with "HTTPS". The request and response format is JSON. Therefore, the request header has to include Content-Type: application/json.

Signature base string

The signature base string will be your JSON body/data to request. For example:

{"sku":"testing","timestamp":1533702697,"store_id":123}

Secret key/API key

A secret key/API key is provided by Youbeli to Seller. It comes with store id. Please keep the key as secret as your account password. Never disclose the key to anyone else.

Calculating the signature

Use the key provided and signature base string to calculate signature using HMAC-SHA256 hashing algorithm. The output signature is a binary string. Youbeli Store API use signature to authenticate a request. Example signature:

e1f415f44d78a323d9befe1ef9db9f6da78f2d0b97c64b71c1add3326c9ec91a

Add signature to JSON request body

Finally, add the signature as "sign" to request body and make request. For example:

{"sku":"testing","timestamp":1533703408,"store_id":123,"sign":"e1f415f44d78a323d9befe1ef9db9f6da78f2d0b97c64b71c1add3326c9ec91a"}

This will be your final HTTP request body to POST.

Response Definition

Response status

Status Description
-1 Authentication failed
0 The request has error, see message for details
1 The request is success
500 Internal system error

Category API

Get category

curl "https://api.youbeli.com/3.0/get_category.php"
  -H "Content-Type: application/json; charset=UTF-8"
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.youbeli.com/3.0/get_category.php");
<other-curl-options>
$result = curl_exec($ch);

JSON request body:

{
    "store_id": 123,
    "timestamp": 1543213898,
    "sign": "0f4dca0e6f2238b0a8ee9df373ea205234da0ebc6fb6bc6d5953ab6f06ada17f"
}

JSON response body:

{
    "status": 1,
    "category": [
        {
            "id": "7",
            "parent_id": "0",
            "level": "0",
            "name": "Electronics"
        },
        {
            "id": "3",
            "parent_id": "0",
            "level": "0",
            "name": "Gaming"
        },
        {
            "id": "757",
            "parent_id": "569",
            "level": "5",
            "name": "Turnbuckles"
        },
    ]
}

Call this endpoint to get Youbeli category

Request URL

POST https://api.youbeli.com/3.0/get_category.php

Request Parameters

Parameter Type Limit Required Description
store_id integer - Yes Unique identifier for a shop
timestamp timestamp - Yes This is to indicate the timestamp of the request. Required for all requests.

Response Parameters

Parameter Type Description
status integer the status of request. See Response Definition
category array the orders, see category parameters

Category Parameters

Parameter Type Description
id integer category id
parent_id integer the parent category id of this category
level integer the level of the category path
name string the category name

Products API

Get Products

curl "https://api.youbeli.com/3.0/update_product.php"
  -H "Content-Type: application/json; charset=UTF-8"
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.youbeli.com/3.0/update_product.php");
<other-curl-options>
$result = curl_exec($ch);

JSON request body:

{
    "limit": 50,
    "offset": 0,
    "sku_list": [
        "ABC-ITEM",
        "ITEM1",
        "ITEM2",
        "item3",
    ],
    "store_id": 123,
    "timestamp": 1543213379,
    "sign": "da838a06132f7d104b1f784d3256a2713c6b57db3dd119a079b08f145f4fb6e4"
}

JSON response body:

{
    "status": 1,
    "total_products": "572",
    "products": [
        {
            "sku": "DBG-548",
            "model": "",
            "approval_status": "Unapproved",
            "title": "",
            "description": "",
            "highlight": "",
            "title_bm": "",
            "description_bm": "",
            "highlight_bm": "",
            "title_cn": "",
            "description_cn": "",
            "highlight_cn": "",
            "manufacturer": "Pet Shop&reg;",
            "keywords": "petshop, cute, adorable, dog, cat, puppy, kitten, colourful, cotton, bag",
            "price": "77.0000",
            "tax": "0",
            "available_date": "0000-00-00 00:00:00",
            "special_price": null,
            "special_start_date": null,
            "special_exp_date": null,
            "status": "4",
            "display": "0",
            "weight": "0.30",
            "product_category": null,
            "qty": "-18",
            "qty_by_option": "0",
            "no_stock_checkout": "0",
            "delivery_days": "3",
            "free_shipping": "0",
            "images": [],
            "youtube": [],
            "options": [],
            "date_added": "2010-03-20 09:50:22",
            "last_modified": "2014-05-30 10:15:26"
        }
    ],
    "more": 1
}

Call this endpoint to get product details.

Request URL

POST https://api.youbeli.com/3.0/get_products.php

Request Parameters

Parameter Type Limit Required Description
offset integer Default: 0 No total products to skip
limit integer Default: 50, max 50 No total products to retrieve
created_after timestamp - No retrieve products that created after or on the specified date
created_before timestamp - No retrieve products that created before or on the specified date
sku_list array max 100 No retrieve products for specified sku
store_id integer - Yes Unique identifier for a shop
timestamp timestamp - Yes This is to indicate the timestamp of the request. Required for all requests.

Response Parameters

Parameter Type Description
status integer the status of request. See Response Definition
total_products integer the number of total products
products array array contains products, see Products Parameters below
more boolean indicate whether the products is more the limit. If this value is true, you may want to continue to call by changing offset.

Products Parameters

Parameter Type Description
sku string Unique product identifier
model string Product model
approval_status string Product approval status
title string Product name (English)
description string Product description (English
highlight string Product highlights (English)
title_cn string Product name (Chinese)
description_cn string Product description (Chinese)
highlight_cn string Product highlights (Chinese)
title_bm string Product name (Malay)
description_bm string Product description (Malay)
highlight_bm string Product highlights (Malay)
manufacturer string Product manufacturer
keywords string Product keywords
price decimal Product price
tax char Product tax, refer to Add/Update Product
special_price decimal Product special price
special_start_date date Special price start date
special_exp_date date Special price expiry date
available_date date Product available date
status integer Product status, refer to Add/Update Product
display integer Display product, refer to Add/Update Product
weight decimal Product weight in kg
product_category Youbeli Category ID, refer to Category API
qty integer Product quantity
qty_by_option integer Product options quantity as product quantity, refer to Add/Update Product
no_stock_checkout integer Allow checkout if stock insufficient, refer to Add/Update Product
delivery_days integer Maximum delivery days, refer to Add/Update Product
free_shipping integer Product shipping, refer to Add/Update Product
images array Product Images
youtube array Product Youtube ID
options array Product Options, see options parameters below
date_added date Product added date
last_modified date Product last modified date

Options Parameters

Parameter Type Description
name string Option name
value array Option values, see option values parameters below

Option Values Parameters

Parameter Type Description
name array Option value name
sku string Unique product option identifier
price_prefix char Option value price prefix
price decimal Option value price
qty integer Option value quantity

Add/Update Product

curl "https://api.youbeli.com/3.0/get_products.php"
  -H "Content-Type: application/json; charset=UTF-8"
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.youbeli.com/3.0/get_products.php");
<other-curl-options>
$result = curl_exec($ch);

JSON request body:

{
    "product": {
        "sku": "Product sku",
        "title": "Product name",
        "description": "This is Product Description...",
        "title_cn": "\u5546\u54c1 - optional",
        "description_cn": "\u5546\u54c1\u63cf\u8ff0... - optional",
        "title_bm": "Produk BM - optional",
        "description_bm": "Ini adalah Penerangan Produk...",
        "model": "model - optional",
        "manufacturer": "Samsung",
        "keywords": "optional",
        "price": "88.88",
        "tax": 0,
        "special_price": "68.88",
        "special_start_date": "2017-08-18",
        "special_exp_date": "2018-08-18",
        "available_date": "2016-08-18",
        "status": 4,
        "display": 1,
        "weight": "0.500",
        "product_category": "848",
        "qty": 8,
        "qty_by_option": "0",
        "delivery_days": 14,
        "no_stock_checkout": "1",
        "free_shipping": "0",
        "images": [
            "https://www.exampleimage.com/image/imagename.jpg",
            "https://www.exampleimage.com/image/imagename1.jpg",
            "https://www.exampleimage.com/image/imagename2.jpg"
        ],
        "youtube": [
            "tK7CKArARPA",
            "eI4uHI1TLzs"
        ],
        "options": [
            {
                "name": "Color",
                "value": [
                    {
                        "name": "Blue",
                        "sku": "blue",
                        "price_prefix": "+",
                        "price": "1.2",
                        "qty": "5"
                    },
                    {
                        "name": "Red",
                        "sku": "red",
                        "price_prefix": "+",
                        "price": "0.00",
                        "qty": "10"
                    }
                ]
            }
        ]
    },
    "timestamp": 1433712916,
    "store_id": 123,
    "sign": "8eed675d54a3708a18bab2ef1367755eca281618087694ca9a404525d5d1ef8b"
}

JSON response body:

{
    "status": 1,
    "message": "Product added successfully."
}

This endpoint create or update a product.

Request URL

POST https://api.youbeli.com/3.0/update_product.php

Request Parameters

Parameter Type Limit Required Description
product array - Yes see Product Parameters
store_id integer - Yes Unique identifier for a shop
timestamp timestamp - Yes This is to indicate the timestamp of the request. Required for all requests.

Product Parameters

Parameter Type Limit Required Description
sku string 50 characters Yes Unique product identifier
title string 255 characters Yes Product name (English)
description string - Yes Product description (English
highlight string - No Product highlights (English)
title_cn string 255 characters No Product name (Chinese)
description_cn string - No Product description (Chinese)
highlight_cn string - No Product highlights (Chinese)
title_bm string - No Product name (Malay)
description_bm string - No Product description (Malay)
highlight_bm string - No Product highlights (Malay)
model string 100 characters No Product model
manufacturer string 100 characters No Product manufacturer
keywords string, separate by comma 255 characters No Product keywords
price decimal - Yes Product price include GST
tax char Default: 0
0: None
1: GST
Z: Zero Rated
E: Exempted
No Product tax
special_price decimal - No Product special price include GST
special_start_date date Date format: YYYY-MM-DD No Special price start date
special_exp_date date Date format: YYYY-MM-DD No Special price expiry date
available_date date Date format: YYYY-MM-DD No Product available date
status integer 1: Available Now
2: Catalog
3: Pre-Order
4: Coming Soon
5: Out of Stock
Yes Product status
display integer 0: Inactive
1: Active
Yes Display product
weight decimal - No Product weight in kg
product_category integer Cannot assign to the top level category Yes Youbeli Category ID. You can obtain ID from Category API
qty integer - Yes Product quantity
qty_by_option integer Default: 0
0: No
1: Yes
No Product options quantity as product quantity
no_stock_checkout integer Default: 0
0: Allow
1: Not Allow
No Allow checkout if stock insufficient
delivery_days integer Default: 7
1: 24 business hours
2: 48 business hours
3: 2-4 days
7: 3-7 days
14: 1 to 2 weeks
30: 2 to 4 weeks
No Maximum delivery days
free_shipping integer Default: 0
0: Shipping required
2: Free Shipping to West M'sia
3: Free Shipping within M'sia
No Product shipping
images array Max 9 images, must be a URL, 255 characters No Product Images
youtube array Max 9 youtube id No Product Youtube ID
options array - Yes Product Options, see options parameters

Options Parameters

Parameter Type Limit Required Description
name string - Yes Option name
value array - Yes Option values, see option values parameters

Option Values Parameters

Parameter Type Limit Required Description
name array - Yes Option value name
sku string - No Option value sku
price_prefix char Default: +
+ : additon price
-: reduction price
No Option value price prefix
price decimal - Yes Option value price
qty integer - Yes Option value quantity

Response Parameters

Parameter Type Description
status integer the status of request. See Response Definition
message string response message

Update Product Price & Inventory

curl "https://api.youbeli.com/3.0/update_product_price_inventory.php"
  -H "Content-Type: application/json; charset=UTF-8"
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.youbeli.com/3.0/update_product_price_inventory.php");
<other-curl-options>
$result = curl_exec($ch);

JSON request body:

{
    "product": {
        "sku": "testing",
        "price": "77.77",
        "tax": 0,
        "special_price": "33.33",
        "special_start_date": "2018-06-01",
        "special_exp_date": "2018-12-01",
        "status": 1,
        "display": 1,
        "qty": 32,
        "options": [
            {
                "name": "Color",
                "value": [
                    {
                        "name": "Blue",
                        "sku": "blue",
                        "price_prefix": "+",
                        "price": "0",
                        "qty": "10"
                    },
                    {
                        "name": "Red",
                        "sku": "red",
                        "price_prefix": "+",
                        "price": "0.00",
                        "qty": "20"
                    }
                ]
            }
        ]
    },
    "timestamp": 1433714403,
    "store_id": 123,
    "sign": "ee10c480a2b7e875bd4dd746a152f9bcdecef8c7a5e7ff4f86a085cb1d738145"
}

JSON response body:

{
    "status": 1,
    "message": "Product updated successfully."
}

This endpoint allows update product price and quantity.

Request URL

POST https://api.youbeli.com/3.0/update_product_price_inventory.php

Request Parameters

Parameter Type Limit Required Description
product array - Yes see Product Parameters
store_id integer - Yes Unique identifier for a shop
timestamp timestamp - Yes This is to indicate the timestamp of the request. Required for all requests.

Product Parameters

Parameter Type Limit Required Description
sku string - Yes Unique product identifier
price decimal - Yes Product price include GST
tax char Default: 0
0: None
1: GST
Z: Zero Rated
E: Exempted
No Product tax
special_price decimal - No Product special price include GST
special_start_date date Date format: YYYY-MM-DD No Special price start date
special_exp_date date Date format: YYYY-MM-DD No Special price expiry date
display integer 0: Inactive
1: Active
Yes Display product
status integer 1: Available Now
2: Catalog
3: Pre-Order
4: Coming Soon
5: Out of Stock
Yes Product status
qty integer - Yes Product quantity
qty_by_option integer Default: 0
0: No
1: Yes
No Product options quantity as product quantity
options array - Yes Product Options, see options parameters

Options Parameters

Parameter Type Limit Required Description
name string - Yes Option name
value array - Yes Option values, see option values parameters

Option Values Parameters

Parameter Type Limit Required Description
name array - Yes Option value name
sku string - No Option value sku
price_prefix char Default: +
+ : additon price
-: reduction price
No Option value price prefix
price decimal - Yes Option value price
qty integer - Yes Option value quantity

Response Parameters

Parameter Type Description
status integer the status of request. See Response Definition
message string response message

Delete product

curl "https://api.youbeli.com/3.0/delete_product.php"
  -H "Content-Type: application/json; charset=UTF-8"
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.youbeli.com/3.0/delete_product.php");
<other-curl-options>
$result = curl_exec($ch);

JSON request body:

{
    "sku": "testing",
    "timestamp": 1433714575,
    "store_id": 123,
    "sign": "858cc77a31a698c021c040b6d75132418a123afeb288bc05d8e375d1346a1384"
}

JSON response body:

{
    "status": 1,
    "message": "Product deleted successfully."
}

This endpoint delete a product.

Request URL

POST https://api.youbeli.com/3.0/delete_product.php

Request Parameters

Parameter Type Limit Required Description
sku string - Yes Unique product identifier
store_id integer - Yes Unique identifier for a shop
timestamp timestamp - Yes This is to indicate the timestamp of the request. Required for all requests.

Response Parameters

Parameter Type Description
status integer the status of request. See Response Definition
message string response message

API Update

curl "https://api.youbeli.com/3.0/api_update.php?sID=<store-id>"
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.youbeli.com/3.0/api_update.php?sID=<store-id>");
<other-curl-options>
$result = curl_exec($ch);

After calling any Product API endpoints, the changes will not take effect immediately. To see changes immediately, you must call this endpoint

Request URL

GET https://api.youbeli.com/3.0/api_update.php?sID=<store-id>

Query Parameters

This endpoint use GET method, pass your store id as parameter.

Response Parameters

This endpoint has no response.

Logistics API

Get Couriers

curl "https://api.youbeli.com/3.0/get_couriers.php"
  -H "Content-Type: application/json; charset=UTF-8"
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.youbeli.com/3.0/get_couriers.php");
<other-curl-options>
$result = curl_exec($ch);

JSON request body:

{
    "store_id": 123,
    "timestamp": 1543214069,
    "sign": "6ff5e7a4f5b076f5efb4276a706f07ae01647cdf9c92e0deacd3e22957eccb59"
}

JSON response body:

{
    "status": 1,
    "couriers": [
        {
            "courier_id": "15",
            "courier_name": "ABX Express"
        },
        {
            "courier_id": "12",
            "courier_name": "Airpak Express"
        },
        {
            "courier_id": "20",
            "courier_name": "Aramex"
        },
...
    ]
}

Call this endpoint to get couriers list.

Request URL

POST https://api.youbeli.com/3.0/get_couriers.php

Request Parameters

Parameter Type Limit Required Description
store_id integer - Yes Unique identifier for a shop
timestamp timestamp - Yes This is to indicate the timestamp of the request. Required for all requests.

Response Parameters

Parameter Type Description
status integer the status of request. See Response Definition
couriers array array contains courier id and name

Order API

Get orders list

curl "https://api.youbeli.com/3.0/get_orders_list.php"
  -H "Content-Type: application/json; charset=UTF-8"
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.youbeli.com/3.0/get_orders_list.php");
<other-curl-options>
$result = curl_exec($ch);

JSON request body:

{
    "created_after": 1532044800,
    "created_before": 1532476800,
    "status": "DELIVERED",
    "offset": 0,
    "limit": 50,
    "timestamp": 1533716970,
    "store_id": 123,
    "sign": "146b3c5244318363f708372fac62ab137492895d1a56b6f3971051f42773559d"
}

JSON response body:

{
    "status": 1,
    "orders": [
        {
            "order_id": "48331",
            "order_status": "DELIVERED"
        },
        {
            "order_id": "57231",
            "order_status": "DELIVERED"
        },
        {
            "order_id": "58899",
            "order_status": "DELIVERED"
        }
    ],
    "more": 0
}

This endpoint get orders list. This only return order id and status only. To get order details, call Get order details API.

Request URL

POST https://api.youbeli.com/3.0/get_orders_list.php

Request Parameters

Parameter Type Limit Required Description
created_before timestamp - Yes The created_before and created_after specify date range for retrieving orders (based on order creation date). The range between this 2 timestamp should not more than 1209600(14 days)
created_after timestamp - Yes The created_before and created_after specify date range for retrieving orders (based on order creation date). The range between this 2 timestamp should not more than 1209600(14 days)
offset integer Default: 0 No total orders to skip
limit integer Default: 50, max 50 No total orders to retrieve
status string Default: all
PAYMENT_CAPTURED
PAYMENT_RECEIVED
PROCESSING
READY_TO_SHIP
PICKUP_BY_COURIER
DELIVERED
ORDER_COMPLETED
ORDER_CANCELLED
No current order status to retrieve
store_id integer - Yes Unique identifier for a shop
timestamp timestamp - Yes This is to indicate the timestamp of the request. Required for all requests.

Response Parameters

Parameter Type Description
status integer the status of request. See Response Definition
orders array the orders, see orders parameters
more boolean indicate whether the order list is more the limit. If this value is true, you may want to continue to call by changing offset.

Orders Parameters

Parameter Type Description
order_id integer order unique identifier
order_status string current status of order

Get order details

curl "https://api.youbeli.com/3.0/get_order_details.php"
  -H "Content-Type: application/json; charset=UTF-8"
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.youbeli.com/3.0/get_order_details.php");
<other-curl-options>
$result = curl_exec($ch);

JSON request body:

{
    "orders_id": [
        "48921",
        "49912",
        "58990"
    ],
    "store_id": 123,
    "timestamp": 1433718650
}

JSON response body:


{
    "status": 1,
    "orders": [
        {
            "order_id": "48921",
            "customer_name": "customer name",
            "customer_email": "[email protected]",
            "order_status": "Delivered",
            "shipping": {
                "name": "customer name",
                "company": "company Sdn Bhd",
                "street_address": "123, BLOCK 2, PRESINT ALAMI",
                "suburb": "",
                "city": "SHAH ALAM",
                "postcode": "40000",
                "state": "Selangor",
                "country": "Malaysia",
                "telephone": "",
                "handphone": "+6012345678",
                "office": "+60355001122"
            },
            "billing": {
                "name": "customer name",
                "company": "company Sdn Bhd",
                "street_address": "123, BLOCK 2, PRESINT ALAMI",
                "suburb": "",
                "city": "SHAH ALAM",
                "postcode": "40000",
                "state": "Selangor",
                "country": "Malaysia",
                "telephone": "",
                "handphone": "+6012345678",
                "office": "+60355001122"
            },
            "order_date": "2018-07-24 21:54:24",
            "payment_method": "Credit Card",
            "shipping_fee": "0.0000",
            "order_total": "283.0000",
            "products": [
                {
                    "order_product_id": 100093,
                    "name": "product name",
                    "sku": "product sku",
                    "model": "PHP 35123",
                    "price": "14.15",
                    "tax": "0.0000",
                    "selling_price": "14.15",
                    "total_price": "283.00",
                    "quantity": "20",
                    "status": "Delivered"
                }
            ],
            "delivery": {
                "tracking_no": "",
                "delivery_date": "2018-08-03 00:00:00",
                "courier": "GD Express",
                "delivery_products": [
                    {
                        "name": "product name"
                    }
                ]
            }
        },
        {
            "order_id": "58999",
            "customer_name": "customer name",
            "customer_email": "[email protected]",
            "order_status": "Pickup By Courier",
            "shipping": {
                "name": "customer name",
                "company": "",
                "street_address": "No 44 Jln 9B",
                "suburb": "Tmn Sri Rantau",
                "city": "Klang",
                "postcode": "42100",
                "state": "Selangor",
                "country": "Malaysia",
                "telephone": "",
                "handphone": "016-7891234",
                "office": ""
            },
            "billing": {
                "name": "customer name",
                "company": "abc company",
                "street_address": "LEVEL 88 MENARA LGB",
                "suburb": "",
                "city": "KUALA LUMPUR",
                "postcode": "60000",
                "state": "W.P Kuala Lumpur",
                "country": "Malaysia",
                "telephone": "",
                "handphone": "0163456789",
                "office": ""
            },
            "order_date": "2018-07-24 13:24:57",
            "payment_method": "Online Payment - CIMB Clicks",
            "shipping_fee": "0.0000",
            "order_total": "234.9000",
            "products": [
                {
                    "name": "HP Deskjet Ink Advantage 2135 AiO Printer",
                    "model": "HPF5S29B",
                    "price": "234.91",
                    "tax": "0.0000",
                    "selling_price": "234.91",
                    "total_price": "234.91",
                    "quantity": "1",
                    "status": "Delivered"
                }
            ],
            "delivery": {
                "tracking_no": "23845678910",
                "delivery_date": "2018-07-24 14:53:00",
                "courier": "Skynet",
                "delivery_products": [
                    {
                        "name": "HP Deskjet Ink Advantage 2135 AiO Printer"
                    }
                ]
            }
        }
    ]
}

This endpoint get order details

Request URL

POST https://api.youbeli.com/3.0/get_order_details.php

Request Parameters

Parameter Type Limit Required Description
orders_id array max 50 order id Yes list of orders id
store_id integer - Yes Unique identifier for a shop
timestamp timestamp - Yes This is to indicate the timestamp of the request. Required for all requests.

Response Parameters

Parameter Type Description
status integer the status of request. See Response Definition
orders array the orders details, see order details parameters

Order details Parameters

Parameter Type Description
order_id integer the order unique identifier
customer_name string customer name
customer_email string customer email
order_status string current order status
shipping array shipping details, includes shipping name, address, phone
billing array billing details, includes shipping name, address, phone
order_date datetime the order creation date
payment_method string order payment method
shipping_fee decimal shipping fee of the order
order_total decimal total of the order
products array order products details, see order product parameters
delivery array includes tracking no, courier, delivery date and delivery products. One order may have multiple delivery

Order product Parameters

Parameter Type Description
order_product_id integer order product id
name string order product name
sku string order product sku
model string order product model
price decimal selling price of product, this exclude option price
tax integer the tax of order product, in percentage. Example: 6
selling_price decimal selling price of order product, this include option price
total_price decimal total price of order product
quantity integer quantity of order product
status string the status of the order product
attributes array order product option, see order product attributes parameters

Order product attributes Parameters

Parameter Type Description
option string option name
option_value string option value name
option_sku string option value sku
option_price decimal option value price
option_price_prefix char option value price prefix

Update order to processing

curl "https://api.youbeli.com/3.0/update_order_processing.php"
  -H "Content-Type: application/json; charset=UTF-8"
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.youbeli.com/3.0/update_order_processing.php");
<other-curl-options>
$result = curl_exec($ch);

JSON request body:

{
    "order_id": 12345,
    "order_product_ids": [
        109006
    ],
    "store_id": 123,
    "timestamp": 1543214353,
    "sign": "e61608c7c7eec4b633c2eb6cddcd189b862a9c20f66ac09f33ba80bff0763347"
}

JSON response body:

{
    "status": 1,
    "message": "Order status updated"
}

This endpoint update order product to processing.

Request URL

POST https://api.youbeli.com/3.0/update_order_processing.php

Request Parameters

Parameter Type Limit Required Description
order_id integer - Yes The order id to update
order_product_ids array - Yes The order product id to update, can be retrieve from Get order details
store_id integer - Yes Unique identifier for a shop
timestamp timestamp - Yes This is to indicate the timestamp of the request. Required for all requests.

Response Parameters

Parameter Type Description
status integer the status of request. See Response Definition
message string response message

Update order shipment

curl "https://api.youbeli.com/3.0/update_order_shipment.php"
  -H "Content-Type: application/json; charset=UTF-8"
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.youbeli.com/3.0/update_order_shipment.php");
<other-curl-options>
$result = curl_exec($ch);

JSON request body:

{
    "order_id": "12345",
    "order_product_ids": [
        109006
    ],
    "delivery_type": "courier",
    "courier": 1,
    "tracking_number": "MY123456",
    "delivery_datetime": "1542354563",
    "store_id": 123,
    "timestamp": 1543214639,
    "sign": "c11f3512be08dafde8db7cf491f734bedfa926ac4bac95c9cbebd8acb58d8b5f"
}

JSON response body:

{
    "status": 1,
    "message": "Order shipment updated"
}

This endpoint update order product to processing.

Request URL

POST https://api.youbeli.com/3.0/update_order_shipment.php

Request Parameters

Parameter Type Limit Required Description
order_id integer - Yes The order id to update
order_product_ids array - Yes The order product id to update, can be retrieve from Get order details
delivery_type string - Yes Delivery type, currently support 'courier' only
courier integer - Yes Courier id, can retrieve from Get Couriers
tracking_number string - Yes delivery tracking number
delivery_datetime timestamp - Yes delivery timestamp
store_id integer - Yes Unique identifier for a shop
timestamp timestamp - Yes This is to indicate the timestamp of the request. Required for all requests.

Response Parameters

Parameter Type Description
status integer the status of request. See Response Definition
message string response message

Update order to delivered

curl "https://api.youbeli.com/3.0/update_order_delivered.php"
  -H "Content-Type: application/json; charset=UTF-8"
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.youbeli.com/3.0/update_order_delivered.php");
<other-curl-options>
$result = curl_exec($ch);

JSON request body:

{
    "order_id": 12345,
    "order_product_ids": [
        109006
    ],
    "store_id": 123,
    "timestamp": 1543214353,
    "sign": "e61608c7c7eec4b633c2eb6cddcd189b862a9c20f66ac09f33ba80bff0763347"
}

JSON response body:

{
    "status": 1,
    "message": "Order status updated"
}

This endpoint update order product to delivered.

Request URL

POST https://api.youbeli.com/3.0/update_order_delivered.php

Request Parameters

Parameter Type Limit Required Description
order_id integer - Yes The order id to update
order_product_ids array - Yes The order product id to update, can be retrieve from Get order details
store_id integer - Yes Unique identifier for a shop
timestamp timestamp - Yes This is to indicate the timestamp of the request. Required for all requests.

Response Parameters

Parameter Type Description
status integer the status of request. See Response Definition
message string response message