# BulkShipment - closeMaster

## BulkShipment/closeMaster

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

Questo endpoint **finalizza** la spedizione consolidata, confermando che la sua composizione è **definitiva** e che **non** sono ammesse ulteriori **modifiche** o **aggiunte**.

**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 |

**Esempio di richiesta**

```json
{
    "id": 659
}
```

**Risposta**

In risposta, oltre alle etichette da utilizzare sui pallets, vi è un riepilogo dei dati della spedizione consolidata (si tratta della stessa risposta che si avrebbe dalla Shipment - POST).

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

```json
{
    "client_id": 1,
    "colli": 1,
    "corriere": 104,
    "servizio": 11,
    "ddt_alpha": "TESTBED659",
    "ddt_num": 659,
    "id": 659,
    "labelType": "ZPL",
    "label_zpl": [
        "^LH0,0^XA^FO0,54^GB827,0,2,B^FS^FT22,799^A ..... 7^FD- page 1 of 1 -^FS^XZ"
    ],
    "merce": "Fashion articles",
    "num_spedizione": "2242605805",
    "peso": 125,
    "rcpt_addr": "Franklin House, 19 Crown Rd",
    "rcpt_cap": "EN1 1TH",
    "rcpt_city": "Enfield",
    "rcpt_contact": "DHL HUB GB",
    "rcpt_country_code": "GB",
    "rcpt_email": "test@gsped.com",
    "rcpt_name": "DHL HUB GB",
    "rcpt_phone": "1231231234",
    "rcpt_prov": "VA",
    "sender_addr": "Via Belfiore, 24",
    "sender_cap": "46019",
    "sender_city": "Viadana ",
    "sender_contact": "Test mittente",
    "sender_country_code": "IT",
    "sender_email": "ordini@test.com",
    "sender_name": "Test mittente",
    "sender_phone": "3277214680",
    "sender_prov": "MN",
    "tracking_link": "https://mydhl.express.dhl/it/en/tracking.html#/results?id=2242605805",
    "valuta": "EUR"
}
```

{% endtab %}

{% tab title="400" %}

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

{% 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-closemaster.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.
