API TRACKING COURSIER.FR V3 (EN)

08/06/2020 logo_coursier.png Version 3.1

 

Objective

Follow every events related to the given mission : removal, shipping, approaches, courier information, reprogramming, proof of delivery. It's possible to retrieve all ongoing missions for a massive update as well.

 

Protocol

Requests are made via HTTPS with the url api.coursier.fr/v3/tracking.php, the response is a JSON containing all the delivery information. toutes les informations de la course. In case of load failure, several records will be sent, each with their own information. 

 

Authentication

The authentication happens with an apikey paired to your coursier.fr user, these informations can be found in your customer area. You must have a monthly billing account, if it is not the case, you may contact a salesman at commercial@coursier.fr. You must give as parameters the apikey, the user and the customer account used (a user can be associated with several customer accounts).

In order to test our APIs, as of now you may use the following testing account to begin your developping tasks while you wait for your definitive credentials :

User : test@apicfr.fr

Pass : T3stCFR*

ClientId : 7055339

Apikey : e1ab1411d66765e73cf4b068d39cda8a

 

Parameters

Parameters must be send in a JSON array using the POST method.

NAME

REQUIRED

TYPE

DESCRIPTION

User

Y

Varchar(32)

User to access the coursier.fr interfaces

 

Apikey

Y

Varchar(32)

Apikey linked to your user

 

ClientId

Y

int

Customer account number

 

MissionNumber

Y

int

ID of the delivery, obtained when placing the order. If null or if no set, the api returns all the ongoing mission (missions planned from today 00:00:00)

 

Lang

N

varchar(2)

Language code for the retrieval of messages (default ; FR)

 

JSON Response

The response is a JSON array with all the related information to the delivery or the delivery fragment given. In case of error, the API returns a JSON with a Message field specifying the nature of the error.

NAME

TYPE

DESCRIPTION

MissionId

int

 

ID of the delivery, in case of load failure the ID is different for every fragment.

 

MissionNumber

int

Number of the delivery, this number is the key to interact with our courier or the customer service.

 

From

varchar(80)

Name of the pick-up address

 

To

varchar(80)

Name of the shipping address

 

PickupStartDate

Datetime

Beginning of the pick-up slot

 

PickupEndDate

Datetime

End of the pick-up slot

 

PickupStartEstimate

Datetime

start of the refined window of the date of removal

 

PickupEndEstimate

Datetime

end of the refined window of the date of removal

 

PickupDate

Datetime

Effective date of removal

 

DeliveryStartDate

Datetime

Beginning of the shipping slot

 

DeliveryEndDate

Datetime

end of the shipping slot

 

DeliveryStartEstimate

Datetime

start of the refined window of the date of shipping

 

DeliveryEndEstimate

Datetime

end of the refined window of the date of removal

 

DeliveryDate

Datetime

Effective date of shipping

 

State

varchar(50)

Status of the mission :

-       Picked up

-       Delivered

-       Canceled

-       To be invoiced

-       Billed

-       Incident

-       not yet dispatched

WorkerShortCode

varchar(5)

Autentication code of the driver

 

WorkerSurname

varchar(100)

Surname of driver

 

WorkerPicture

varchar(100)

Url of the driver photo

 

ProofOfdelivery

varchar(100)

Url of the signature photo

DeliverySignee

varchar(30)

Name of the signer

 

API call example
<?php
$Url = "https://api.coursier.fr/v3/tracking.php";
$Data = array('User' => 'test@apicfr.fr',
			  'Apikey' => 'e1ab1411d66765e73cf4b068d39cda8a',
			  'ClientId' => '7055339',
			  'MissionNumber' => '9005657',
			  'Lang' => 'FR',
			 );

$datajson = json_encode($data);
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $datajson);
curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$res = curl_exec($curl);
curl_close($curl);
var_dump($res);
?>

 

Response example

[{"MissionId":"10009999","MissionNumber":"9005657","From":"Boutique Georges 5","To":"Hub Coursier.fr","PickupStartDate":"2020-06-26 11:00:00","PickupEndDate":"2020-06-26 12:00:00","PickupStartEstimate":"","PickupEndEstimate":"","PickupDate":"2020-06-26 11:24:52","DeliveryStartDate":"2020-06-26 12:00:00","DeliveryEndDate":"2020-06-26 13:00:00","DeliveryStartEstimate":"2020-06-26 12:05:00","DeliveryEndEstimate":"2020-06-26 12:15:00","DeliveryDate":"","State":"En approche livraison","WorkerShortCode":"710","WorkerSurname":"Laurent","Picture":"https:\/\/iris.coursier.fr\/worker\/view\/710","ProofOfDelivery":"","DeliverySignee":""},{"MissionId":"10009999","MissionNumber":"9005657","From":"Hub Coursier.fr","To":"Yann THEBAULT","PickupStartDate":"2020-06-26 19:00:00","PickupEndDate":"2020-06-26 20:00:00","PickupStartEstimate":"","PickupEndEstimate":"","PickupDate":"","DeliveryStartDate":"2020-06-26 20:00:00","DeliveryEndDate":"2020-06-26 22:00:00","DeliveryStartEstimate":"","DeliveryEndEstimate":"","DeliveryDate":"","State":"","WorkerShortCode":"","WorkerSurname":"","Picture":"","ProofOfDelivery":"","DeliverySignee":""}]