7. API Integration

The API (Application Programming Interface) of the Dalio servers allow 3rd party software developers to dynamically import and export listings, orders, tracking numbers, as well as their status, in real-time.

For example, if you want to offer your customers auto-ordering, you can connect to Dalio to execute your customers’ orders automatically.

First, you need to have a Partner Account with us. The partner account gives you access to the API service, as well as allowing us to track the purchases your leads and customers make through Dalio, so you participate in the profit-sharing of our network.

Partner accounts are made manually. Contact us, or our representatives. We haven’t turned anyone down, yet 🙂

Let's begin

Endpoint for API requests : https://dalio.io/app/api
Endpoint for Listings : https://dalio.io/app/api/listings
Endpoint for Orders (& Tracking Numbers) : https://dalio.io/app/api/orders

To insert data, you make a POST request.
To retrieve data, you make a GET request.

In the POST body, you include a valid JSON.

Authorization is done using Basic Authorization HTTP Headers with your Partner Account credentials.
You need to include the target user’s email address, so the server knows whos listings you want to update.
You only have permission to modify the listings of your clients, not anybody else’s.

 

Listings

All possible input properties are shown in the examples bellow.

 

							
							
					{
    //always include target user's email address
    user_email:"[CLIENT_EMAIL]",
    //if you make a request to /listings, you need to include a listings array
    listings:[
        "item_name":"Global Version Xiaomi Mi Band 4 Smart Wristband Miband 4 Bracelet Heart Rate Fitness Color Screen Bluetooth 5.0 Chinese Version",
        "image":"https://ae01.alicdn.com/kf/H741e4d87e79243bfad684af1471304c0B/Global-Version-Xiaomi-Mi-Band-4-Smart-Wristband-Miband-4-Bracelet-Heart-Rate-Fitness-Color-Screen.jpg",
        "store_url":"https://www.ebay.co.uk/itm/224049049296",
        "store_id":"224049049296",
        "store":"ebay.co.uk",
        "supplier_url":"https://www.aliexpress.com/item/33034720523.html?spm=a2g01.12617084.fdpcl001.2.55328eFS8eFSbN&gps-id=5547572&scm=1007.19201.130907.0&scm_id=1007.19201.130907.0&scm-url=1007.19201.130907.0&pvid=a2f260d9-a917-4105-b8d9-03e86424bbc2",
        "supplier_id":"33034720523",
        "supplier":"aliexpress.com",
        "supplier_item_name":"Global Version Xiaomi Mi Band 4 Smart Wristband Miband 4 Bracelet Heart Rate Fitness Color Screen Bluetooth 5.0 Chinese Version",
        "product_availability":"10",
        "price":"19.99"
    ]
}				
			

Retrieve user's listings (PHP)

							
							
					<?php

$endpoint = 'https://dalio.io/app/api/listings?user_email=[CLIENT_EMAIL]';

// Set up the HTTP headers
$headers = [
    'Content-Type: application/x-www-form-urlencoded',
    'Authorization: Basic ' . base64_encode("[PARTNER_EMAIL]" . ":" . "[PARTNER_PASS]")
];

$session = curl_init($endpoint); // create a curl session
//curl_setopt($session, CURLOPT_POST, false); // POST request type
curl_setopt($session, CURLOPT_HTTPHEADER, $headers); // set headers using $headers array
//curl_setopt($session, CURLOPT_POSTFIELDS, $request); // set the body of the POST
curl_setopt($session, CURLOPT_RETURNTRANSFER, true); // return values as a string, not to std out

$response = curl_exec($session); // send the request
curl_close($session); // close the session

$resp = json_decode($response);

echo $response;

?>				
			

Update user's listings (PHP)

							
							
					<?php

$endpoint = 'https://dalio.io/app/api/listings';

