AML APIs Documentation

Wel Come to the Almadaen Logistics


  • Created: 27 April, 2020
  • Update: 16 July, 2024

Installation

Follow the steps below to setup your API:

  1. Get API Key from our sale representative.
  2. For Sand Box use URL: https://almadaen.me/erpdemo/
  3. For live use URL: https://amlapis.almadaen.me/

Create Dropship Order

Sr.NoParameter NameParameter DescriptionParameter Required/Optional
1 apikey Provided by the AML Required
2 order_reference its a rereference from your database Optional
3 customer_name customer name Required
4 customer_phone_no customer phone no Required
5 customer_phone_no_2 customer phone no 2 Required
6 customer_full_address customer full address Required
7 customer_country SA Required
8 customer_city Jeddah, from our provided city list of KSA Required
9 customer_district Al Sulaymaniyah, from our provided district list KSA Required
10 packaging_type 1=Fully Packed,2=Not Packed,3=Fully Packed and Breakable Items,4=Not Packed and Breakable Items Required
11 weight Weight in KG Required
12 length Length in Inches Required
13 width Width in Inches Required
14 height Height in Inches Required
15 payment_type 1=COD, 2=CC Required
16 product_amount 1=COD than order grand total, 2=CC than grand total Zero Required
17 shipment_pieces total numbers of packing Required
18 order_value order containg products total amount Required
19 comments Your comments about delivery Required
20 description Parcel containing products details Optional

PHP Code



 $ch = curl_init();
 curl_setopt($ch, CURLOPT_URL, "https://almadaen.me/erpdemo/orders/create_dropship");
 curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
 curl_setopt($ch, CURLOPT_HEADER, FALSE);
 curl_setopt($ch, CURLOPT_POST, TRUE);
 curl_setopt($ch, CURLOPT_POSTFIELDS, "{
 \"apikey\": \"e27604-7a1862-d665c4-2cbb23-152225\",
 \"order_reference\": \"abc\",
  \"customer_name\": \"Ali\",
  \"customer_phone_no\": \"+966000000000\",
  \"customer_phone_no_2\": \"+966000000000\",
  \"customer_full_address\": \"Housr no.26 Bani aashil Madinah\",
  \"customer_country\": \"SA\",
  \"customer_city\": \"Jeddah\",
  \"customer_district\": \"Al Sulaymaniyah\",
  \"packaging_type\": \"1\",
  \"weight\": \"0.5\",
  \"length\": \"12\",
  \"width\": \"12\",
  \"height\": \"12\",
  \"payment_type\": \"2\",
  \"product_amount\": \"0\",
  \"shipment_pieces\": \"1\",
  \"order_value\": \"190\",
  \"comments\": \"All things are breakable\",
  \"description\": \"1 Piece of Key Ring\"
    }");
    curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json"));
    echo $response = curl_exec($ch);

          

Python Code



from urllib2 import Request, urlopen
 values = "{
 \"apikey\": \"e27604-7a1862-d665c4-2cbb23-152225\",
 \"order_reference\": \"abc\",
  \"customer_name\": \"Ali\",
  \"customer_phone_no\": \"+966000000000\",
  \"customer_phone_no_2\": \"+966000000000\",
  \"customer_full_address\": \"Housr no.26 Bani aashil Madinah\",
  \"customer_country\": \"SA\",
  \"customer_city\": \"Jeddah\",
  \"customer_district\": \"Al Sulaymaniyah\",
  \"packaging_type\": \"1\",
  \"weight\": \"0.5\",
  \"length\": \"12\",
  \"width\": \"12\",
  \"height\": \"12\",
  \"payment_type\": \"2\",
  \"product_amount\": \"0\",
  \"shipment_pieces\": \"1\",
  \"order_value\": \"190\",
  \"comments\": \"All things are breakable\",
  \"description\": \"1 Piece of Key Ring\"
    }"
headers = {'Content-Type': 'application/json'}
request = Request('https://almadaen.me/erpdemo/orders/create_dropship', data=values, headers=headers)
response_body = urlopen(request).read()
print response_body

          

Java Code


