Get started
API Endpoint
Production: https://app.sendecollect.com/api/p2p/api/v1/
The Sendecollect Point2Point API provides programmatic access to read and write shipments data. API response always returns a JSON.
To use this API, you need an account and an API Token.
Once you create an account on our platform, your login email will be your user parameter.
You can find and activate your API Token in your Profile page.
Get Points
#PHP-CURL full parameters example
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://app.sendecollect.com/api/p2p/api/v1/getPoints',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => array(
'user' => 'your_sendecollect_username',
'api_token' => 'your_sendecollect_apitoken',
'country' => 'IT',
'address' => '41.89044855096006,12.491060229550026',
'distance' => '7',
'lang' => 'en',
'lat' => '41.89044855096006',
'lng' => '12.491060229550026',
'external_source' => 1
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
To get the list of available points for the Sendecollect Delivery service, you need to make a POST request to:
getPoints.
Success response:{ "response": 200, "count": 1, "items": [ { "idPoint": "1234", "pointName": "(Point Partner) DITTA INDIVIDUALE", "pointLabel": "ditta individuale", "pointNetwork": "Point Partner", "pointRole": 16, "pointAddress": "Via Celimontana, 5", "pointCity": "Roma", "pointProvince": "RM", "pointZip": "00184", "email": "pointpartner@sendecollect.com", "phone": "123456789", "latitude": "41.8892095", "longitude": "12.496593", "distance": 0.4638864238842373, "logo": "https://app.sendecollect.com/user/assets/img/avatars/profiles/avatar-base.png", "pointOpeningTime": [ { "dayNumber": 1, "dayName": "Monday", "dayName_iso3": "Mon", "closed": false, "hours": { "am_open_time": "09:00", "am_closed_time": "", "pm_open_time": "", "pm_closed_time": "18:00" } }, { "dayNumber": 2, "dayName": "Tuesday", "dayName_iso3": "Tue", "closed": false, "hours": { "am_open_time": "09:00", "am_closed_time": "", "pm_open_time": "", "pm_closed_time": "18:00" } }, { "dayNumber": 3, "dayName": "Wednesday", "dayName_iso3": "Wed", "closed": false, "hours": { "am_open_time": "09:00", "am_closed_time": "", "pm_open_time": "", "pm_closed_time": "18:00" } }, { "dayNumber": 4, "dayName": "Thursday", "dayName_iso3": "Thu", "closed": false, "hours": { "am_open_time": "09:00", "am_closed_time": "", "pm_open_time": "", "pm_closed_time": "18:00" } }, { "dayNumber": 5, "dayName": "Friday", "dayName_iso3": "Fri", "closed": false, "hours": { "am_open_time": "09:00", "am_closed_time": "", "pm_open_time": "", "pm_closed_time": "18:00" } }, { "dayNumber": 6, "dayName": "Saturday", "dayName_iso3": "Sat", "closed": false, "hours": { "am_open_time": "09:00", "am_closed_time": "13:00", "pm_open_time": "", "pm_closed_time": "" } }, { "dayNumber": 7, "dayName": "Sunday", "dayName_iso3": "Sun", "closed": true, "hours": [] } ] } ] }Error response:{ "response": 400, "error": "error_code", "message": "error_description" }
QUERY PARAMETERS
| Field | Type | Required | Description |
|---|---|---|---|
| user | String | Yes | Your Sendecollect account login (email) |
| api_token | String | Yes | Your Sendecollect API Token. |
| country | String | Yes | The country short name in English as in ISO 3166. Allowed countries: IT |
| address | String | Yes | The address to use to search Points around. It can be in the address format or coordinates format (latitute and longitude separated by comma). |
| distance | Float | Yes | Distance radius from address, in Km. |
| lat | Float | No | Latitude to use to search Points around. Mandatory if used external_source parameter |
| lng | Float | No | Longitude to use to search Points around. Mandatory if used external_source parameter |
| external_source | boolean | No | If used, lat and lng parameters will be used, instead of address parameter (which remains mandatory). This can speed-up the request |
| lang | String | No | Errors responses language. Default is english. Available: en, it |
RESPONSE PARAMETERS
| Field | Response | Description |
|---|---|---|
| response | 200 if success, 400 if error | |
| count | 200 | number of Points found |
| items | 200 | Points list container |
| idPoint | 200 | Point ID. |
| pointName | 200 | Point business name |
| pointLabel | 200 | Point signboard on the street |
| pointNetwork | 200 | Point network |
| pointRole | 200 | Internal Sendecollect parameter |
| pointAddress | 200 | Complete Point address |
| pointCity | 200 | Point city |
| pointProvince | 200 | Point province |
| pointZip | 200 | Point zip code |
| 200 | Point email | |
| phone | 200 | Point phone number |
| latitute | 200 | Point coordinate: latitude |
| longitude | 200 | Point coordinate. longitude |
| distance | 200 | Point distance from the searched address |
| logo | 200 | Point profile logo |
| pointOpeningTime | 200 | Point's Days and hours opening time |
| pointOpeningTime > dayNumber | 200 | Days of the week from 1 (Monday) to 7 (Sunday) |
| pointOpeningTime > dayName | 200 | Corresponding day name of dayNumber |
| pointOpeningTime > closed | 200 | Indicates whenever the point is closed or not in that specific day (boolean) |
| pointOpeningTime > hours | 200 | AM and PM hours opening time in that day. If closed is true, this is an empty array. |
| error | 400 | Error code. Check Errors for more details. |
| message | 400 | Error description. Language used is based on lang parameter. Default: en |
Errors
Sendecollect APIs use the following error codes:
| Error Code | Meaning |
|---|---|
| AUTH01 |
Unauthorized, unknown or unvalid user token. This error appears if you use an unknow user token or if the user token expired or there aren't any token passed into the request.
|
| AUTH02 |
APIs not enabled. This error appears if you pass a token or a user which hasn't APIs enabled.
|
| RESOURCE01 |
Can't delete this resource. This error appears if you try to delete a resource which cannot be deleted.
|
| SHIP01 |
Shipment not found. This error appears if try to retrieve a shipment which does not exist.
|
| SHIP02 |
Can't delete this shipment because it's not active or has been already processed. This error appears if try to delete a shipment which cannot be deleted because it has already been processed or not active.
|
| POINT01 |
Point not found. This error appears if you try to retrieve a point which does not exist or cannot be retrieved.
|
| POINT02 |
Point not available. This error appears if you try to retrieve a point which is not available or active.
|
| ADDRESS01 |
Address field required. This error appears if you try to perform a request and address is not included into the request.
|
| ADDRESS02 |
Address field format string. This error appears if you try to pass an invalid format as address into the request.
|
| DISTANCE01 |
Distance field required. This error appears if you try to perform a request and distance is not included into the request.
|
| DISTANCE02 |
Distance field format integer. This error appears if you try to pass an invalid format as distance into the request.
|
| DEVPOINT01 |
Delivery point field required. This error appears if you try to perform a request and deliveryPoint is not included into the request.
|
| DEVPOINT02 |
Delivery point field format integer. This error appears if you try to pass an invalid format as deliveryPoint into the request.
|
| SENDNAME01 |
Sender name field required. This error appears if you try to perform a request and senderName is not included into the request.
|
| SENDNAME02 |
Sender name field format string. This error appears if you try to pass an invalid format as senderName into the request.
|
| RECNAME01 |
Recipient name field required. This error appears if you try to perform a request and recipientName is not included into the request.
|
| RECNAME02 |
Recipient name field format string. This error appears if you try to pass an invalid format as recipientName into the request.
|
| PARCELWE01 |
Parcel's weight field required. This error appears if you try to perform a request and parcelWeight is not included into the request.
|
| PARCELWE02 |
Parcel's weight field format integer. This error appears if you try to pass an invalid format as parcelWeight into the request.
|
| PARCELH01 |
Parcel's height field required. This error appears if you try to perform a request and parcelHeight is not included into the request.
|
| PARCELH02 |
Parcel's height field format integer. This error appears if you try to pass an invalid format as parcelHeight into the request.
|
| PARCELWI01 |
Parcel's width field required. This error appears if you try to perform a request and parcelWidth is not included into the request.
|
| PARCELWI01 |
Parcel's width field format integer. This error appears if you try to pass an invalid format as parcelWidth into the request.
|
| PARCELL01 |
Parcel's length field required. This error appears if you try to perform a request and parcelLength is not included into the request.
|
| PARCELL02 |
Parcel's length field format integer. This error appears if you try to pass an invalid format as parcelLength into the request.
|
| SENDADDRESS01 |
Sender address field required. This error appears if you try to perform a request and senderAddress is not included into the request.
|
| SENDADDRESS02 |
Sender address field format string. This error appears if you try to pass an invalid format as senderAddress into the request.
|
| SENDPHONE01 |
Sender phone field required. This error appears if you try to perform a request and senderPhone is not included into the request.
|
| SENDPHONE02 |
Sender phone field format not allowed. This error appears if you try to pass an invalid format as senderPhone into the request.
|
| SENDEMAIL01 |
Sender email field required. This error appears if you try to perform a request and senderEmail is not included into the request.
|
| SENDEMAIL02 |
Sender email field format not allowed. This error appears if you try to pass an invalid format as senderEmail into the request.
|
| SENDCITY01 |
Sender city field required. This error appears if you try to perform a request and senderCity is not included into the request.
|
| SENDCITY02 |
Sender city field format not allowed. This error appears if you try to pass an invalid format as senderCity into the request.
|
| SENDZIPCODE01 |
Sender zipcode field required. This error appears if you try to perform a request and senderZip is not included into the request.
|
| SENDZIPCODE02 |
Sender zipcode field format string. This error appears if you try to pass an invalid format as senderZip into the request.
|
| SENDZIPCODE03 |
Sender zipcode field format not allowed. This error appears if you try to pass an invalid format as senderZip into the request.
|
| SENDZIPCODE04 |
Sender zipcode field min 5 chars. This error appears if you try to pass a value less than 5 chars as senderZip into the request.
|
| SENDZIPCODE05 |
Sender zipcode field max 5 chars. This error appears if you try to pass a value greater than 5 chars as senderZip into the request.
|
| RECADDRESS01 |
Recipient address field required. This error appears if you try to perform a request and recipientAddress is not included into the request.
|
| RECADDRESS02 |
Recipient address field format string. This error appears if you try to pass an invalid format as recipientAddress into the request.
|
| RECPHONE01 |
Recipient phone field required. This error appears if you try to perform a request and recipientPhone is not included into the request.
|
| RECPHONE02 |
Recipient phone field format not allowed. This error appears if you try to pass an invalid format as recipientPhone into the request.
|
| RECEMAIL01 |
Recipient email field required. This error appears if you try to perform a request and recipientEmail is not included into the request.
|
| RECEMAIL02 |
Recipient email field format not allowed. This error appears if you try to pass an invalid format as recipientEmail into the request.
|
| RECCITY01 |
Recipient city field required. This error appears if you try to perform a request and recipientCity is not included into the request.
|
| RECCITY02 |
Recipient city field format not allowed. This error appears if you try to pass an invalid format as recipientCity into the request.
|
| RECZIPCODE01 |
Recipient zipcode field required. This error appears if you try to perform a request and recipientZip is not included into the request.
|
| RECDZIPCODE02 |
Recipient zipcode field format string. This error appears if you try to pass an invalid format as recipientZip into the request.
|
| RECZIPCODE03 |
Recipient zipcode field format not allowed. This error appears if you try to pass an invalid format as recipientZip into the request.
|
| RECZIPCODE04 |
Recipient zipcode field min 5 chars. This error appears if you try to pass a value less than 5 chars as recipientZip into the request.
|
| RECZIPCODE05 |
Recipient zipcode field max 5 chars. This error appears if you try to pass a value greater than 5 chars as recipientZip into the request.
|
| LAT01 |
Latitude field required. This error appears if you try to perform a request and lat is not included into the request.
|
| LNG01 |
Longitude field required. This error appears if you try to perform a request and lng is not included into the request.
|
| EXTSOURCE01 |
External source field format bool. This error appears if you try to pass an invalid format as external_source into the request.
|
| PRINTFORMAT02 |
Print format field format not allowed. This error appears if you try to pass an invalid format as printFormat into the request.
|
| LBLDIGITAL02 |
Label digital field format not allowed. This error appears if you try to pass an invalid format as digital into the request.
|
| URL02 |
Url field format not allowed. This error appears if you try to pass an invalid format as customLogo into the request.
|
| NOTE02 |
Note field format string. This error appears if you try to pass an invalid format as note into the request.
|
| PSIZE01 | Parcel's sizes not allowed. This error appears if you try to pass parcel's sizes not allowed into the request. |
| SERVICES01 |
Services field format json. This error appears if you try to pass an invalid format as services into the request.
|
| SERVICES02 |
Services: each value's key need to be 0 or 1. This error appears if you try to pass at least an invalid value to one key in services into the request.
|
| COUNTRY01 |
Country field required. This error appears if you try to perform a request and country is not included into the request.
|
| COUNTRY02 |
Country not allowed. This error appears if you try to pass an invalid value for country into the request.
|