NAV
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

Jul 4, 2023

Order API

Apr 28, 2023

Product API

Mar 10, 2023

Product API

Jul 1, 2022

Product API

Jun 10, 2022

May 10, 2021

Product API

Apr 20, 2021

Order API

Mar 24, 2021

Order API

Aug 13, 2020

Product API

Jun 4, 2020

Order API

Apr 16, 2019

Product API

Jan 23, 2019

API URL

Dec 19, 2018

Product API

Logistics API

Order API

Nov 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/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."
}

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
length integer Product length in cm
width integer Product width in cm
height integer Product height in cm
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
products_virtual integer Virtual Product (No Shipping Charge), refer to Add/Update Product
nonhalal integer Nonhalal Product, refer to Add/Update Product
18age integer 18 age+ Product, 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
weight_prefix char Option value weight prefix
weight decimal Option value weight
qty integer Option value quantity

Response Error

No Description
1 ERROR: Invalid parameter - created_before
2 ERROR: Invalid parameter - created_after
3 ERROR: Invalid parameter - offset
4 ERROR: Invalid parameter - limit
5 ERROR: Invalid parameter - sku_list must be an array
6 ERROR: Invalid parameter - maximum sku_list limit is 100

Add/Update Product

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
}

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
length integer - No Product length in cm
width integer - No Product width in cm
height integer - No Product height in cm
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: 1
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
products_virtual integer Default: 0
0: No
1: Yes
No Virtual Product (No Shipping Charge)
nonhalal integer Default: 0
0: No
1: Yes
No Nonhalal Product
18age integer Default: 0
0: No
1: Yes
No 18 age+ Product
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 250 characters Yes Option name
value array - Yes Option values, see option values parameters

Option Values Parameters

Parameter Type Limit Required Description
name array 150 characters 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
weight_prefix char Default: +
+ : additon weight
-: reduction weight
No Option value weight prefix
weight decimal - No Option value weight
qty integer - Yes Option value quantity

Response Parameters

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

Response Error

No Description
1 ERROR: Missing Product details
2 ERROR: Invalid parameter - sku is required
3 ERROR: Invalid parameter - sku maximum characters is 50
4 ERROR: Invalid parameter - title is required
5 ERROR: Invalid parameter - title maximum characters is 255
6 ERROR: Invalid parameter - description is required
7 ERROR: Invalid parameter - price is invalid
8 ERROR: Invalid parameter - status is required
9 ERROR: Invalid parameter - display is required
10 ERROR: Invalid parameter - product_category is invalid
11 ERROR: Invalid parameter - cannot assign product_category to the top level category
12 ERROR: Invalid parameter - title_cn maximum characters is 255
13 ERROR: Invalid parameter - title_bm maximum characters is 255
14 ERROR: Invalid parameter - model maximum characters is 100
15 ERROR: Invalid parameter - qty is invalid
16 ERROR: Invalid parameter - qty must be greater than 0
17 ERROR: Invalid parameter - qty is required
18 ERROR: Invalid parameter - manufacturer maximum characters is 100
19 ERROR: Invalid parameter - keywords maximum characters is 255
20 ERROR: Invalid parameter - weight is invalid
21 ERROR: Invalid parameter - width is invalid
22 ERROR: Invalid parameter - width must be greater than 0
23 ERROR: Invalid parameter - height is invalid
24 ERROR: Invalid parameter - height must be greater than 0
25 ERROR: Invalid parameter - length is invalid
26 ERROR: Invalid parameter - length must be greater than 0
27 ERROR: Invalid parameter - tax is invalid
28 ERROR: Invalid parameter - delivery_days is invalid
29 ERROR: Invalid parameter - special_price is invalid
30 ERROR: Invalid parameter - special_start_date must be in format: YYYY-MM-DD
31 ERROR: Invalid parameter - special_exp_date must be in format: YYYY-MM-DD
32 ERROR: Invalid parameter - available_date must be in format: YYYY-MM-DD
33 ERROR: Invalid parameter - qty_by_option is invalid
34 ERROR: Invalid parameter - options[0] name is required
35 ERROR: Invalid parameter - options[0] value is limit to 250 characters
36 ERROR: Invalid parameter - options[0] value is required
37 ERROR: Invalid parameter - option[0] value.name is required
38 ERROR: Invalid parameter - option[0] value.name is limit to 150 characters
39 ERROR: Invalid parameter - option[0] value.qty is invalid
40 ERROR: Invalid parameter - option[0] value.qty must be greater than 0
41 ERROR: Invalid parameter - option[0] value.qty is required
42 ERROR: Invalid parameter - option[0] value.price_prefix is invalid
43 ERROR: Invalid parameter - option[0] value.price is required
44 ERROR: Invalid parameter - option[0] value.price is invalid
45 ERROR: Invalid parameter - option[0] value.weight_prefix is invalid
46 ERROR: Invalid parameter - option[0] value.weight is invalid
47 ERROR: Invalid parameter - no_stock_checkout is invalid
48 ERROR: Invalid parameter - free_shipping is invalid
49 ERROR: Invalid parameter - products_virtual is invalid
50 ERROR: Invalid parameter - nonhalal is invalid
51 ERROR: Invalid parameter - 18age is invalid
52 ERROR: Invalid parameter - images must be an array
53 ERROR: Invalid parameter - images must contain image url
54 ERROR: Invalid parameter - image url is limit to 255 characters
55 ERROR: Invalid parameter - image url must start with http:// or https://
56 ERROR: Invalid parameter - youtube must be an array
57 ERROR: Invalid parameter - max 9 youtube id is allowed
58 ERROR: Invalid parameter - youtube must contain youtube id
59 ERROR: Invalid parameter - youtube id is limit to 255 characters

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
weight_prefix char Default: +
+ : additon weight
-: reduction weight
No Option value weight prefix
weight decimal - No Option value weight
qty integer - Yes Option value quantity