import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.Entity;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.MediaType;
Client client = ClientBuilder.newClient();
Entity payload = Entity.json("{
 \"apikey\": \"e27604-7a1862-d665c4-2cbb23-152225\",
 \"order_reference\": \"abc\",
  \"customer_name\": \"Ali\",
  \"customer_phone_no\": \"+966000000000\",
  \"customer_phone_no_2\": \"+966000000000\",
  \"customer_full_address\": \"Housr no.26 Bani aashil Madinah\",
  \"customer_country\": \"SA\",
  \"customer_city\": \"Jeddah\",
  \"customer_district\": \"Al Sulaymaniyah\",
  \"packaging_type\": \"1\",
  \"weight\": \"0.5\",
  \"length\": \"12\",
  \"width\": \"12\",
  \"height\": \"12\",
  \"payment_type\": \"2\",
  \"product_amount\": \"0\",
  \"shipment_pieces\": \"1\",
  \"order_value\": \"190\",
  \"comments\": \"All things are breakable\",
  \"description\": \"1 Piece of Key Ring\"
    }");
Response response = client.target("https://almadaen.me/erpdemo/orders/create_dropship").request(MediaType.APPLICATION_JSON_TYPE).post(payload);
System.out.println("status: " + response.getStatus());
System.out.println("headers: " + response.getHeaders());
System.out.println("body:" + response.readEntity(String.class));

          

Javascript Code


var request = new XMLHttpRequest();
request.open('POST', 'https://almadaen.me/erpdemo/orders/create_dropship');
request.setRequestHeader('Content-Type', 'application/json');
request.onreadystatechange = function () {
  if (this.readyState === 4) {
    console.log('Status:', this.status);
    console.log('Headers:', this.getAllResponseHeaders());
    console.log('Body:', this.responseText);
  }
};
var body = "{
 \"apikey\": \"e27604-7a1862-d665c4-2cbb23-152225\",
 \"order_reference\": \"abc\",
  \"customer_name\": \"Ali\",
  \"customer_phone_no\": \"+966000000000\",
  \"customer_phone_no_2\": \"+966000000000\",
  \"customer_full_address\": \"Housr no.26 Bani aashil Madinah\",
  \"customer_country\": \"SA\",
  \"customer_city\": \"Jeddah\",
  \"customer_district\": \"Al Sulaymaniyah\",
  \"packaging_type\": \"1\",
  \"weight\": \"0.5\",
  \"length\": \"12\",
  \"width\": \"12\",
  \"height\": \"12\",
  \"payment_type\": \"2\",
  \"product_amount\": \"0\",
  \"shipment_pieces\": \"1\",
  \"order_value\": \"190\",
  \"comments\": \"All things are breakable\",
  \"description\": \"1 Piece of Key Ring\"
    }";
    request.send(JSON.stringify(body));
          

Ruby Code


require 'rubygems' if RUBY_VERSION < '1.9'
require 'rest_client'
values = "{
 \"apikey\": \"e27604-7a1862-d665c4-2cbb23-152225\",
 \"order_reference\": \"abc\",
  \"customer_name\": \"Ali\",
  \"customer_phone_no\": \"+966000000000\",
  \"customer_phone_no_2\": \"+966000000000\",
  \"customer_full_address\": \"Housr no.26 Bani aashil Madinah\",
  \"customer_country\": \"SA\",
  \"customer_city\": \"Jeddah\",
  \"customer_district\": \"Al Sulaymaniyah\",
  \"packaging_type\": \"1\",
  \"weight\": \"0.5\",
  \"length\": \"12\",
  \"width\": \"12\",
  \"height\": \"12\",
  \"payment_type\": \"2\",
  \"product_amount\": \"0\",
  \"shipment_pieces\": \"1\",
  \"order_value\": \"190\",
  \"comments\": \"All things are breakable\",
  \"description\": \"1 Piece of Key Ring\"
    }";
headers = {:content_type => 'application/json'}
response = RestClient.post 'https://almadaen.me/erpdemo/orders/create_dropship', values, headers
puts response
          

Delete Dropship Order

Sr.NoParameter NameParameter DescriptionParameter Required/Optional
1 apikey Provided by the AML Required
2 airway_bill_no get Air Way Bill No. after creating fropship order responce Required

PHP Code


