Add Parcel

Dynamic parcel handling

General information

The function adds parcel allows adding or remove the parcels in full autonomy, with their corresponding labels.

List of enabled couriers

* see notes

COURIERS (Gsped ID)ADDINGREMOVING

BRT* (1)

Yes

Yes

TNT* (2)

Yes

Yes

PDB Inviosystem (19)

Yes

Yes

Dummy1 (70)

Yes

Yes

Dummy2 (71)

Yes

Yes

Dummy3 (72)

Yes

Yes

Dummy4 (73)

Yes

Yes

Dummy5 (74)

Yes

Yes

Dummy6 (75)

Yes

Yes

Dummy7 (76)

Yes

Yes

Dummy8 (77)

Yes

Yes

Dummy9 (78)

Yes

Yes

Dummy10 (79)

Yes

Yes

Italsempione (90)

Yes

Yes

Logisticando (91)

Yes

Yes

CSI Logistica (92)

Yes

Yes

Ribosped (93)

Yes

Yes

Zust - Tiesse (94)

Yes

Yes

Lynx (95)

Yes

Yes

Speditalia (97)

Yes

Yes

ARCO (100)

Yes

Yes

GLS (101)

Yes

No

Fercam (131)

Yes

Yes

Liccardi (179)

Yes

Yes

DHL WLA (182)

Yes

Yes

The list of enabled couriers is subject to change and modifications.

Notes about couriers
  • BRT --> Only B2 solution

  • TNT --> Only for the same label creation date and before the withdrawal date/time of the same. If necessary to extend this date, consult the Expected Assignment Date section

How the Add Parcel function works

To successfully use the Add Parcel function 3 endpoints must be used:

  1. Shipment POST - For the shipment creation

  2. Parcels POST or DELETE - To add or remove the parcels

  3. ShipmentConfirm POST - For the final shipment confimation. You will no longer be able to change.

PLEASE NOTE: the removal of a parcel in a single-parcel shipment automatically cancels of the shipment.

PLEASE NOTE: the final confirmation blocks the possibility to add or remove one or more parcels from the shipment

Add a single parcel to a shipment

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

Body in JSON.

\

It works in 2 ways: \

1 - Shipment ID + parcel data

\

2 - Recepient data + parcel data

Request Body

NameTypeDescription

id_sped*

String

Unique Gsped ID

ddt_alpha*

String

Alphanumerical reference of the shipment

rcpt_name*

String

Name of the recepient

rcpt_addr*

String

Address of the recepient

rcpt_city*

String

City of the recepient

rcpt_cap*

String

Zip code of the recepient

rcpt_prov*

String

Province/country of the recepient

rcpt_country_code*

String

Country of the recepient iso code 2 char

collo*

Object

Parcel data

{
    "id_collo": 2,
    "id_sped": "123456789",
    "labels": {
        "jpg": "Stringa base64",
        "pdf": "Stringa base64",
        "zpl": "Stringa ZPL"
    },
    "tracking_collo": "JJD01111111111"
}

Parcel object

AttributeTypeRequired

peso (weight)

integer

X

volume

float

X

larghezza (width)

integer

X

altezza (height)

integer

X

lunghezza (lenght)

integer

X

Example of Payload Parcels POST

{
  "id_sped":"1234567",
  "collo": {
    "peso": "5",
    "volume": "0.01",
    "larghezza": "35",
    "altezza": "15",
    "lunghezza": "10"
  }
}

Example of Snippet Parcel POST

<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.gsped.it/sandbox/Parcels",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\n  \"id_sped\":\"1\",\n  \"collo\": {\n    \"peso\": \"5\",\n    \"volume\": \"0.01\",\n    \"larghezza\": \"35\",\n    \"altezza\": \"15\",\n    \"lunghezza\": \"10\"\n  }\n}",
  CURLOPT_HTTPHEADER => [
    "Content-Type: application/json",
    "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;
}

Parcel removal from shipment

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

Form Url-Encoded Body

It works in 2 ways: \

1 Shipment ID + parcel data

\

2 Recepient data + parcel data

Request Body

NameTypeDescription

id_sped

String

Unique Gsped ID

ddt_alpha

String

Alphanumerical shipment reference

rcpt_name

String

Name of the recepient

rcpt_addr

String

Adress of the recepient

rcpt_city

String

City of the recepient

rcpt_cap

String

Zip code of the recepient

rcpt_prov

String

Province/country of the recipient

rcpt_country_code

String

Country of the recepient (iso code 2 char)

{
    "id": "50000723",
    "num_spedizione": "7004525883",
    "num_collo": 1
}

Example Snippet Parcels DELETE

<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.gsped.it/sandbox/Parcels",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "DELETE",
  CURLOPT_POSTFIELDS => "id_sped=69562763",
  CURLOPT_HTTPHEADER => [
    "Content-Type: application/x-www-form-urlencoded",
    "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;
}

Notes

When the customer makes a shipment with AddParcel, it is possible to trace back to the original creation date from the label creation dates, which are visible in the designated bucket on S3.

Last updated