> 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/spedizioni-e-dintorni/spedizioni-consolidate/bulkshipment-aggiunta-rimozione-pallets.md).

# BulkShipment - adding / removing Pallets

## Adding a new Pallet

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

**Headers**

| Name      | Description              |
| --------- | ------------------------ |
| x-api-key | Apikey provided by Gsped |

**Body**

| Name                       | Type  | Required | Description                                                   |
| -------------------------- | ----- | -------- | ------------------------------------------------------------- |
| id                         | int   | Yes      | ID of the consolidated shipment, obtained when it was created |
| dati\_pallets              | array | Yes      | Array containing the details of each pallet                   |
| dati\_pallets.\*.altezza   | int   | No       | Pallet height                                                 |
| dati\_pallets.\*.larghezza | int   | Yes      | Pallet width                                                  |
| dati\_pallets.\*.lunghezza | int   | Yes      | Pallet length                                                 |
| dati\_pallets.\*.volume    | Int   | No       | Pallet volume                                                 |

**Request example**

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

**Response**

{% 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 %}

## Removing the last pallet that was added

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

**Headers**

| Name      | Description              |
| --------- | ------------------------ |
| x-api-key | Apikey provided by Gsped |

**Query parameters**

| Name | Type   | Required | Description                                                   |
| ---- | ------ | -------- | ------------------------------------------------------------- |
| id   | string | Yes      | ID of the consolidated shipment, obtained when it was created |

**Response**

If everything is OK, it simply responds with the shipment number of the consolidated shipment

{% 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 %}