$ch = curl_init();
 curl_setopt($ch, CURLOPT_URL, "https://almadaen.me/erpdemo/orders/delete_order");
 curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
 curl_setopt($ch, CURLOPT_HEADER, FALSE);
 curl_setopt($ch, CURLOPT_POST, TRUE);
 curl_setopt($ch, CURLOPT_POSTFIELDS, "{
 \"apikey\": \"e27604-7a1862-d665c4-2cbb23-152225\",
 \"airway_bill_no\": \"AML1000003524\"
    }");
    curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json"));
    echo $response = curl_exec($ch);

          

Python Code



from urllib2 import Request, urlopen
 values = "{
 \"apikey\": \"e27604-7a1862-d665c4-2cbb23-152225\",
 \"airway_bill_no\": \"AML1000003524\"
    }"
headers = {'Content-Type': 'application/json'}
request = Request('https://almadaen.me/erpdemo/orders/delete_order', data=values, headers=headers)
response_body = urlopen(request).read()
print response_body

          

Java Code


import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.Entity;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.MediaType;
Client client = ClientBuilder.newClient();
Entity payload = Entity.json("{
 \"apikey\": \"e27604-7a1862-d665c4-2cbb23-152225\",
 \"airway_bill_no\": \"AML1000003524\"
    }");
Response response = client.target("https://almadaen.me/erpdemo/orders/delete_order").request(MediaType.APPLICATION_JSON_TYPE).post(payload);
System.out.println("status: " + response.getStatus());
System.out.println("headers: " + response.getHeaders());
System.out.println("body:" + response.readEntity(String.class));

          

Javascript Code


var request = new XMLHttpRequest();
request.open('POST', 'https://almadaen.me/erpdemo/orders/delete_order');
request.setRequestHeader('Content-Type', 'application/json');
request.onreadystatechange = function () {
  if (this.readyState === 4) {
    console.log('Status:', this.status);
    console.log('Headers:', this.getAllResponseHeaders());
    console.log('Body:', this.responseText);
  }
};
var body = "{
 \"apikey\": \"e27604-7a1862-d665c4-2cbb23-152225\",
 \"airway_bill_no\": \"AML1000003524\"
    }";
    request.send(JSON.stringify(body));
          

Ruby Code


require 'rubygems' if RUBY_VERSION < '1.9'
require 'rest_client'
values = "{
 \"apikey\": \"e27604-7a1862-d665c4-2cbb23-152225\",
 \"airway_bill_no\": \"AML1000003524\"
    }";
headers = {:content_type => 'application/json'}
response = RestClient.post 'https://almadaen.me/erpdemo/orders/delete_order', values, headers
puts response
          

Get Order Details

Sr.NoParameter NameParameter DescriptionParameter Required/Optional
1 apikey Provided by the AML Required
2 airway_bill_no get Air Way Bill No. after creating fropship order responce Required

PHP Code


$ch = curl_init();
 curl_setopt($ch, CURLOPT_URL, "https://almadaen.me/erpdemo/orders/get_order");
 curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
 curl_setopt($ch, CURLOPT_HEADER, FALSE);
 curl_setopt($ch, CURLOPT_POST, TRUE);
 curl_setopt($ch, CURLOPT_POSTFIELDS, "{
 \"apikey\": \"e27604-7a1862-d665c4-2cbb23-152225\",
 \"airway_bill_no\": \"AML1000003524\"
    }");
    curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json"));
    echo $response = curl_exec($ch);

          

Python Code



from urllib2 import Request, urlopen
 values = "{
 \"apikey\": \"e27604-7a1862-d665c4-2cbb23-152225\",
 \"airway_bill_no\": \"AML1000003524\"
    }"
headers = {'Content-Type': 'application/json'}
request = Request('https://almadaen.me/erpdemo/orders/get_order', data=values, headers=headers)
response_body = urlopen(request).read()
print response_body

          

Java Code


import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.Entity;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.MediaType;
Client client = ClientBuilder.newClient();
Entity payload = Entity.json("{
 \"apikey\": \"e27604-7a1862-d665c4-2cbb23-152225\",
 \"airway_bill_no\": \"AML1000003524\"
    }");
