> For the complete documentation index, see [llms.txt](https://docs.vida.id/identity-stack/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.vida.id/identity-stack/sign/e-meterai-stamp/api-integration/e-meterai-api/api-reference/upload-document.md).

# Upload Document

This API is designed for uploading documents to be digitally stamped with eMeterai. Users have the flexibility to specify the exact page and location on the page where the eMeterai will be applied.

<mark style="color:green;">`POST`</mark> `/api/v1/emeterai/upload`

#### Headers

| Name                                            | Type   | Description                                  |
| ----------------------------------------------- | ------ | -------------------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer \<Token received from Authentication> |
| X-PARTNER-ID<mark style="color:red;">\*</mark>  | String | client\_id                                   |

#### Request Body

| Name                                           | Type   | Description                                                                         |
| ---------------------------------------------- | ------ | ----------------------------------------------------------------------------------- |
| codeDocument<mark style="color:red;">\*</mark> | String | The code representing the document type, obtained from the 'Get Document Type' API. |
| page<mark style="color:red;">\*</mark>         | String | The specific page number within the document where the stamp is to be applied.      |
| llx<mark style="color:red;">\*</mark>          | String | The X-coordinate of the lower-left corner for the stamp's placement on the page.    |
| lly<mark style="color:red;">\*</mark>          | String | The Y-coordinate of the lower-left corner for the stamp's placement on the page.    |
| refNum<mark style="color:red;">\*</mark>       | String | A unique UUID that references this particular stamping transaction.                 |
| document<mark style="color:red;">\*</mark>     | String | The actual document content, encoded in base64 format, to be stamped.               |

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

```json
{
    "responseCode": 200,
    "message": "Upload Success",
    "refNum": "8cb2ba9b-2431-4342-817c-98db02dbebc3",
    "refund_status": "NOT_REFUNDED",
    "data": null
}
```

{% endtab %}

{% tab title="401: Unauthorized " %}

{% endtab %}

{% tab title="400: Bad Request " %}

```json
{
    "responseCode": 20,
    "status": "ERROR",
    "message": "{document=document Not Empty & base64}",
    "refNum": ""
}
```

{% endtab %}
{% endtabs %}