// Create the request to be POSTed
$listings_json='{
	"user_email": "[CLIENT_EMAIL]",
	"listings": {
		"update": [{
			"item_name": "Global Version Xiaomi Mi Band 4 Smart Wristband Miband 4 Bracelet Heart Rate Fitness Color Screen Bluetooth 5.0 Chinese Version",
			"image": "https:\/\/ae01.alicdn.com\/kf\/H741e4d87e79243bfad684af1471304c0B\/Global-Version-Xiaomi-Mi-Band-4-Smart-Wristband-Miband-4-Bracelet-Heart-Rate-Fitness-Color-Screen.jpg",
			"store_url": "https:\/\/www.ebay.co.uk\/itm\/224049049296",
			"store_id": "224049049296",
			"store": "ebay.co.uk",
			"supplier_url": "https:\/\/www.aliexpress.com\/item\/33034720523.html?spm=a2g01.12617084.fdpcl001.2.55328eFS8eFSbN&gps-id=5547572&scm=1007.19201.130907.0&scm_id=1007.19201.130907.0&scm-url=1007.19201.130907.0&pvid=a2f260d9-a917-4105-b8d9-03e86424bbc2",
			"supplier_id": "33034720523",
			"supplier": "aliexpress.com",
			"supplier_item_name": "Global Version Xiaomi Mi Band 4 Smart Wristband Miband 4 Bracelet Heart Rate Fitness Color Screen Bluetooth 5.0 Chinese Version",
			"product_availability": "10",
			"price": "19.99"
		}, {
			"item_name": "Global Version Xiaomi Mi Band 4 Smart Wristband Miband 4 Bracelet Heart Rate Fitness Color Screen Bluetooth 5.0 Chinese Version",
			"image": "https:\/\/ae01.alicdn.com\/kf\/H741e4d87e79243bfad684af1471304c0B\/Global-Version-Xiaomi-Mi-Band-4-Smart-Wristband-Miband-4-Bracelet-Heart-Rate-Fitness-Color-Screen.jpg",
			"store_url": "https:\/\/www.ebay.co.uk\/itm\/224049049296",
			"store_id": "224049049296",
			"store": "ebay.co.uk",
			"supplier_url": "https:\/\/www.aliexpress.com\/item\/33034720523.html?spm=a2g01.12617084.fdpcl001.2.55328eFS8eFSbN&gps-id=5547572&scm=1007.19201.130907.0&scm_id=1007.19201.130907.0&scm-url=1007.19201.130907.0&pvid=a2f260d9-a917-4105-b8d9-03e86424bbc2",
			"supplier_id": "33034720523",
			"supplier": "aliexpress.com",
			"supplier_item_name": "Global Version Xiaomi Mi Band 4 Smart Wristband Miband 4 Bracelet Heart Rate Fitness Color Screen Bluetooth 5.0 Chinese Version",
			"product_availability": "10",
			"price": "19.99"
		}]
	,
	"delete": [{
			"item_name": "Global Version Xiaomi Mi Band 4 Smart Wristband Miband 4 Bracelet Heart Rate Fitness Color Screen Bluetooth 5.0 Chinese Version",
			"image": "https:\/\/ae01.alicdn.com\/kf\/H741e4d87e79243bfad684af1471304c0B\/Global-Version-Xiaomi-Mi-Band-4-Smart-Wristband-Miband-4-Bracelet-Heart-Rate-Fitness-Color-Screen.jpg",
			"store_url": "https:\/\/www.ebay.co.uk\/itm\/224049049296",
			"store_id": "224049049296"
		}, {
			"item_name": "Global Version Xiaomi Mi Band 4 Smart Wristband Miband 4 Bracelet Heart Rate Fitness Color Screen Bluetooth 5.0 Chinese Version",
			"image": "https:\/\/ae01.alicdn.com\/kf\/H741e4d87e79243bfad684af1471304c0B\/Global-Version-Xiaomi-Mi-Band-4-Smart-Wristband-Miband-4-Bracelet-Heart-Rate-Fitness-Color-Screen.jpg",
			"store_url": "https:\/\/www.ebay.co.uk\/itm\/224049049296"
	}]
	}
	
}';

// Set up the HTTP headers
$headers = [
    'Content-Type: application/json',
    'Authorization: Basic ' . base64_encode("vitrontrading@gmail.com" . ":" . "dsbeast123")
];

$session = curl_init($endpoint); // create a curl session
curl_setopt($session, CURLOPT_POST, true); // POST request type
curl_setopt($session, CURLOPT_HTTPHEADER, $headers); // set headers using $headers array
curl_setopt($session, CURLOPT_POSTFIELDS, $listings_json); // set the body of the POST
curl_setopt($session, CURLOPT_RETURNTRANSFER, true); // return values as a string, not to std out

$response = curl_exec($session); // send the request
curl_close($session); // close the session

$resp_obj = json_decode($response);

echo $response;

?>				
			

The server’s response:

updated – how many listings were successfully updated

deleted – how many listings were successfully deleted

							
							
					{"status":2,"code":200,"updated":0,"deleted":1}				
			

Retrieve user's listings (Python)

							
							
					import requests
import json

endpoint = 'https://dalio.io/app/api/listings?user_email="[CLIENT_EMAIL]"'

response_json = requests.get(endpoint,auth=('[PARTNER_EMAIL]', '[PARTNER_PASS]'))

response_obj = json.loads(response_json.content)

