Add tags to a document
curl --request POST \
--url https://api.prod.payana.cloud/public/api/v1/documents/{reference}/tags \
--header 'Content-Type: application/json' \
--header 'api-key: <api-key>' \
--data '
{
"tags_text": [
"centro-costo-42",
"urgente"
]
}
'import requests
url = "https://api.prod.payana.cloud/public/api/v1/documents/{reference}/tags"
payload = { "tags_text": ["centro-costo-42", "urgente"] }
headers = {
"api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({tags_text: ['centro-costo-42', 'urgente']})
};
fetch('https://api.prod.payana.cloud/public/api/v1/documents/{reference}/tags', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.prod.payana.cloud/public/api/v1/documents/{reference}/tags",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'tags_text' => [
'centro-costo-42',
'urgente'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.prod.payana.cloud/public/api/v1/documents/{reference}/tags"
payload := strings.NewReader("{\n \"tags_text\": [\n \"centro-costo-42\",\n \"urgente\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.prod.payana.cloud/public/api/v1/documents/{reference}/tags")
.header("api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"tags_text\": [\n \"centro-costo-42\",\n \"urgente\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.prod.payana.cloud/public/api/v1/documents/{reference}/tags")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"tags_text\": [\n \"centro-costo-42\",\n \"urgente\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": "Tags stored successfully"
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "The request contains invalid data",
"details": {
"amount": [
"Amount must be greater than 0"
],
"beneficiary_id": [
"Beneficiary does not exist"
]
}
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "The request contains invalid data",
"details": {
"amount": [
"Amount must be greater than 0"
],
"beneficiary_id": [
"Beneficiary does not exist"
]
}
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "The request contains invalid data",
"details": {
"amount": [
"Amount must be greater than 0"
],
"beneficiary_id": [
"Beneficiary does not exist"
]
}
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "The request contains invalid data",
"details": {
"amount": [
"Amount must be greater than 0"
],
"beneficiary_id": [
"Beneficiary does not exist"
]
}
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "The request contains invalid data",
"details": {
"amount": [
"Amount must be greater than 0"
],
"beneficiary_id": [
"Beneficiary does not exist"
]
}
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "The request contains invalid data",
"details": {
"amount": [
"Amount must be greater than 0"
],
"beneficiary_id": [
"Beneficiary does not exist"
]
}
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "The request contains invalid data",
"details": {
"amount": [
"Amount must be greater than 0"
],
"beneficiary_id": [
"Beneficiary does not exist"
]
}
}
}Documentos
Add Document Tags
Agrega etiquetas a un documento por nombre. Los nombres que no existan en tu compañía se crean automáticamente.
- Aditivo: no reemplaza las etiquetas existentes; solo agrega las que el documento aún no tiene.
- Idempotente por etiqueta: repetir el mismo nombre no duplica la etiqueta en el documento.
- Las etiquetas también se propagan a los pagos asociados al documento.
- Tras agregar etiquetas,
GET /documents/{reference}y el listado las reflejan en el campotags. - Para el tag de sistema
admitido, preferíPOST /documents/{reference}/acknowledgesi solo necesitás marcar el documento como admitido.
POST
/
documents
/
{reference}
/
tags
Add tags to a document
curl --request POST \
--url https://api.prod.payana.cloud/public/api/v1/documents/{reference}/tags \
--header 'Content-Type: application/json' \
--header 'api-key: <api-key>' \
--data '
{
"tags_text": [
"centro-costo-42",
"urgente"
]
}
'import requests
url = "https://api.prod.payana.cloud/public/api/v1/documents/{reference}/tags"
payload = { "tags_text": ["centro-costo-42", "urgente"] }
headers = {
"api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({tags_text: ['centro-costo-42', 'urgente']})
};
fetch('https://api.prod.payana.cloud/public/api/v1/documents/{reference}/tags', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.prod.payana.cloud/public/api/v1/documents/{reference}/tags",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'tags_text' => [
'centro-costo-42',
'urgente'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.prod.payana.cloud/public/api/v1/documents/{reference}/tags"
payload := strings.NewReader("{\n \"tags_text\": [\n \"centro-costo-42\",\n \"urgente\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.prod.payana.cloud/public/api/v1/documents/{reference}/tags")
.header("api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"tags_text\": [\n \"centro-costo-42\",\n \"urgente\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.prod.payana.cloud/public/api/v1/documents/{reference}/tags")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"tags_text\": [\n \"centro-costo-42\",\n \"urgente\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": "Tags stored successfully"
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "The request contains invalid data",
"details": {
"amount": [
"Amount must be greater than 0"
],
"beneficiary_id": [
"Beneficiary does not exist"
]
}
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "The request contains invalid data",
"details": {
"amount": [
"Amount must be greater than 0"
],
"beneficiary_id": [
"Beneficiary does not exist"
]
}
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "The request contains invalid data",
"details": {
"amount": [
"Amount must be greater than 0"
],
"beneficiary_id": [
"Beneficiary does not exist"
]
}
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "The request contains invalid data",
"details": {
"amount": [
"Amount must be greater than 0"
],
"beneficiary_id": [
"Beneficiary does not exist"
]
}
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "The request contains invalid data",
"details": {
"amount": [
"Amount must be greater than 0"
],
"beneficiary_id": [
"Beneficiary does not exist"
]
}
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "The request contains invalid data",
"details": {
"amount": [
"Amount must be greater than 0"
],
"beneficiary_id": [
"Beneficiary does not exist"
]
}
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "The request contains invalid data",
"details": {
"amount": [
"Amount must be greater than 0"
],
"beneficiary_id": [
"Beneficiary does not exist"
]
}
}
}Authorizations
API key provista por Payana.
Path Parameters
Referencia interna del documento en Payana (UUID, ej. aaea7db4-647c-4d92-9f86-89e34a68e1aa).
Body
application/json
Nombres de etiquetas a agregar al documento. Se crean en Payana si aún no existen para tu compañía.
Minimum array length:
1Response
Tags stored successfully
Example:
"Tags stored successfully"
⌘I