For the complete documentation index, see llms.txt. This page is also available as Markdown.

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

Name
Type
Description

id*

String

Unique Gsped ID of the shipment

Headers

Name
Type
Description

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.

Creating a shipment does not always succeed: both Gsped and the courier's systems run a series of checks on the correctness of the data received, so make sure you handle possible errors correctly!

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.

The following fields proposed in the example belong to a set that can be considered "basic" and common to more or less all couriers for creating shipments. If you want to extend the functionality or need to request features available with a specific courier, see the Shipment objects, use cases or couriers sections.

The response contains the warnings field, always present, with the warnings that do not block the shipment (for example the product codes missing for the EU customs reform 2026).

Shipment POST

POST https://api.gsped.it/[INSTANCE]/Shipment

Create a shipment

Headers

Name
Type
Description

x-api-key*

String

Apikey provided by Gsped

Request Body

Name
Type
Description

corriere*

Int

Gsped courier ID ( Couriers and services )

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

servizio*

Int

Gsped service ID ( Couriers and services )

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.

When you delete a shipment, the labels returned by the POST are NO longer valid and must be discarded!

Shipment DELETE

DELETE https://api.gsped.it/[INSTANCE]/Shipment

Deletion of a shipment on the Gsped and courier systems

Query Parameters

Name
Type
Description

id*

String

Unique Gsped ID of the shipment

Headers

Name
Type
Description

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.

N.B. This endpoint is valid ONLY for some fields and ONLY for some couriers. See the page of the specific courier for the fields that can be modified.

Fields not allowed for the shipment's courier are rejected with a 400 error.

The user the API key belongs to must have the crea_spedizione permission (when permission checks are enabled on the instance).

PATCH https://api.gsped.it/[INSTANCE]/Shipment/[idSpedizione]

Updates a shipment that has not yet been confirmed

Headers

Name
Type
Description

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