print(response_obj)				
			

Update user's listings (Python)

							
							
					import requests
import json

endpoint = "https://dalio.io/app/api/listings"

listings={
    "user_email":"[CLIENT_EMAIL]",
     "listings":{
            "update":[{  # to be updated
                "item_name":"Global Version Xiaomi Mi Band 4 Smart Wristband Miband 4 Bracelet Heart Rate Fitness Color Screen Bluetooth 5.0 Chinese Version",
                "image":"https://ae01.alicdn.com/kf/H741e4d87e79243bfad684af1471304c0B/Global-Version-Xiaomi-Mi-Band-4-Smart-Wristband-Miband-4-Bracelet-Heart-Rate-Fitness-Color-Screen.jpg",
                "store_url":"https://www.ebay.co.uk/itm/224049049296",
                "store_id":"224049049296",
                "store":"ebay.co.uk",
                "supplier_url":"https://www.aliexpress.com/item/33034720523.html?spm=a2g01.12617084.fdpcl001.2.55328eFS8eFSbN&gps-id=5547572&scm=1007.19201.130907.0&scm_id=1007.19201.130907.0&scm-url=1007.19201.130907.0&pvid=a2f260d9-a917-4105-b8d9-03e86424bbc2",
                "supplier_id":"33034720523",
                "supplier":"aliexpress.com",
                "supplier_item_name":"Global Version Xiaomi Mi Band 4 Smart Wristband Miband 4 Bracelet Heart Rate Fitness Color Screen Bluetooth 5.0 Chinese Version",
                "product_availability":"10",
                "price":"19.99"
            },{
             "item_name":"Global Version Xiaomi Mi Band 4 Smart Wristband Miband 4 Bracelet Heart Rate Fitness Color Screen Bluetooth 5.0 Chinese Version",
              "image":"https://ae01.alicdn.com/kf/H741e4d87e79243bfad684af1471304c0B/Global-Version-Xiaomi-Mi-Band-4-Smart-Wristband-Miband-4-Bracelet-Heart-Rate-Fitness-Color-Screen.jpg",
              "store_url":"https://www.ebay.co.uk/itm/224049049296",
              "store_id":"224049049296",
              "store":"ebay.co.uk",
              "supplier_url":"https://www.aliexpress.com/item/33034720523.html?spm=a2g01.12617084.fdpcl001.2.55328eFS8eFSbN&gps-id=5547572&scm=1007.19201.130907.0&scm_id=1007.19201.130907.0&scm-url=1007.19201.130907.0&pvid=a2f260d9-a917-4105-b8d9-03e86424bbc2",
              "supplier_id":"33034720523",
              "supplier":"aliexpress.com",
              "supplier_item_name":"Global Version Xiaomi Mi Band 4 Smart Wristband Miband 4 Bracelet Heart Rate Fitness Color Screen Bluetooth 5.0 Chinese Version",
              "product_availability":"10",
              "price":"19.99"
            }],
         "delete":[{ #to be deleted
             "item_name":"Global Version Xiaomi Mi Band 4 Smart Wristband Miband 4 Bracelet Heart Rate Fitness Color Screen Bluetooth 5.0 Chinese Version",
             "image":"https://ae01.alicdn.com/kf/H741e4d87e79243bfad684af1471304c0B/Global-Version-Xiaomi-Mi-Band-4-Smart-Wristband-Miband-4-Bracelet-Heart-Rate-Fitness-Color-Screen.jpg",
             "store_url":"https://www.ebay.co.uk/itm/224049049296",
             "store_id":"224049049296"
         }, {
            "item_name":"Global Version Xiaomi Mi Band 4 Smart Wristband Miband 4 Bracelet Heart Rate Fitness Color Screen Bluetooth 5.0 Chinese Version",
                 "image":"https://ae01.alicdn.com/kf/H741e4d87e79243bfad684af1471304c0B/Global-Version-Xiaomi-Mi-Band-4-Smart-Wristband-Miband-4-Bracelet-Heart-Rate-Fitness-Color-Screen.jpg",
                          "store_url":"https://www.ebay.co.uk/itm/224049049296"
             }]
     }
}

response_json = requests.get(endpoint,auth=('vitrontrading@gmail.com', 'dsb123'))

response_obj = json.loads(response_json.content)

print(response_obj)				
			

The server’s response:

updated – how many listings were successfully updated

deleted – how many listings were successfully deleted

							
							
					{"status":2,"code":200,"updated":0,"deleted":1}				
			

Orders

