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

# 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.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://apidocs.gsped.com/gsped-api-english-version/spedizioni-e-dintorni/upload-documents.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