Response Parameters

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

Response Error

No Description
1 ERROR: Missing Product details
2 ERROR: Invalid parameter - sku is required
3 ERROR: Product sku does not exists
4 ERROR: Invalid parameter - price is invalid
5 ERROR: Invalid parameter - price is required
6 ERROR: Invalid parameter - tax is invalid
7 ERROR: Invalid parameter - special_price is invalid
8 ERROR: Invalid parameter - special_start_date must be in format: YYYY-MM-DD
9 ERROR: Invalid parameter - special_exp_date must be in format: YYYY-MM-DD
10 ERROR: Invalid parameter - display is required
11 ERROR: Invalid parameter - display is invalid
12 ERROR: Invalid parameter - status is required
13 ERROR: Invalid parameter - status is invalid
14 ERROR: Invalid parameter - qty is invalid
15 ERROR: Invalid parameter - qty must be greater than 0
16 ERROR: Invalid parameter - qty is required
17 ERROR: Invalid parameter - option[0] value.name is required
18 ERROR: Invalid parameter - option[0] value.qty is invalid
19 ERROR: Invalid parameter - option[0] value.qty must be greater than 0
20 ERROR: Invalid parameter - option[0] value.qty is required
21 ERROR: Invalid parameter - option[0] value.price_prefix is invalid
22 ERROR: Invalid parameter - option[0] value.price is required
23 ERROR: Invalid parameter - option[0] value.price is invalid
24 ERROR: Invalid parameter - option[0] value.weight_prefix is invalid
25 ERROR: Invalid parameter - option[0] value.weight is invalid
26 ERROR: Invalid parameter - options[0] value is required
27 ERROR: Invalid parameter - options[0] name is required

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

Response Error

No Description
1 ERROR: Missing Product SKU

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

Response Error

