# Upload Documents

{% hint style="danger" %}
**ATTENZIONE:**

Questo endpoint verrà dismesso dismesso nei prossimi mesi.

Per caricare i documenti elettronici di DHL **dopo** aver generato la spedizione consultare la documentazione specifica : <https://apidocs.gsped.com/spedizioni-e-dintorni/shipment/corrieri/dhl#aggiungere-documento-elettronico-a-spedizione>
{% endhint %}

Questo endpoint permette il caricamento dei documenti doganali dopo aver creato una spedizione ed aver ricevuto l'etichetta.

{% hint style="info" %}
L'utilizzo di questo endpoint rihiede un colloquio preventivo con un tecnico Gsped per permettere la corretta abilitazione.
{% endhint %}

## Caricamento documenti per spedizioni DHL

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

Permette il caricamento dei documenti dopo aver ricevuto l'etichetta

#### Request Body

| Name                                          | Type    | Description                       |
| --------------------------------------------- | ------- | --------------------------------- |
| id<mark style="color:red;">\*</mark>          | Integer | ID univoco Gsped della spedizione |
| files<mark style="color:red;">\*</mark>       | Array   | Array di oggetti documento        |
| doc.type<mark style="color:red;">\*</mark>    | String  | Tipologia di file (v. tabella)    |
| doc.format<mark style="color:red;">\*</mark>  | String  | Formato immagine                  |
| doc.content<mark style="color:red;">\*</mark> | String  | Base64 dell'immagine              |

{% tabs %}
{% tab title="500: Internal Server Error La spedizione NON è abilitata al PLT" %}

```javascript
{
  "error": "Il caricamento delle immagini non è supportato per la spedizione non PLT\nImpossibile elaborare la tua richiesta. ID processo associato a questa transazione &#39;430731066&#39;\n"
}
```

{% endtab %}

{% tab title="200: OK " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

```json
// Example payload

{
    "id": 50000397,
    "files":
    [
        {
            "type": "PNV",
            "format": "PDF",
            "content": "base64 string"
        },
        {
            "type": "DCL",
            "format": "PDF",
            "content": "base 64 string"
        }
    ]
}
```

### Tipologia e sigle documenti caricabili

| Tipo Documento               | Sigla |
| ---------------------------- | ----- |
| Fattura                      | INV   |
| Fattura Proforma             | PNV   |
| Certificato di Origine       | COO   |
| Certificato origine Nafta    | NAF   |
| Fattura Commerciale          | CIN   |
| Bolla Doganale               | DCL   |
| Documento lettera di vettura | AWB   |

### Tipologia file caricabili

DHL accetta i seguenti formati di file:

* PDF
* PNG
* TIFF
* GIF
* JPEG

Dimensione massima 2 Mb in B64.

**N.B. Il limite generico per le chiamate API è 5 MB per documento ma, quello di DHL è più restrittivo.**


---

# 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/upload-documents.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.
