# Firmar XML

Se enviará el XML sin firmar en base64 devolviendo el XML firmado en base64 con el certificado PSE; este proceso es para todos los documentos.

<mark style="color:orange;">**`POST`**</mark> `api.firmaxml.com/v1/firmar-xml`

**Headers**

| Name          | Value                     |
| ------------- | ------------------------- |
| Accept        | `application/json`        |
| Content-Type  | `application/json`        |
| Authorization | `Bearer {{token_acceso}}` |

**Body**

| Name               | Value  | Description            |
| ------------------ | ------ | ---------------------- |
| tipo\_integracion  | Number | Valor 0                |
| nombre\_archivo    | String | Nombre del archivo XML |
| contenido\_archivo | String | XML en base64          |

**Response**

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

```json
{
  "estado": 200,
  "xml": "D94Mdfddgdgdgggg...",
  "codigo_hash": "vZzxd8AFdiggggrtLfg=",
  "mensaje": "XML firmado correctamente",
  "external_id": "LoOofg-56h6-gggg-4545455"
}
```

{% endtab %}

{% tab title="400" %}

```json
{
    "estado": 400,
    "mensaje": "Code: 1036; Description: Número de documento en el nombre del archivo no coincide con el consignado en el contenido del XML"
}
```

{% 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://docs.firmaxml.com/firmar-xml.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.