No Description
1 ERROR: Invalid parameter - created_before
2 ERROR: Invalid parameter - created_before is required
3 ERROR: Invalid parameter - created_after
4 ERROR: Invalid parameter - created_after is required
5 ERROR: Invalid parameter - created_before should be greater than created_after
6 ERROR: Invalid parameter - range beetween created_before and created_after should be less than 14 days
7 ERROR: Invalid parameter - offset
8 ERROR: Invalid parameter - maximum limit is 50
9 ERROR: Invalid parameter - limit
10 ERROR: Invalid parameter - status

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",
            "order_ref": "PO-00048921",
            "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_method": "Seller Courier",
            "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_method": "Youbeli Courier",
            "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
order_ref string order reference
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_method string order shipping method. Example: Seller Courier, Youbeli Courier, Youbeli 3 hr, Self Pickup
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

Response Error

No Description
1 ERROR: Invalid parameter - orders_id must be an array
2 ERROR: Invalid parameter - orders_id is empty
3 ERROR: Invalid parameter - maximum orders_id is 50

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

Response Error

No Description
1 ERROR: Invalid parameter - order_id
2 ERROR: Invalid parameter - order_product_ids must be an array
3 ERROR: Invalid parameter - order_product_ids

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 for order with shipping method 'Seller Courier'.

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 courier
digital_delivery
self_pickup
Yes Delivery type
courier integer - Yes Courier id, can retrieve from Get Couriers. Required when delivery_type is courier
tracking_number string - Yes delivery tracking number. Required when delivery_type is courier
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.
receiver_email string - Yes Receiver email. Required when delivery_type is digital_delivery and receiver_hp is empty
receiver_hp string - Yes Receiver mobile number. Required when delivery_type is digital_delivery and receiver_email is empty
pickup_name string - Yes Pickup Person name. Required when delivery_type is self_pickup
pickup_ic string - Yes Pickup Person I/C. Required when delivery_type is self_pickup
note_to_customer string - No Note to Customer

Response Parameters

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

Response Error

No Description
1 ERROR: Invalid parameter - order_id
2 ERROR: Invalid - this API only support order with shipping method 'Seller Courier'
3 ERROR: Invalid parameter - order_product_ids must be an array
4 ERROR: Invalid parameter - order_product_ids
5 ERROR: Invalid parameter - delivery_type
6 ERROR: Invalid parameter - courier
7 ERROR: Invalid parameter - tracking_number
8 ERROR: Invalid parameter - receiver_email
9 ERROR: Invalid parameter - receiver_hp
10 ERROR: Invalid parameter - pickup_name
11 ERROR: Invalid parameter - pickup_ic
12 ERROR: Invalid parameter - delivery_datetime
13 ERROR: Invalid order_product_ids[123456]
14 ERROR: Invalid - Order PO-00221644 already updated to order completed

Update order to ready to ship

curl "https://api.youbeli.com/3.0/update_order_readytoship.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_readytoship.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",
    "delivery": {
                "tracking_no": "xxx",
                "delivery_date": "2018-08-03 00:00:00",
                "courier": "GD Express",
                "shipping_label": "https://connect.easyparcel.my/?ac=AWBLabel&id=xxx",
                "tracking_url": "https://easyparcel.com/my/en/track/details/?courier=Pgeon-Delivery&awb=xxx"
            }
}

This endpoint update order product to ready to ship.

Request URL

POST https://api.youbeli.com/3.0/update_order_readytoship.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
ship_by_youbeli integer Default: 0
0: No
1: Yes
No Order ship by Youbeli, currently support shipping method 'Youbeli Courier' only
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
delivery array includes tracking no, courier, delivery date and shipping label

Response Error

No Description
1 ERROR: Invalid parameter - order_id
2 ERROR: Invalid parameter - order_product_ids must be an array
3 ERROR: Invalid parameter - order_product_ids

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

Response Error

No Description
1 ERROR: Invalid parameter - order_id
2 ERROR: Invalid parameter - order_product_ids must be an array
3 ERROR: Invalid parameter - order_product_ids
4 ERROR: Invalid order_product_ids[123456]
5 ERROR: Invalid - Order PO-00221644 already updated to order completed