Introduction
Welcome to the Spedisci.Online API! You can use our API to access Spedisci.Online API endpoints, which can get information on various data in your account (Tracking, Rates, Credit, etc) , and access to create specific objects, like Orders, Shippings Labels, and Reports..
EndPoints
Endpoints are located at your subdomain https://{subdomain}.spedisci.online/api/v2/ ( https://example.spedisci.online/api/v2/ )
Authentication
Go to Settings -> Api key on your account:
The Authorization header is constructed as follows:
Authorization: Bearer qCL7FN2RKFQDngWb6kJ7fwxfF1yXQt6lNLN32K1tdNxVNnpBWL4qoOEWVJ8e
Shipments
Get Rates
POST Request Body:
curl --location --request POST 'https://example.spedisci.online/api/v2/shipping/rates' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer qCL7FN2RKFQDngWb6kJ7fwxfF1yXQt6lNLN32K1tdNxVNnpBWL4qoOEWVJ8u' \
--data-raw '{
"packages": [{
"length": 17,
"width": 25,
"height": 26,
"weight": 3
}
],
"shipFrom": {
"name": "Antonio Esposito",
"company": "Spedisci.Online",
"street1": "via guglielmo sanfelice 8",
"street2": "",
"city": "Napoli",
"state": "NA",
"postalCode": "80134",
"country": "IT",
"phone": null,
"email": "email@example.com"
},
"shipTo": {
"name": "Mario Rossi",
"company": "",
"street1": "Via Roma 2",
"street2": "",
"city": "Telese Terme",
"state": "BN",
"postalCode": "82037",
"country": "IT",
"phone": null,
"email": "email@example.com"
},
"notes":"test api",
"insuranceValue": 0,
"codValue":0,
"accessoriServices": []
}'
JSON Response:
[
{
"carrierCode": "gls",
"contractCode": "gls-standard",
"weight_price": "3.80",
"insurance_price": "3.00",
"cod_price": "3.00",
"services_price": "0.00",
"fuel": "0.00",
"total_price": "9.80"
},
{
"carrierCode": "gls",
"contractCode": "gls-light",
"weight_price": "5.00",
"insurance_price": "3.00",
"cod_price": "3.00",
"services_price": "0.00",
"fuel": "0.00",
"total_price": "11.00"
}
]
Creates a shipping label. The labelData field returned in the response is a base64 encoded PDF value. Simply decode and save the output as a PDF file to retrieve a printable label. The body of this request has the following attributes:
HTTP Request
POST https://example.spedisci.online/api/v2/shipping/rates
HTTP Headers
Authorization:< Enter your Basic Authorization string here >
Body Request
Name | Data Type | Description |
---|---|---|
packages | array, required | List of Package arrays. Use the Package model. |
shipFrom | Address, required | Address indicating shipment’s origin. Use the Address model. |
shipTo | Address, required | Address indicating shipment’s destination. Use the Address model. |
notes | string, optional | Notes. |
insuranceValue | float, optional | Insurance value. |
codValue | float, optional | Cash on delivery value. |
JSON Response
Name | Data Type | Description |
---|
Create Label
POST Request Body:
curl --location --request POST 'https://example.spedisci.online/api/v2/shipping/create' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer qCL7FN2RKFQDngWb6kJ7fwxfF1yXQt6lNLN32K1tdNxVNnpBWL4qoOEWVJ8u' \
--data-raw '{
"carrierCode":"liccardi",
"contractCode":"liccardi-LICCARDI",
"packages": [{
"length": 17,
"width": 25,
"height": 26,
"weight": 3
}
],
"shipFrom": {
"name": "Antonio Esposito",
"company": "Spedisci.Online",
"street1": "via guglielmo sanfelice 8",
"street2": "",
"city": "Napoli",
"state": "NA",
"postalCode": "80134",
"country": "IT",
"phone": null,
"email": "email@example.com"
},
"shipTo": {
"name": "Mario Rossi",
"company": "",
"street1": "Via Roma 2",
"street2": "",
"city": "Telese Terme",
"state": "BN",
"postalCode": "82037",
"country": "IT",
"phone": null,
"email": "email@example.com"
},
"notes":"test api",
"insuranceValue": 0,
"codValue":0,
"accessoriServices": []
}'
JSON Response:
{
"shipmentId": 120177,
"trackingNumber": "DEMO0153283",
"shipmentCost": "6.50",
"labelData": "JVBERi0xLjUNCiX5+prnDQo1IDAgb2JqDQo8PAovRS........",
"labelZPL": "EENUfn5DRCx+Q0NefkNUfgpeWEF+........"
}
Creates a shipping label. The labelData field returned in the response is a base64 encoded PDF value. Simply decode and save the output as a PDF file to retrieve a printable label. The body of this request has the following attributes:
HTTP Request
POST https://example.spedisci.online/api/v2/shipping/create
HTTP Headers
Authorization:< Enter your Basic Authorization string here >
Body Request
Name | Data Type | Description |
---|---|---|
carrierCode | string, optional | Carrier unique code. |
contractCode | string, optional | Contract unique code. |
packages | array, required | List of Package arrays. Use the Package model. |
shipFrom | Address, required | Address indicating shipment’s origin. Use the Address model. |
shipTo | Address, required | Address indicating shipment’s destination. Use the Address model. |
notes | string, optional | Notes. |
insuranceValue | float, optional | Insurance value. |
JSON Response
Name | Data Type | Description |
---|---|---|
shipmentId | string | Unique ID of shipment. |
trackingNumber | string | Tracking Number. |
shipmentCost | string | Total cost of the shipment. |
labelData | base64 | Label PDF base64 encoded. |
labelZPL | base64 | Label ZPL base64 encoded. |
Tracking
Get Tracking
GET Request:
curl "http://example.spedisci.online/api/v2/tracking/CE511169814"
-H "Authorization: Y2xpZW50QHNwZWRpc2NpLm9ubGluZTpwYXNzd29yZA=="
JSON Response:
{
"TrackingDettaglio": [
{
"Data": "22/09/2016 15:22",
"Stato": "CONSEGNATA",
"Luogo": "Cembra"
},
{
"Data": "22/09/2016 15:22",
"Stato": "Consegna prevista nel corso della giornata odierna",
"Luogo": "Trento"
},
{
"Data": "22/09/2016 15:22",
"Stato": "Arrivata in sede destinataria",
"Luogo": "Trento"
},
{
"Data": "21/09/2016 15:22",
"Stato": "Attesa in sede destinataria. Non in consegna in data odierna",
"Luogo": "Trento"
},
{
"Data": "20/09/2016 15:22",
"Stato": "Partita dalla sede mittente. Attesa nella sede destinataria",
"Luogo": "Caserta"
},
{
"Data": "20/09/2016 15:22",
"Stato": "Spedizione registrata nei nostri sistemi ma non ancora partita",
"Luogo": "Caserta"
},
{
"Data": "19/09/2016 17:42",
"Stato": "Spedizione generata. In attesa di ritiro.",
"Luogo": "MACERATA CAMPANIA"
}
]
}
This endpoint retrieves tracking details of a shipping by trackingNumber.
### HTTP Request
GET https://example.spedisci.online/api/v2/tracking/{trackingNumber}
### HTTP Headers
Authorization:< Enter your Basic Authorization string here >
### Response
Name | Data Type | Description |
---|---|---|
Data | string | Date of scan. |
Stato | string | State of shipping. |
Luogo | string | Place of shipping. |
Models
Model - Address
Name | Data Type | Description |
---|---|---|
name | string, required | Name of person. |
company | string, optional | Name of company. |
street1 | string, required | First line of address. |
street2 | string, optional | Second line of address. |
city | string, required | City |
state | string, required | State/Province Code. |
postalCode | string, required | Postal Code |
country | string, required | Country Code. The two-character ISO country code is required. |
phone | string, optional | Telephone number. |
string, optional | Email Address. |
Model - Package
Name | Data Type | Description |
---|---|---|
length | integer, required | length of package in cm. |
width | integer, required | width of package in cm. |
height | integer, required | height of package in cm. |
weight | float, required | weight of package in Kg. |
Errors
The Spedisci.Online API uses the following error codes:
Error Code | Meaning |
---|---|
400 | Bad Request – |
401 | Unauthorized – Your API key is wrong |
403 | Forbidden – The endpoint requested is hidden for administrators only |
404 | Not Found – The specified object could not be found |
405 | Method Not Allowed – You tried to access a object with an invalid method |
406 | Not Acceptable – You requested a format that isn’t json |
410 | Gone – The object requested has been removed from our servers |
418 | |
429 | Too Many Requests – You’re requesting too many kittens! Slow down! |
500 | Internal Server Error – We had a problem with our server. Try again later. |
503 | Service Unavailable – We’re temporarily offline for maintenance. Please try again later. |