Documentation for API integration DapSides Eurologistica S.r.L.
This documentation allows the integration to our webservice so you can interface to our cloud and WMS DapSides. Through API REST calls you can create, manage and query orders, leads and your inventory.
Login
A GET function call is used providing user and password ($user,$pass). The result is in json format with a token variable that will have to be passed at each subsequent call. The token has a duration of 1 week and is kept active by subsequent calls. In case of IP change the token will no longer be valid.
$user = "your username";
$pass = "your password";
$url = "http://62.97.45.44:443/webapp/api/v3/createToken.php/process/".$user."/".$pass;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, 'GET' );
if (curl_errno($ch)) {
echo curl_errno($ch);
echo curl_error($ch);
$status = array("status" => "error", "msg" => "Login Error");
return false;
}else{
$result = curl_exec($ch);
$response = json_decode($result);
curl_close($ch);
$token = $response->csrf_value;
}
Response
{
"csrf_name": "XXXXXXXX", (Description)
"csrf_value": "XXXXXXXXXXXXXXXXXXXXXXXXXXX" (token)
}
Create Order
The data is passed within the $data variable in Json format..
Data | Required | Description | Val. |
---|---|---|---|
orderID | * | Unique order identification number | VARCHAR(12) |
customerName | * | Order recipient name | VARCHAR(30) |
destAddress | * | Destination Address,street,building | VARCHAR(50) |
destCity | * | Destination City | VARCHAR(30) |
destAreaCode | * | Destination province | VARCHAR(30) |
destPostalCode | * | Destination Zip Code | VARCHAR(10) |
destCountryCode | * | Destination country | VARCHAR(2) |
destEmail | Recipient's email address | VARCHAR(30) | |
destPhone | Recipient's phone number | VARCHAR(30) | |
fl_sms | Flag to use SMS service (0 / 1) | BOOLEAN | |
orderDate | * | Date of order | DATE(Y-m-d) |
deliveryInfo | Useful comments to the courier for shipping | VARCHAR(30) | |
cod | * | (Cash on Delivery) insert 0 if the cash on delivery (pre-paid or returned order) is not managed, insert 1 if the order is managed with cash on delivery | BOOLEAN |
totalAmount | * | Importo totale ordine (XX.XX) | DECIMAL(10,2) |
orderRowID | * | Index used to group multiple products into one order. If an order includes several products within a json record, progressively increase the data by the number of records present.
In the first 2 lines we have the same orderID, the same totalAmount but different rowOrderID, this allows the system to place an order with more than one associated product, if the order provides for a further product then the next line will have the same orderID, same total Amount but rowOrderID will be 3.In the third line we have an order with a single product.
|
VARCHAR(12) |
productID | * | Product identification code on the cloud | VARCHAR(20) |
productName | * | Product name in the cloud | VARCHAR(30) |
productQty | * | Quantity of product ordered | INT(10) |
num_vet | Courier code (agreed with DAP) | INT(10) |
$url="http://62.97.45.44:443/webapp/api/index.php/insertorder";
$token = "token read in the login procedure";
$data = '{"1":{"orderID":"XXXXX","customerName":"XXXXXX","destAddress":"XXXXX","destPostalCode":"XXXXX","destCity":"XXXXXX","destAreaCode":"XX","destCountryCode":"XX","destPhone":"XXXXXXXX", "destEmail":"XXXXXXX","orderDate":"YYYY-MM-DD","deliveryInfo":"Lorem ipsum","cod":XX,"totalAmount":XX.XX,"orderRowID":"X","productID":"XXXX","productName":"XXXXX","productQty":X}}';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Authorization: '.$token));
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
if (curl_errno($ch)) {
echo curl_errno($ch);
echo curl_error($ch);
}else{
$result = curl_exec($ch);
$response = json_decode( $result );
echo $result;
curl_close($ch);
}
Response
{
"status": "success", (Insert status. Possible values: success or error)
"message": "Order added successfully.", (Insert description. If there's an error will be display the description.)
"data": "XXXXX" (DAP internal reference. Only if status = success)
}
Eg. Errore
{
"status": "error",
"message": "Duplicate orderID"
}
Edit Order
It is possible to edit a sent order by sending via POST call a json containing the details of the header of an order. If the change requires the change of the row of the order, therefore, also the products and you must cancel the order sent and enter the new correct order. All the rules defined in the section of Create order.
N.B. Even if you want to change 1 field only you must send all the order information.
THE FUNCTION IS ENABLED ONLY WITHIN THE SET TIMES ACCORDING TO THE CUT-OFF TIMES
$url="http://62.97.45.44:443/webapp/api/index.php/editOrder";
$token = "Token read during authentication procedure";
$data = '{"1":{"orderID":"XXXXX","customerName":"XXXX","destAddress":"XXXXX","destPostalCode":"XXXXX","destCity":"XXXXX","destAreaCode":"XX","destCountryCode":"XX","destPhone":"XXXXXXXX","destEmail":"XXXXXX","orderDate":"XXXX-XX-XX","deliveryInfo":"XXXXXXXXXXX","cod":X,"totalAmount":"XX.XX","dateOfDelivery":"XXXX-XX-XX"}}';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Authorization: '.$token));
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
if (curl_errno($ch)) {
echo curl_errno($ch);
echo curl_error($ch);
} else {
$result = curl_exec($ch);
$response = json_decode( $result );
echo $result;
curl_close($ch);
}
Response
{
"status": "success",
"message": "Order Edit successfully."
}
Eg. Errore
If out of CUT-OFF:
{
"status": "warning",
"message": "This order cannot be modified"
}
Or:
{
"status": "error",
"message": "Edit Failed: missing destAreaCode"
}
Delete order
The only significant field is the orderID to which the ID of the order to be deleted must be passed.
THE FUNCTION IS ENABLED ONLY WITHIN THE SET TIMES ACCORDING TO THE CUT-OFF TIMES
$url= "http://62.97.45.44:443/webapp/api/index.php/deleteorder";
$data = '{"orderID":"ORDER_NUMBER"}';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, 'delete' );
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_POST, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Authorization: '.$token));
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
if (curl_errno($ch)) {
echo curl_errno($ch);
echo curl_error($ch);
$status = array("status" => "error", "msg" => "Order cancellation failed");
} else {
$result = curl_exec($ch);
curl_close($ch);
$response = json_decode( $result );
echo $result;
}
Response
{
"status": "success",
"message": "Order removed successfully."
}
IF OUT OF CUT-OFF:
{
"status": "warning",
"message": "This order cannot be deleted."
}
Get order Status
The only significant field is the orderID to which the ID of the order you want to query is passed.
$url="http://62.97.45.44:443/webapp/api/index.php/getlaststatus";
$token = "Token read during authentication procedure";
$data = '{"orderID":"ORDER_NUMBER"}';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, 'GET' );
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_POST, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Authorization: '.$token));
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
if (curl_errno($ch)){
echo curl_errno($ch);
echo curl_error($ch);
$status = array("status" => "error", "msg" => "Shipment not found");
}else{
$result = curl_exec($ch);
curl_close($ch);
$response = json_decode( $result );
echo $result;
}
DAP normalized statuses
Status | Description |
---|---|
ABROAD FORWARDED | FORWARDED TO THE FOREIGN DEPARTMENT |
ABSENT 2 ATTEMPT | ABSENT AT THE SECOND DELIVERY ATTEMPT |
ACCEPTED | SHIPMENT SENT TO THE WAREHOUSE AND IN PREPARATION |
DELETED | DELETED SHIPMENT |
DELIVERED | DELIVERED SHIPMENT |
DESTROYED | DESTROYED SHIPMENT |
ERROR | ERROR DATA |
LOST | LOST SHIPMENT |
ON DELIVERY | SHIPPING ON DELIVERY |
REFUSED | SHIPMENT REFUSED BY THE CONSIGNEE |
RETURNED | RETURNING SHIPMENT |
STOLEN | THEFT SHIPMENT |
RECEIVED | SHIPMENT RECEIVED BY OUR SYSTEMS BUT NOT YET SENT TO THE WAREHOUSE |
OUT OF STOCK | SHIPMENT WITH LACK OF GOODS IN STOCK |
Response
{
"status": "success",
"message": "Data selected from database",
"data":
[
{
"status": "XXXXXXX", (DAP normalized status)
"statusDate": "XXXX-XX-XX XX:XX:XX", (Status update date)
"deliveryNote": "XXXXXXXX", (Delivery Note number)
"tracking":"https://xxx.XXXX.xx", (Tracking link)
"ldv": "XXXXXXXXXXXXXXXX", (Waybill)
"Courier Status": "XXXXXXXXXXXXXXXXXXXXX", (Courier Status)
"giac_code": "X", (Undeliverable code. If the order is undeliverable the field will be different 0)
"desc_giac": XXXXXXXXXXXXXXX (Undeliverable reason. If the order is undeliverable the field will be not null")
}
]
}
Get Shipment Details
Get all shipments information. You can send in the url a status update timestamp range or list of order id.
$url="http://62.97.45.44:443/webapp/api/index.php/getShipmentDetails/?updateDateFrom=XXXXXXXXX&updateDateTo=XXXXXXXXXXXX&orderIDs=XXX,YYYY,ZZZ";
$token = "Token read during authentication procedure";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, 'GET' );
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_POST, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Authorization: '.$token));
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
if (curl_errno($ch)){
echo curl_errno($ch);
echo curl_error($ch);
$status = array("status" => "error", "msg" => "Shipment not found");
}else{
$result = curl_exec($ch);
curl_close($ch);
$response = json_decode( $result );
echo $result;
}
DAP normalized statuses
Status | Description |
---|---|
ABROAD FORWARDED | FORWARDED TO THE FOREIGN DEPARTMENT |
ABSENT 2 ATTEMPT | ABSENT AT THE SECOND DELIVERY ATTEMPT |
ACCEPTED | SHIPMENT SENT TO THE WAREHOUSE AND IN PREPARATION |
DELETED | DELETED SHIPMENT |
DELIVERED | DELIVERED SHIPMENT |
DESTROYED | DESTROYED SHIPMENT |
ERROR | ERROR DATA |
LOST | LOST SHIPMENT |
ON DELIVERY | SHIPPING ON DELIVERY |
REFUSED | SHIPMENT REFUSED BY THE CONSIGNEE |
RETURNED | RETURNING SHIPMENT |
STOLEN | THEFT SHIPMENT |
RECEIVED | SHIPMENT RECEIVED BY OUR SYSTEMS BUT NOT YET SENT TO THE WAREHOUSE |
OUT OF STOCK | SHIPMENT WITH LACK OF GOODS IN STOCK |
Response
{
"status": "success",
"message": "Data selected from database",
"data": [{
"orderID": "XXXXXX",
"status": "ON DELIVERY",
"descrStatus": "",
"fulfillmentStatus": "FULFILLED",
"fulfillmentDate": "YYYY-MM-DD",
"statusDate": "YYYY-MM-DD HH:SS:MM",
"deliveryNote": "XXXXX",
"tracking": "WWW.TRK.COM",
"trackingNumber": "XXXXXXXX",
"courier": "XXX",
"exceptionCode": null,
"exception": null,
"totalWeight": "X.00",
"parcelsNumber": "X",
"parcels": [{
"orderRowID": "1",
"parcelID": "XXXXXXXX",
"productID": "XXXXXXXXXXXXX",
"productName": "XXXXXXXXXXXXXXX",
"productQty": "X",
"batchID": "XXXXXXXX",
"expireDate": "YYYY-MM-DD",
"weight": "0.00",
"palletID": "XXXXXXXX"
}, {
"orderRowID": "2",
"parcelID": "XXXXXXXX",
"productID": "XXXXXXXXXXXXX",
"productName": "XXXXXXXXXXXXXXX",
"productQty": "X",
"batchID": "XXXXXXXX",
"expireDate": "YYYY-MM-DD",
"weight": "0.00",
"palletID": "XXXXXXXX"
}, {
"orderRowID": "3",
"parcelID": "XXXXXXXX",
"productID": "XXXXXXXXXXXXX",
"productName": "XXXXXXXXXXXXXXX",
"productQty": "X",
"batchID": "XXXXXXXX",
"expireDate": "YYYY-MM-DD",
"weight": "0.00",
"palletID": "XXXXXXXX"
}]
}, {
"orderID": "XXXXX",
"status": "ACCEPTED",
"descrStatus": null,
"fulfillmentStatus": "PACKING",
"fulfillmentDate": null,
"statusDate": null,
"deliveryNote": null,
"tracking": null,
"trackingNumber": null,
"courier": "XXX",
"exceptionCode": null,
"exception": null,
"totalWeight": null,
"parcelsNumber": "0",
"parcels": null
}, {
"orderID": "XXXXXXX",
"status": "ACCEPTED",
"descrStatus": null,
"fulfillmentStatus": "PACKING",
"fulfillmentDate": null,
"statusDate": null,
"deliveryNote": null,
"tracking": null,
"trackingNumber": null,
"courier": "XXXXXX",
"exceptionCode": null,
"exception": null,
"totalWeight": null,
"parcelsNumber": "0",
"parcels": null
}]
}
Create order to be confirmed
The data are passed inside the variable $data with Json format according to the same requirements avoided in the insert order function.
$url="http://62.97.45.44:443/webapp/api/index.php/insertorderConfirmation";
$token = "Token read during authentication procedure";
$data = '{"1":{"orderID":"XXXX","customerName":"XXXX","destAddress":"XXXX","destPostalCode":"XXXX","destCity":"XXXX""destCountryCode":"XX","destAreaCode":"XX","destPhone":"XXXXXX","destEmail":"XXXXx@XXXX.it","orderDate":"YYYY-MM-DD""deliveryInfo":"XXXX",","cod":1,"totalAmount":XX.XX,"orderRowID":X,"productID":"XXXXX","productName":"XXXXX","productQty":X}}';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Authorization: '.$token));
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
if (curl_errno($ch)) {
echo curl_errno($ch);
echo curl_error($ch);
} else {
$result = curl_exec($ch);
$response = json_decode( $result );
echo $result;
curl_close($ch);
}
Response
Same of Create order
Get status order to be confirmed
The only significant field is the orderID to which the ID of the order you want to query is passed.
$url="http://62.97.45.44:443/webapp/api/index.php/getConfirmedStatus";
$token = "Token read during authentication procedure";
$data = '{"orderID":"XXXXX"}';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, 'GET' );
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_POST, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Authorization: '.$token));
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
if (curl_errno($ch)) {
echo curl_errno($ch);
echo curl_error($ch);
$status = array("status" => "error", "msg" => "Ordine non trovato");
} else {
$result = curl_exec($ch);
curl_close($ch);
$response = json_decode( $result );
echo $result;
}
DAP normalized statuses
Status | Description |
---|---|
CONFIRMED | ORDER CONFIRMED |
NEW | OORDER INSERTED, NOT YET PROCESSED |
REFUSED | REFUSED ORDER |
PENDING | ORDER IN PROGRESS |
FAKE | INVALID ORDER |
Response
{
"status": "success",
"message": "Data selected from database",
"data": [{
"status": "XXX"
}]
}
Get list of orders returned
$url="http://62.97.45.44:443/webapp/api/index.php/getloadedreturned";
$token = "Token read during authentication procedure";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, 'GET' );
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_POST, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Authorization: '.$token));
if (curl_errno($ch)) {
echo curl_errno($ch);
echo curl_error($ch);
$status = array("status" => "error", "msg" => "No returned found");
} else {
$result = curl_exec($ch);
curl_close($ch);
$response = json_decode( $result );
echo $result;
}
Response
{
"status":"success",
"message":"Data selected from database",
"data":[
{
"deliveryNote":"DDT00001",
"returndate":"YYYY-MM-DD HH:MM:SS",
"productId":"XXX",
"expireDate":"XXX",
"batchID:"XXXXXXXXXX",
"productName":"XXXXXXXXXX",
"productQty":"X",
"status":"OK" // IF OK REUSABLE PRODUCT
},
{
"deliveryNote":"DDT00001",
"returndate":"YYYY-MM-DD HH:MM:SS",
"productId":"XXX",
"expireDate":"XXX",
"batchID:"XXXXXXXXXX",
"productName":"XXXXXXXXXX",
"productQty":"X",
"status":"KO" // IF KO NON-REUSABLE PRODUCT
}
]
}
Get GLS history
$token = "Token read during authentication procedure";
$data = '{"deliveryNote":"DDT READ WITH QUERY LAST STATUS","codvet":"GLS"}';
$url = "http://62.97.45.44:443/webapp/api/index.php/getGLSstorico";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Authorization: '.$token));
curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, 'GET' );
curl_setopt( $ch, CURLOPT_POSTFIELDS, $data );
if (curl_errno($ch)) {
$status = array("status" => "error", "msg" => "Shipping Not Found ".curl_error($ch));
echo json_encode($status);
} else {
$result = curl_exec($ch);
$response = json_decode( $result, true );
if ($response['status']=='success') {
echo json_encode($response);
} else {
echo "Tracking non trovato";
}
curl_close($ch);
}
Response
{
"status": "success",
"message": "Status got it successfully.",
"data": {
"ELENCO": [{
"SPEDIZIONE": [{
"NumSped": [{ "_": "XXXXXXXX" }],
"Bda": [{ "_": "XXXXXX" (DDT) }],
"DataPartenza": [{ "_": "XX/XX/XXXX" }],
"SedePartenza": [{ "_": "XX" }],
"LocalitaSedePartenza": [{ "_": "XXX" }],
"Destinatario": [{ "_": "XXXXXXXXXXXXX" }],
"IndirizzoDestinazione": [{ "_": "XXXXXXXXXXXXXXX" }],
"CapDestinatario": [{ "_": "XXXXXX" }],
"CittaDestinazione": [{ "_": "XXXXXXXX" }],
"SedeDestinazione": [{ "_": "XXXXX" }],
"LocalitaSedeDestinazione": [{ "_": "XXXXXXXXX" }],
"ProvinciaSedeDestinazione": [{ "_": "XX" }],
"CapSedeDestinazione": [{ "_": "XXXXX" }],
"IndirizzoSedeDestinazione": [{ "_": "XXXXXXXXXXX" }],
"TelefonoSedeDestinazione": [{ "_": "+XXXXXXXXXXX" }],
"FaxSedeDestinazione": [{ "_": "+XXXXXXXXXX" }],
"StatoSpedizione": [{ "_": "XXXXXX" }],
"DataConsegna": [{ "_": "XX/XX/XXXXX" }],
"Note": [{ "_": "XXXXXXXXXXX" }],
"NumeroColli": [{ "_": "X" }],
"Peso": [{ "_": "XX" }],
"Contrassegno": [{ "_": "XXXX" }],
"TRACKING": [{
"Data": [{ "_": "XX/XX/XX" }, { "_": "XX/XX/XX" }, { "_": "XX/XX/XX" }],
"Ora": [{ "_": "XX:XX" }, { "_": "XX:XX" }, [] ],
"Luogo": [{ "_": "XXXX" }, { "_": "XXXX" }, { "_": "XXX" }],
"Stato": [{ "_": "XXXXXXXX" }, { "_": "XXXXXXXXXXX" }, { "_": "XXXXXXXXXXXXXXXX" }],
"Note": [ [], [], [] ],
"Codice": [{ "_": "XX" }, { "_": "XXX" }, { "_": "XXX" }]
}]
}]
}]
}
}
Solve Underivable TIPSA
For the release of the stock in Spain through the courier TIPSA you can use the following function. The fields to fill in are:
deliveryNote -> The unique delivery note (mandatory)
solveCode -> Code to be sent identifying the action to be applied to the shipment (mandatory)
Code | Action |
---|---|
9999 | Free text. It is possible to associate a custom action, the text will be visible to the courier that will perform that action (e.g. change address, telephone number, etc...) FREE TEXT MUST BE IN SPANISH |
5 | Back to the warehouse. The courier is instructed not to make any more delivery attempts and the goods will be stored in the warehouse again. |
13 | Destruction of the merchandise. |
1 | Redelivery |
solveText -> Custom test to be performed for shipping. (mandatory if solveCode = 9999) FREE TEXT MUST BE IN SPANISH
$token = "token read in the login procedure";
$data = '{"deliveryNote":"XXXXXX","solveCode":"XXX","solveText":"XXXXX"}';
$url="XXXXXXXXXXX"; // the url will be provided later
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Authorization: '.$token));
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
if (curl_errno($ch)) {
echo curl_errno($ch);
echo curl_error($ch);
}else{
$result = curl_exec($ch);
$response = json_decode( $result );
echo $result;
curl_close($ch);
}
Solve Underivable GLS
The following function can be used to release the stock via the GLS courier. The fields to fill in are:
ldv -> Waybill. It is visible either in the courier's tracking or you can get it through the function "getlaststatus" (mandatory)
user -> GLS username provided by DapSides (mandatory)
pwd -> GLS password provided by DapSides (mandatory)
customerName -> Recipient's name (mandatory if solveCode = 2)
destAddress -> Recipient address (mandatory if solveCode = 2)
destPostalCode -> Recipient's zip code (mandatory if solveCode = 2)
destCity -> City of the recipient (mandatory if solveCode = 2)
destAreaCode -> Province of the recipient (mandatory if solveCode = 2)
destPhone -> Recipient mobile phone
deliveryInfo -> Shipping notes
dateOfDelivery -> redelivery date in dd/mm/yyyy format
solveCode -> Code to be sent identifying the action to be applied to the shipment (mandatory)
Code | Action |
---|---|
1 | Redelivery to the same address |
2 | Redelivery to other address |
3 | Return to sender |
4 | Destroy |
7 | Customer Pick-up |
$token = "token read in the login procedure";
$data = '{"ldv":"XXXXXX","user":"XXXXXX","pwd":"XXXXX","customerName":"XXXXXXX","destAddress":"XXXXXX","destPostalCode":"XXXX","destCity":"XXXX","destAreaCode":"XX", "destPhone":"XXXXXXX","deliveryInfo":"XXXXX","dateOfDelivery":"XX-XX-XXXX","solveCode":X}';
$url="XXXXXXXXXXX"; // the url will be provided later
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Authorization: '.$token));
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
if (curl_errno($ch)) {
echo curl_errno($ch);
echo curl_error($ch);
}else{
$result = curl_exec($ch);
$response = json_decode( $result );
echo $result;
curl_close($ch);
}
Solve Underivable GLS Spain
The following function can be used to release the stock via the GLS Spain courier. The fields to fill in are:
orderID -> Order identification number provided by you to DapSides (mandatory)
solveText -> Free text with Spanish language action (e.g. change phone number, address, etc...) (mandatory if solveCode = 31)
solveCode -> Code to be sent identifying the action to be applied to the shipment (mandatory)
Code | Action |
---|---|
39 | Return to sender |
46 | Destroy |
31 | Free Text |
$token = "token read in the login procedure";
$data = '{"orderID":"XXXXXX","solveCode":"XX","solveText":"XXXXX"}';
$url="XXXXXXXXXXX"; // the url will be provided later
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Authorization: '.$token));
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
if (curl_errno($ch)) {
echo curl_errno($ch);
echo curl_error($ch);
}else{
$result = curl_exec($ch);
$response = json_decode( $result );
echo $result;
curl_close($ch);
}
Solve undeliverable SDA
The following function can be used to release the stock via the SDA courier. The fields to fill in are:
ldv -> Waybill. It is visible either in the courier's tracking or you can get it through the function "getlaststatus" (mandatory)
deliveryInfo -> Free text with useful delivery information
dateOfDelivery -> Redelivery day (yyyy-mm-dd) (mandatory)
redeliveryHourFrom -> Redelivery Time From (hh:mm) (mandatory)
redeliveryHourTO -> Redelivery Time To (hh:mm) (mandatory)
destAddress -> Recipient address (if different from initial data)
destPostalCode -> Recipient's zip code (if different from initial data)
destCity -> City of the recipient (if different from initial data)
destAreaCode -> Province of the recipient (if different from initial data)
destPhone -> Recipient mobile phone (if different from initial data)
solveCode -> Code to be sent identifying the action to be applied to the shipment (mandatory)
Code | Action |
---|---|
GGG | Redelivery |
RRR | Return to sender |
FDP | Customer Pick-up |
$token = "token read in the login procedure";
$data = '{"ldv":"XXX","solveCode":"XXX","deliveryInfo":"XXXX","redeliveryDate":"XXXX-XX-XX","redeliveryHourFrom":"XX:XX","redeliveryHourTO":"XX:XX"}';
$url="XXXXXXXXXXX"; // the url will be provided later
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Authorization: '.$token));
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
if (curl_errno($ch)) {
echo curl_errno($ch);
echo curl_error($ch);
}else{
$result = curl_exec($ch);
$response = json_decode( $result );
echo $result;
curl_close($ch);
}
Solve undeliverable BRT
The following function can be used to release the stock via the BRT courier. The fields to fill in are:
deliveryNote -> The unique delivery note. It is visible either in the courier's tracking or you can get it through the function "getlaststatus" (mandatory)
solveText -> Text to be sent identifying the action to be applied to the shipment (mandatory)
$token = "token read in the login procedure";
$data = '{"deliveryNote":"XXX","solveText":"XXXXXXX"}';
$url="XXXXXXXXXXX"; // the url will be provided later
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Authorization: '.$token));
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
if (curl_errno($ch)) {
echo curl_errno($ch);
echo curl_error($ch);
}else{
$result = curl_exec($ch);
$response = json_decode( $result );
echo $result;
curl_close($ch);
}
Create Contact
Populate the $data variable according to the values to be inserted in the cloud
Field | Description | Required | Val. |
---|---|---|---|
customerFirstName | First name | * | VARCHAR(30) |
customerLastName | Last name | * | VARCHAR(30) |
destMobile | mobile phone | * | VARCHAR(10) |
destPhone | phone | VARCHAR(10) | |
leadSource | Lead origin (form, fb campaign, etc.) | VARCHAR(30) | |
leadID | Lead identification code, if not sent a DAP code will be sent | VARCHAR(12) | |
orderRowID | * | Index used to group multiple products into one order. If an order includes several products within a json record, progressively increase the data by the number of records present. | VARCHAR(12) |
destEmail | VARCHAR(30) | ||
destAddress | Address | VARCHAR(50) | |
destCity | City | VARCHAR(30) | |
destAreaCode | Province | VARCHAR(30) | |
destPostalCode | ZIP CODE | VARCHAR(30) | |
destCountryCode | Country (IT, ES ...) | VARCHAR(2) | |
deliveryInfo | Delivery Information | VARCHAR(30) | |
offerta | Offer name | VARCHAR(30) | |
urlPromo | Promotion links | VARCHAR(30) | |
networkAffiliazioni | Network from lead | VARCHAR(20) | |
checkPrivacy | Flag 0|1 if privacy is accepted | * | BOOLEAN |
cod | Cash on Delivery (0 = prepaid order | 1 = cash on delivery payment) | * | BOOLEAN |
productID | Product identification | * | VARCHAR(20) |
productName | Product description | * | VARCHAR(20) |
productQty | Quantity ordered | * | VARCHAR(10) |
totalAmount | Total price | * | DECIMAL(10,2) |
num_vet | Courier code (agreed with DAP) | * | INT(10) |
$token = "token read in the login procedure";
$url="http://62.97.45.44:443/webapp/api/index.php/insertLead";
$data = '{"1":{"leadID":"XXXX","customerFirstName":"XXX","customerLastName":"XXX", "destMobile":"XXXXX", "cod":"X", "productID":"XXXXXX", "productQty":"XXXXXX", "checkPrivacy":"X", "totalAmount": "XX.XX", "num_vet": "1"}}';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Authorization: '.$token));
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
if (curl_errno($ch)) {
echo curl_errno($ch);
echo curl_error($ch);
} else {
$result = curl_exec($ch);
$response = json_decode($result);
echo $result.PHP_EOL;
curl_close($ch);
}
Response
Same of Create order
Get contact status
The only significant field is the orderID to which the ID of the lead you want to query is passed.
$url="http://62.97.45.44:443/webapp/api/index.php/getLeadStatus";
$token = "token read in the login procedure";
$data = '{"leadID":"ID_LEAD"}';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, 'GET' );
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_POST, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Authorization: '.$token));
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
if (curl_errno($ch)){
echo curl_errno($ch);
echo curl_error($ch);
$status = array("status" => "error", "msg" => "Shipment not found");
}else{
$result = curl_exec($ch);
curl_close($ch);
$response = json_decode( $result );
echo $result;
}
Response
{
"status": "success",
"message": "Data selected from database",
"data": [{
"status": "XXXXX"
}]
}
DAP normalized statuses
Status | Description |
---|---|
NEW | LEAD INSERTED, NOT YET PROCESSED |
IN LAVORAZIONE | LEAD IN PROGRESS |
DA RICONTATTARE | LEAD TO BE CONTACTED LATER |
CONFERMATO | LEAD CONFIRMED |
FAKE | INVALID LEAD |
RIFIUTATO | REFUSED LEAD |
Get product stock
By entering an item number in the given variable, the procedure will only return the stock of that item. Otherwise, if the date variable is empty ( $data = '{"item":""}'; ) the procedure will return the stock of all products in the registry
$token = "token read in the login procedure";
$data = '{"item":"article_code"}';
$url="http://62.97.45.44:443/webapp/api/index.php/getqtyproduct";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, 'GET' );
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_POST, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Authorization: '.$token));
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
if (curl_errno($ch)) {
echo curl_errno($ch);
echo curl_error($ch);
$status = array("status" => "error", "msg" => "Product not found");
} else {
$result = curl_exec($ch);
curl_close($ch);
$response = json_decode( $result );
$tt = array();
$i=1;
echo $result;
}
Response
{
"status": "success",
"message": "Data selected from database",
"data": [
{
"country": "XX",
"lotto": "XXXXXXXXXX",
"name": "XXXXXXXXXX",
"qty": "XXXX"
},
{
"country": "XX",
"lotto": "XXXXXXXXXX",
"name": "XXXXXXXXXX",
"qty": "XXXX"
},
}
]
}
Create Incoming Goods
The data is passed within the $data variable in Json format..
Data | Required | Description | Val. |
---|---|---|---|
orderID | * | Unique order identification number | VARCHAR(12) |
country | * | Warehouse country | VARCHAR(2) |
orderDate | Date of order | DATE(Y-m-d) | |
arrivalDate | Date of arrival | DATE(Y-m-d) | |
deliveryInfo | Useful comments for the warehouse | VARCHAR(50) | |
orderRowID | * | Index used to group multiple products into one order. If an order includes several products within a json
record, progressively increase the data by the number of records present.
In the first 2 lines we have the same orderID but different rowOrderID, this allows
the system to place an order with more than one associated product, if the order provides for a further
product then the next line will have the same orderID.In the
third line we have an order with a single product.
|
VARCHAR(12) |
productID | * | Product identification code on the cloud | VARCHAR(20) |
batchID | Product Batch Identifier | VARCHAR(20) | |
expireDate | Product expire Date | DATE(Y-m-d) | |
productName | * | Product name in the cloud | VARCHAR(30) |
productQty | * | Quantity of product ordered | INT(10) |
cod_vettore | Courier name | VARCHAR(5) | |
deliveryNote | Courier Delivery Note | VARCHAR(20) | |
ldv | Courier Waybill | VARCHAR(20) | |
codForn | Supplier code identifier | VARCHAR(12) | |
descrForn | Supplier Name | VARCHAR(20) |
$url="http://62.97.45.44:443/webapp/api/index.php/insertIncomingGoods";
$token = "token read in the login procedure";
$data = '{"1":{"orderDate":"YYYY-MM-DD","orderID":"TEST1234","deliveryNote":"022593","ldv":"123465798","cod_vettore":"GLS","arrivalDate":"YYYY-MM-DD","productID":"TT1",
"productName":"TEST PRODUCT","productQty":100,"country":"IT","batchID":"11223344","expireDate":"YYYY-MM-DD","deliveryInfo":"Additional Info","codForn":"XXX",
"descrForn":TEST FORN,"orderRowID":1}}';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Authorization: '.$token));
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
if (curl_errno($ch)) {
echo curl_errno($ch);
echo curl_error($ch);
}else{
$result = curl_exec($ch);
$response = json_decode( $result );
echo $result;
curl_close($ch);
}
Response
{
"status": "success", (Insert status. Possible values: success or error)
"message": "Order added successfully.", (Insert description. If there's an error will be display the description.)
"data": "XXXXX" (DAP internal reference. Only if status = success)
}
Eg. Errore
{
"status": "error",
"message": "Duplicate orderID"
}
Get Incoming Goods Status
The only significant field is the orderID to which the ID of the order you want to query is passed and country of referred warehouse.
$url="http://62.97.45.44:443/webapp/api/index.php/getIncomingGoodsStatus";
$token = "Token read during authentication procedure";
$data = '{"orderID":"ORDER_NUMBER","country":"WAREHOUSE COUNTRY"}';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, 'GET' );
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_POST, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Authorization: '.$token));
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
if (curl_errno($ch)){
echo curl_errno($ch);
echo curl_error($ch);
$status = array("status" => "error", "msg" => "Shipment not found");
}else{
$result = curl_exec($ch);
curl_close($ch);
$response = json_decode( $result );
echo $result;
}
DAP normalized statuses
Status | Description |
---|---|
ACCEPTED | GOODS LOADED |
RECEIVED | SHIPMENT RECEIVED BY OUR SYSTEMS BUT NOT LOADED |
LOADED | GOODS LOADED |
Response
{
"status": "success",
"message": "Data selected from database",
"data": [{
"status": "ACCEPTED",
"orderID": "TT123528",
"cod_vettore": "DHL",
"deliveryNote": "",
"ldv": "",
"codForn": null,
"productID": "777",
"batchID": null,
"expireDate": null,
"orderRowID": "1",
"productQty": "50",
"productQtyChecked": "48" //numbers of pieces loaded
}]
}