All possible input properties are shown in the examples bellow.

 

							
							
					{
    //always include target user's email address
    user_email:"[CLIENT_EMAIL]",
    //if you make a request to /orders, you need to include an orders array
    orders:[
        "supplier":"", // where the item is to be purchased from (ex. "Aliexpress")
        "supplier_id":"", // supplier's id (ex. Aliexpress Item Id)
        "supplier_url":"", // supplier's url (ex. Aliexpress Item Url)
        "status":"", // (UNFULFILLED|PENDING|FULFILLED)
        "order_number":"", // order number in the respective seller's account ( example - eBay order id )
        "item_name":"", // item title
        "image":"", // item image url
        "store_id":"", // seller store's id
        "date_sold":"", //when the item was sold from the seller's account
        "quantity":"", //how much was purchased
        "sold_for":"", // price (ex. 10.99) , how much the original buyer paid
        "buyer_name":"", // original buyer name
        "buyer_email":"", // original buyer email
        "post_to_name":"", // buyer shipping address name field
        "post_to_address_field":"", // buyer shipping address 1 field
        "post_to_address_field_2":"",  // buyer shipping address 2 field,
        "post_to_city":"", // buyer shipping address city
        "post_to_state_province":"", // buyer shipping address state / province
        "post_to_country":"", // buyer shipping address country
        "post_to_postcode":"" // buyer shipping address postcode
        
    ]
}				
			

Retrieve user's orders (Python)

							
							
					import requests
import json

endpoint = "https://dalio.io/app/api/orders?user_email=[CLIENT_EMAIL]"

response_json = requests.get(endpoint,auth=('[PARTNER_EMAIL]', '[PARTNER_PASS]'))

response_obj = json.loads(response_json.content)

print(response_obj)				
			

Update user's orders (Python)

							
							
					<?php

$endpoint = 'https://dalio.io/app/api/orders';

// Create the request to be POSTed
$orders_json='{
	"user_email": "[CLIENT_EMAIL]",
	"orders": {
		"update": [{
			"item_name": "Global Version Xiaomi Mi Band 4 Smart Wristband Miband 4 Bracelet Heart Rate Fitness Color Screen Bluetooth 5.0 Chinese Version",
			"image": "https:\/\/ae01.alicdn.com\/kf\/H741e4d87e79243bfad684af1471304c0B\/Global-Version-Xiaomi-Mi-Band-4-Smart-Wristband-Miband-4-Bracelet-Heart-Rate-Fitness-Color-Screen.jpg",
			"store_url": "https:\/\/www.ebay.co.uk\/itm\/224049049296",
			"store_id": "224049049296",
			"store": "ebay.co.uk",
			"supplier_url": "https:\/\/www.aliexpress.com\/item\/33034720523.html?spm=a2g01.12617084.fdpcl001.2.55328eFS8eFSbN&gps-id=5547572&scm=1007.19201.130907.0&scm_id=1007.19201.130907.0&scm-url=1007.19201.130907.0&pvid=a2f260d9-a917-4105-b8d9-03e86424bbc2",
			"supplier_id": "33034720523",
			"supplier": "aliexpress.com",
			"supplier_item_name": "Global Version Xiaomi Mi Band 4 Smart Wristband Miband 4 Bracelet Heart Rate Fitness Color Screen Bluetooth 5.0 Chinese Version",
			"product_availability": "10",
			"price": "19.99"
		}, {
			"item_name": "Global Version Xiaomi Mi Band 4 Smart Wristband Miband 4 Bracelet Heart Rate Fitness Color Screen Bluetooth 5.0 Chinese Version",
			"image": "https:\/\/ae01.alicdn.com\/kf\/H741e4d87e79243bfad684af1471304c0B\/Global-Version-Xiaomi-Mi-Band-4-Smart-Wristband-Miband-4-Bracelet-Heart-Rate-Fitness-Color-Screen.jpg",
			"store_url": "https:\/\/www.ebay.co.uk\/itm\/224049049296",
			"store_id": "224049049296",
			"store": "ebay.co.uk",
			"supplier_url": "https:\/\/www.aliexpress.com\/item\/33034720523.html?spm=a2g01.12617084.fdpcl001.2.55328eFS8eFSbN&gps-id=5547572&scm=1007.19201.130907.0&scm_id=1007.19201.130907.0&scm-url=1007.19201.130907.0&pvid=a2f260d9-a917-4105-b8d9-03e86424bbc2",
			"supplier_id": "33034720523",
			"supplier": "aliexpress.com",
			"supplier_item_name": "Global Version Xiaomi Mi Band 4 Smart Wristband Miband 4 Bracelet Heart Rate Fitness Color Screen Bluetooth 5.0 Chinese Version",
			"product_availability": "10",
			"price": "19.99"
		}]
	,
	"delete": [{
			"item_name": "Global Version Xiaomi Mi Band 4 Smart Wristband Miband 4 Bracelet Heart Rate Fitness Color Screen Bluetooth 5.0 Chinese Version",
			"image": "https:\/\/ae01.alicdn.com\/kf\/H741e4d87e79243bfad684af1471304c0B\/Global-Version-Xiaomi-Mi-Band-4-Smart-Wristband-Miband-4-Bracelet-Heart-Rate-Fitness-Color-Screen.jpg",
			"store_url": "https:\/\/www.ebay.co.uk\/itm\/224049049296",
			"store_id": "224049049296"
		}, {
			"item_name": "Global Version Xiaomi Mi Band 4 Smart Wristband Miband 4 Bracelet Heart Rate Fitness Color Screen Bluetooth 5.0 Chinese Version",
			"image": "https:\/\/ae01.alicdn.com\/kf\/H741e4d87e79243bfad684af1471304c0B\/Global-Version-Xiaomi-Mi-Band-4-Smart-Wristband-Miband-4-Bracelet-Heart-Rate-Fitness-Color-Screen.jpg",
			"store_url": "https:\/\/www.ebay.co.uk\/itm\/224049049296"
	}]
	}
	
}';

