# Upload Documents

This endpoint allows to upload the custom documents, after the creation of shipment and the receiving of the label.

{% hint style="info" %}
The use of this enpoint needs a preventive talk with a Gsped technician to have a proper activation.
{% endhint %}

## Document upload for DHL shipments

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

Allows the upload after the receiving of the label.

#### Request Body

| Name                                          | Type    | Description                     |
| --------------------------------------------- | ------- | ------------------------------- |
| id<mark style="color:red;">\*</mark>          | Integer | Unique Gsped ID of the shipment |
| files<mark style="color:red;">\*</mark>       | Array   | Array of document objects       |
| doc.type<mark style="color:red;">\*</mark>    | String  | Type of file (see the table)    |
| doc.format<mark style="color:red;">\*</mark>  | String  | Image format                    |
| doc.content<mark style="color:red;">\*</mark> | String  | Base 64 of the image            |

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

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

{% endtab %}

{% tab title="500: Internal Server Error The shipment is NOT enabled to the 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 %}
{% endtabs %}

```json
// Example payload

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

### Loadable types and codes of documents

| Type of document            | Acronym |
| --------------------------- | ------- |
| Invoice                     | INV     |
| Proforma Invoice            | PNV     |
| Certificate of Origin       | COO     |
| Certificate of Nafta origin | NAF     |
| Commercial Invoice          | CIN     |
| Custom Bill                 | DCL     |
| Waybill document            | AWB     |

### Type of loadable files

DHL takes the following file formats:

* PDF
* PNG
* TIFF
* GIF
* JPEG

Maximum size of 1 Mb in B64.
