> For the complete documentation index, see [llms.txt](https://apidocs.gsped.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://apidocs.gsped.com/gsped-api-english-version/overview/etichette-in-5-minuti.md).

# Labels in 5 minutes

Ingredients:

* apikey (provided by the Gsped team)
* name of the dedicated instance (provided by the Gsped team)
* client\_id (provided by the Gsped team)

The URL to call is **<https://api.gsped.it/\\[INSTANCE]/shipment>** with the POST method. The request body contains the payload; set the Content-Type and Accept headers to application/json and set the X-API-KEY header to the string provided by the Gsped team.

Example of a minimal payload; specify the courier and the service using the values listed on the [Couriers and services](/gsped-api-english-version/overview/corrieri-e-servizi.md) page

```json
{
    "client_id": 390,
    "corriere": 101,
    "servizio": 0,
    "ddt_alpha": "rifmittente",
    "peso": 3.0,
    "colli": 1,
    "rcpt_name":"Mario Rossi",
    "rcpt_addr":"Piazza Castello 1",
    "rcpt_cap":"10121",
    "rcpt_city":"Torino",
    "rcpt_prov":"TO",
    "rcpt_country_code":"IT"
}
```

In the response, check the status code first:

if it is **400**, the data sent **did NOT pass the preliminary checks** before the shipment was created, and the **error** field contains the error details

if it is **200**, the data sent was accepted and communication with the courier to create the shipment has started; in this case, check the value of the **status** field in the response

The **status** field can take two main values (the full list of codes is on the [Gsped codes](/gsped-api-english-version/overview/codici-gsped.md) page):

**Status 0.6** the courier did NOT accept the data and the shipment was not created; the **error** field contains the error message returned by the courier (for example, a postcode that does not match the city name, or a service not available for the destination)

{% hint style="info" %}
Each courier uses its own address validation system: correct addresses may be reported as wrong if the courier has errors in its own database.

An address found on Google Maps will not necessarily be accepted by every courier.
{% endhint %}

**Status 0** the courier accepted the data and generated the shipment; the label\_pdf, label\_jpg and label\_zpl arrays contain the labels to apply to the parcels (jpg and pdf are base64-encoded; the formats returned depend on the client\_id settings and on the courier)

The response also contains the **id** field, which holds the unique Gsped identifier of the shipment; this value is essential for the shipment confirmation step.

{% hint style="info" %}
**PLEASE NOTE:**

Couriers normally provide labels in two formats: PDF and ZPL.

Some couriers provide both formats, while others provide only one.

Typically the PDF label returned by the courier is A4, while the ZPL label is 10x15 cm at 203 dpi
{% endhint %}

### Last step....

Finally, before handing the parcels over to the courier, make a call to <https://api.gsped.it/\\[INSTANCE]/shipmentConfirm> passing the **id**s of the shipments handed over and setting the headers as described above.

Example payload for shipmentConfirm

```json
{
  "id": [
    "12345",
    "12346",
    "12347"
  ]
}
```

{% hint style="info" %}
The confirmation step is essential for the courier to handle the shipments correctly!
{% endhint %}