// Create the request to be POSTed
//$request = array("user_email"=>"martin.kondov@gmail.com","orders"=>$json_orders);

// Set up the HTTP headers
$headers = [
    'Content-Type: application/json',
    'Authorization: Basic ' . base64_encode("vitrontrading@gmail.com" . ":" . "dsbeast123")
];

$session = curl_init($endpoint); // create a curl session
curl_setopt($session, CURLOPT_POST, true); // POST request type
curl_setopt($session, CURLOPT_HTTPHEADER, $headers); // set headers using $headers array
curl_setopt($session, CURLOPT_POSTFIELDS, $orders_json); // set the body of the POST
curl_setopt($session, CURLOPT_RETURNTRANSFER, true); // return values as a string, not to std out

$response = curl_exec($session); // send the request
curl_close($session); // close the session

$resp_obj = json_decode($response);

echo $response;

?>				
			

The server’s response:

updated – how many orders were successfully updated

deleted – how many orders were successfully deleted

							
							
					{"status":2,"code":200,"updated":0,"deleted":1}				
			

Retrieve user's orders (PHP)

							
							
					<?php

$endpoint = 'https://dalio.io/app/api/orders?user_email=[CLIENT_EMAIL]';

// Set up the HTTP headers
$headers = [
    'Content-Type: application/x-www-form-urlencoded',
    'Authorization: Basic ' . base64_encode("[PARTNER_EMAIL]" . ":" . "[PARTNER_PASS]")
];

$session = curl_init($endpoint); // create a curl session
//curl_setopt($session, CURLOPT_POST, false); // POST request type
curl_setopt($session, CURLOPT_HTTPHEADER, $headers); // set headers using $headers array
//curl_setopt($session, CURLOPT_POSTFIELDS, $request); // set the body of the POST
curl_setopt($session, CURLOPT_RETURNTRANSFER, true); // return values as a string, not to std out

$response = curl_exec($session); // send the request
curl_close($session); // close the session

$resp = json_decode($response);

echo $response;

?>				
			

Update user's orders (PHP)

							
							
					$endpoint = 'https://dalio.io/app/api/listings';

// Create the request to be POSTed
$request = array("user_email"=>$_POST['user_email'],"listings"=>array("updated"=>array($_POST ['listings'])));

// Set up the HTTP headers
$headers = [
'Content-Type: application/x-www-form-urlencoded',
'Authorization: Basic ' . base64_encode("[PARTNER_EMAIL]" . ":" . "[PARTNER_PASS]")
];

$session = curl_init($endpoint); // create a curl session
curl_setopt($session, CURLOPT_POST, true); // POST request type
curl_setopt($session, CURLOPT_HTTPHEADER, $headers); // set headers using $headers array
curl_setopt($session, CURLOPT_POSTFIELDS, $request); // set the body of the POST
curl_setopt($session, CURLOPT_RETURNTRANSFER, true); // return values as a string, not to std out

$response = curl_exec($session); // send the request
curl_close($session); // close the session

$resp = json_decode($response);

header('Content-type: application/json');
echo $resp;				
			

The server’s response:

updated – how many orders were successfully updated

deleted – how many orders were successfully deleted

							
							
					{"status":2,"code":200,"updated":0,"deleted":1}