Cria um novo documento que será impresso ou processado por um terminal, contendo linhas de texto, QR codes ou imagens. Scope: transactions.write. Não existe scope documents.* no login Mundo Digital.
application/json
stringapplication/json
stringBearer {{TOKEN}}
stringRequer Bearer token com transactions.write (Pagamentos via Terminais). Não existe scope documents.read nem documents.write no login Mundo Digital.
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
status | string | Sim | Estado inicial do documento. Ex: "pending" |
merchant_id | string | Sim | Identificador único do lojista (UUID) |
url | string | Não | URL para callback/notificação sobre o documento (opcional) |
terminal_id | string | Sim | Identificador único do terminal (UUID) |
token | string | Sim | Valor fixo "Bearer" |
token_type | string | Sim | Valor fixo "Bearer", representa o tipo do token |
lines | array | Sim | Lista de elementos (linhas) a serem incluídos no documento |
lines[]| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
content | string | Sim | Conteúdo da linha. Pode ser texto, URL ou base64 de imagem |
type | string | Sim | Tipo de linha: "text", "qrcode" ou "image" |
order | integer | Sim | Ordem de exibição/impressão da linha no documento |
curl --location 'https://api-h.nuvende.com.br/api/v2/pagamentos/documents' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {{ token_de_autenticacao }}' \
--data '{
"status": "pending",
"merchant_id": "{{ merchant_id }}",
"url": "{{ url_callback }}",
"terminal_id": "{{ terminal_id }}",
"token": "Bearer",
"token_type": "Bearer",
"lines": [
{
"content": "Nuvende",
"type": "text",
"order": 1
},
{
"content": "https://nuvende.com.br",
"type": "qrcode",
"order": 2
},
{
"content": "{{ imagem_base64 }}",
"type": "image",
"order": 3
}
]
}'
const axios = require("axios");
const data = {
status: "pending",
merchant_id: "{{ merchant_id }}",
url: "{{ url_callback }}",
terminal_id: "{{ terminal_id }}",
token: "Bearer",
token_type: "Bearer",
lines: [
{
content: "Nuvende",
type: "text",
order: 1,
},
{
content: "https://nuvende.com.br",
type: "qrcode",
order: 2,
},
{
content: "{{ imagem_base64 }}",
type: "image",
order: 3,
},
],
};
const config = {
method: "post",
url: "https://api-h.nuvende.com.br/api/v2/pagamentos/documents",
headers: {
"Content-Type": "application/json",
Accept: "application/json",
Authorization: "Bearer {{ token_de_autenticacao }}",
},
data: data,
};
axios(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
import requests
import json
url = "https://api-h.nuvende.com.br/api/v2/pagamentos/documents"
payload = {
"status": "pending",
"merchant_id": "{{ merchant_id }}",
"url": "{{ url_callback }}",
"terminal_id": "{{ terminal_id }}",
"token": "Bearer",
"token_type": "Bearer",
"lines": [
{
"content": "Nuvende",
"type": "text",
"order": 1
},
{
"content": "https://nuvende.com.br",
"type": "qrcode",
"order": 2
},
{
"content": "{{ imagem_base64 }}",
"type": "image",
"order": 3
}
]
}
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {{ token_de_autenticacao }}'
}
response = requests.post(url, headers=headers, data=json.dumps(payload))
print(response.text)
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api-h.nuvende.com.br/api/v2/pagamentos/documents',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => json_encode(array(
'status' => 'pending',
'merchant_id' => '{{ merchant_id }}',
'url' => '{{ url_callback }}',
'terminal_id' => '{{ terminal_id }}',
'token' => 'Bearer',
'token_type' => 'Bearer',
'lines' => array(
array(
'content' => 'Nuvende',
'type' => 'text',
'order' => 1
),
array(
'content' => 'https://nuvende.com.br',
'type' => 'qrcode',
'order' => 2
),
array(
'content' => '{{ imagem_base64 }}',
'type' => 'image',
'order' => 3
)
)
)),
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'Accept: application/json',
'Authorization: Bearer {{ token_de_autenticacao }}'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
{
"status": "pending",
"merchant_id": "{{merchant_id}}",
"url": "https://webhook.site/a26d5508-c9d4-4645-a94f-d38562ff901d",
"terminal_id": "{{terminal_id}}",
"token": "Bearer",
"token_type": "Bearer",
"lines": [
{
"content": "Nuvende",
"type": "text",
"order": 1
},
{
"content": "https://nuvende.com.br",
"type": "qrcode",
"order": 2
},
{
"content": "iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAIAAAACDbGyAAABg2lDQ1BJQ0MgcHJvZmlsZQAAKJF9kT1Iw0AcxV9TS0UqCnYo4pChOrWLijjWKhShQqgVWnUwufQLmrQkKS6OgmvBwY/FqoOLs64OroIg+AHiLjgpukiJ/0sKLWI8OO7Hu3uPu3eA0KoyzexLAJpuGZlUUszlV8XgK4KIYBgxBGRm1uckKQ3P8XUPH1/v4jzL+9yfY1AtmAzwicQJVjcs4g3imU2rznmfOMzKskp8Thwz6ILEj1xXXH7jXHJY4JlhI5uZJw4Ti6UeVnqYlQ2NeJo4qmo65Qs5l1XOW5y1aoN17slfGCroK8tcpzmGFBaxBAkiFDRQQRUW4rTqpJjI0H7Swz/q+CVyKeSqgJFjATVokB0/+B/87tYsTk26SaEkEHix7Y9xILgLtJu2/X1s2+0TwP8MXOldf60FzH6S3uxq0SNgaBu4uO5qyh5wuQNEnuqyITuSn6ZQLALvZ/RNeWDkFhhYc3vr7OP0AchSV+kb4OAQmChR9rrHu/t7e/v3TKe/H5BycrJUq5q4AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH6QcZBAouQ55pdgAAAAxJREFUCNdjYKAuAAAAUAABIhPodQAAAABJRU5ErkJggg==",
"type": "image",
"order": 3
}
]
}