Response response = client.target("https://almadaen.me/erpdemo/orders/get_order").request(MediaType.APPLICATION_JSON_TYPE).post(payload);
System.out.println("status: " + response.getStatus());
System.out.println("headers: " + response.getHeaders());
System.out.println("body:" + response.readEntity(String.class));

          

Javascript Code


var request = new XMLHttpRequest();
request.open('POST', 'https://almadaen.me/erpdemo/orders/get_order');
request.setRequestHeader('Content-Type', 'application/json');
request.onreadystatechange = function () {
  if (this.readyState === 4) {
    console.log('Status:', this.status);
    console.log('Headers:', this.getAllResponseHeaders());
    console.log('Body:', this.responseText);
  }
};
var body = "{
 \"apikey\": \"e27604-7a1862-d665c4-2cbb23-152225\",
 \"airway_bill_no\": \"AML1000003524\"
    }";
    request.send(JSON.stringify(body));
          

Ruby Code


require 'rubygems' if RUBY_VERSION < '1.9'
require 'rest_client'
values = "{
 \"apikey\": \"e27604-7a1862-d665c4-2cbb23-152225\",
 \"airway_bill_no\": \"AML1000003524\"
    }";
headers = {:content_type => 'application/json'}
response = RestClient.post 'https://almadaen.me/erpdemo/orders/get_order', values, headers
puts response
          

Get Order Status

Sr.NoParameter NameParameter DescriptionParameter Required/Optional
1 apikey Provided by the AML Required
2 airway_bill_no get Air Way Bill No. after creating fropship order responce Required

PHP Code


$ch = curl_init();
 curl_setopt($ch, CURLOPT_URL, "https://almadaen.me/erpdemo/orders/get_order_status");
 curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
 curl_setopt($ch, CURLOPT_HEADER, FALSE);
 curl_setopt($ch, CURLOPT_POST, TRUE);
 curl_setopt($ch, CURLOPT_POSTFIELDS, "{
 \"apikey\": \"e27604-7a1862-d665c4-2cbb23-152225\",
 \"airway_bill_no\": \"AML1000003524\"
    }");
    curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json"));
    echo $response = curl_exec($ch);

          

Python Code



from urllib2 import Request, urlopen
 values = "{
 \"apikey\": \"e27604-7a1862-d665c4-2cbb23-152225\",
 \"airway_bill_no\": \"AML1000003524\"
    }"
headers = {'Content-Type': 'application/json'}
request = Request('https://almadaen.me/erpdemo/orders/get_order_status', data=values, headers=headers)
response_body = urlopen(request).read()
print response_body

          

Java Code


import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.Entity;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.MediaType;
Client client = ClientBuilder.newClient();
Entity payload = Entity.json("{
 \"apikey\": \"e27604-7a1862-d665c4-2cbb23-152225\",
 \"airway_bill_no\": \"AML1000003524\"
    }");
Response response = client.target("https://almadaen.me/erpdemo/orders/get_order_status").request(MediaType.APPLICATION_JSON_TYPE).post(payload);
System.out.println("status: " + response.getStatus());
System.out.println("headers: " + response.getHeaders());
System.out.println("body:" + response.readEntity(String.class));

          

Javascript Code


var request = new XMLHttpRequest();
request.open('POST', 'https://almadaen.me/erpdemo/orders/get_order_status');
request.setRequestHeader('Content-Type', 'application/json');
request.onreadystatechange = function () {
  if (this.readyState === 4) {
    console.log('Status:', this.status);
    console.log('Headers:', this.getAllResponseHeaders());
    console.log('Body:', this.responseText);
  }
};
var body = "{
 \"apikey\": \"e27604-7a1862-d665c4-2cbb23-152225\",
 \"airway_bill_no\": \"AML1000003524\"
    }";
    request.send(JSON.stringify(body));
          

Ruby Code


require 'rubygems' if RUBY_VERSION < '1.9'
require 'rest_client'
values = "{
 \"apikey\": \"e27604-7a1862-d665c4-2cbb23-152225\",
 \"airway_bill_no\": \"AML1000003524\"
    }";
headers = {:content_type => 'application/json'}
response = RestClient.post 'https://almadaen.me/erpdemo/orders/get_order_status', values, headers
puts response