# BulkShipment - aggiunta / rimozione Pallets

## Aggiunta di un nuovo Pallet

<mark style="color:green;">`POST`</mark> <https://api.gsped.it/\\[ISTANZA]/BulkShipment/pallet>

**Headers**

| Nome      | Descrizione             |
| --------- | ----------------------- |
| x-api-key | Apikey fornita da Gsped |

**Body**

| Nome                       | Tipo  | Obbligatorio | Descrizione                                                                 |
| -------------------------- | ----- | ------------ | --------------------------------------------------------------------------- |
| id                         | int   | Si           | ID della spedizione consolidata, ottenuto in fase di creazione della stessa |
| dati\_pallets              | array | Si           | Array che contiene i dettagli dei singoli pallet                            |
| dati\_pallets.\*.altezza   | int   | No           | Altezza del pallet                                                          |
| dati\_pallets.\*.larghezza | int   | Si           | Larghezza del pallet                                                        |
| dati\_pallets.\*.lunghezza | int   | Si           | Lunghezza del pallet                                                        |
| dati\_pallets.\*.volume    | Int   | No           | Volume del pallet                                                           |

**Esempio di richiesta**

```json
{
    "id": 634,
    "dati_pallets": [
        {
            "larghezza": 25,
            "lunghezza": 35
        }
    ]
}
```

**Risposta**

{% tabs %}
{% tab title="200" %}

```json
{
    "num_spedizione": "2242605805",
    "dati_pallets": [
        {
            "palletID": "JD014600005286201085",
            "larghezza": "25",
            "lunghezza": "35"
        }
    ]
}
```

{% endtab %}

{% tab title="400" %}

```json
{
    "errore": "La spedizione consolidata è già stata chiusa, non è possibile eseguire l'operazione richiesta"
}
```

{% endtab %}
{% endtabs %}

## Rimozione dell'ultimo pallet che è stato aggiunto

<mark style="color:red;">`DELETE`</mark> <https://api.gsped.it/\\[ISTANZA]/BulkShipment/pallet?id=ID\\_CONSOLIDATA>

**Headers**

| Nome      | Descrizione             |
| --------- | ----------------------- |
| x-api-key | Apikey fornita da Gsped |

**Query parameters**

| Nome | Tipo   | Obbligatorio | Descrizione                                                                 |
| ---- | ------ | ------------ | --------------------------------------------------------------------------- |
| id   | string | Si           | ID della spedizione consolidata, ottenuto in fase di creazione della stessa |

**Risposta**

Se tutto ok, rispode semplicemente con il numero di spedizione della consolidata

{% tabs %}
{% tab title="200" %}

```json
{
    "num_spedizione": "2242605805"
}
```

{% endtab %}

{% tab title="400" %}

```json
{
    "errore": "Non è possibile rimuovere l'ultimo pallet in quanto vi sono delle spedizioni associate a questo"
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://apidocs.gsped.com/spedizioni-e-dintorni/spedizioni-consolidate/bulkshipment-aggiunta-rimozione-pallets.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
