Shipment
Shipment management
Shipment - GET
This endpoint lets you manage the creation, retrieval and deletion of shipments on Gsped.
Shipment -GET
GET https://api.gsped.it/[INSTANCE]/Shipment
Retrieves all the information of a shipment, including the labels
Query Parameters
id*
String
Unique Gsped ID of the shipment
Headers
x-api-key*
String
Apikey provided by GSPED
{
// Response
}{
// Response
}{
// Response
}{
// Response
}Example code snippets
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gsped.it/sandbox/Shipment?id=70059765",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => "",
CURLOPT_HTTPHEADER => [
"x-api-key: YOUR-API-KEY"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}Shipment - POST
The Shipment POST call lets you create the shipment.
If the operation is successful, it returns the shipment data together with its labels in the available formats.
The logic to implement to check the outcome of the calls is as follows:
in the API response to the shipment creation POST, first check the HTTP response code: if it is 400, the data sent did not pass the first series of data checks, and in that case the error field contains details of the problem found (for example missing required fields).
If the response code is 200, the data passed the first level of validation and generation of the waybill has started. You then need to check the value of the status field: if it contains 0, the waybill was generated correctly and can be retrieved from the dedicated fields in the response. If instead the status field is equal to 0.6, waybill generation failed and the error field contains the description of the error. This type of error can occur in situations such as inconsistent postcode and town, an address not accepted by the courier's systems, a requested service not available for the destination town, et cetera.
Shipment POST
POST https://api.gsped.it/[INSTANCE]/Shipment
Create a shipment
Headers
x-api-key*
String
Apikey provided by Gsped
Request Body
colli*
Int
Number of parcels in the shipment
volume*
Float
Shipment volume in cubic metres
peso*
Float
Shipment weight in KG
origine*
String
Country of origin of the goods, 2-char ISO code
merce*
String
Generic description of the goods shipped
ddt_num
String
Numeric reference of the shipment; if not set, Gsped creates one automatically
ddt_alpha
String
Alphanumeric reference of the shipment; if not set, Gsped creates one automatically
client_id*
Int
Client ID provided by Gsped
sender_cap
String
Sender zipcode
sender_city
String
Sender town/city
sender_addr
String
Sender address
sender_contact
String
Sender contact name
sender_name
String
Sender name
rcpt_contact*
String
Recipient contact name
rcpt_name*
String
Recipient name
sender_email
String
Sender email
sender_phone
String
Sender phone
sender_country_code
String
Sender country, 2-char ISO code
rcpt_prov*
String
Recipient province/state, 2-char ISO code
rcpt_cap*
String
Recipient zipcode
rcpt_city*
String
Recipient town/city
rcpt_addr*
String
Recipient address
sender_prov
String
Sender province/state, 2-char ISO code
rcpt_phone*
String
Recipient phone
rcpt_email*
String
Recipient email
rcpt_emails_extra
Array
Additional emails for other recipients
rcpt_country_code*
String
Recipient country, 2-char ISO code
rcpt_type
Int
Recipient type. Allowed values : - 1 : Private - 2 : Business If not set it is 0 (not specified), see EU customs reform 2026
note_sender
String
Sender notes
valuta
ISO 4217 currency code
valore
Float
Insured amount
dropshipping
String
Flag 1 to send the waybill to the sender's email
al_sabato
String
Flag S|N to enable the Saturday service (enabled couriers only)
al_piano
String
Flag S|N to enable the floor delivery service (enabled couriers only)
preavviso_telefonico
String
Flag S|N to enable the service (enabled couriers only)
fermo_deposito
String
Flag S|N to identify a hold at depot shipment
reso_contestuale
String
Flag S|N to enable the EXCHANGE service (enabled couriers only)
documenti
String
Flag 0|1 to identify a documents shipment
flag_reso
Int
Flag 0|1 to identify a return shipment
addebito_dogana
Int
Assignment of customs duties. Allowed values: - 0 : Customs duties charged to the recipient - 1 : Customs duties charged to the sender - 2 : Customs duties charged to a third party
chi_paga
Int
Assignment of shipping costs: - 0 : The sender pays - 1 : The recipient pays
valore_doganale
Float
Customs value
id_order_gelproximity
String
Order ID on the Gel Proximity systems for sending tracking
invoice_date
String
Invoice date in YYYY-MM-GG format
invoice_number
String
Invoice number
invoiced_client_id
Int
TO BE SET ONLY FOR RESELLER INSTANCES Use it to specify which of the reseller's clients the shipment should be associated with.
labelType
Enum
Optional field to define the requested label type. Possible values: PDF/ZPL Warning: some couriers may have format limitations
Example code snippets
Choosing the cheapest courier
If you want Gsped to choose the cheapest courier based on your price lists (configured on Gsped), set corriere = 0 and servizio = 0 in the call
Payload example:
Shipment - DELETE
This endpoint lets you delete previously created shipments only if they have not yet been confirmed.
Shipment DELETE
DELETE https://api.gsped.it/[INSTANCE]/Shipment
Deletion of a shipment on the Gsped and courier systems
Query Parameters
id*
String
Unique Gsped ID of the shipment
Headers
x-api-key*
String
Apikey provided by Gsped
Example code snippets
Shipment - PATCH
This endpoint lets you modify a shipment without having to recreate the label, ONLY if the shipment has not yet been confirmed.
PATCH https://api.gsped.it/[INSTANCE]/Shipment/[idSpedizione]
Updates a shipment that has not yet been confirmed
Headers
x-api-key*
String
Apikey provided by GSPED
result contains the updated shipment, the same object returned by Shipment GET.
Field validation errors (messages are separated by ; ):
Shipment already confirmed, or courier that does not allow Shipment PATCH:
Request Body
It depends on the courier: SEE HERE
Example code snippets
Last updated
