Reemplazar una plantilla
curl --request PUT \
--url https://www.facture.ar/api/documents/templates/{templateId} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "<string>"
}
'const options = {
method: 'PUT',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>'})
};
fetch('https://www.facture.ar/api/documents/templates/{templateId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://www.facture.ar/api/documents/templates/{templateId}"
payload = { "name": "<string>" }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.facture.ar/api/documents/templates/{templateId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"template": {
"id": "<string>",
"userId": "<string>",
"name": "<string>",
"cuitId": "<string>",
"ptoVta": 50000,
"mode": "manual",
"concepto": 1,
"ivaRate": 21,
"pricesIncludeIva": true,
"receiverDocType": "CUIT",
"receiverDocNumber": "<string>",
"receiverName": "<string>",
"receiverCondicionIva": 123,
"receiverEmail": "jsmith@example.com",
"items": [
{
"description": "<string>",
"quantity": 123,
"unitPrice": 1
}
],
"priceList": [
{
"description": "<string>",
"unitPrice": 1
}
],
"instructions": "<string>",
"columnMapping": {
"headerRow": 2,
"columns": {},
"groupBy": "<string>",
"pricesIncludeIva": true
},
"paymentTermDays": 182,
"sendEmail": true,
"emailCopyTo": "jsmith@example.com",
"recurrence": "monthly",
"dayOfMonth": 14,
"active": true,
"nextRunAt": "2023-11-07T05:31:56Z",
"lastRunAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"type": "https://www.facture.ar/problems/invalid_request",
"title": "Bad Request",
"status": 400,
"detail": "<string>",
"code": "invalid_request",
"message": "<string>",
"resolution": "<string>",
"error": "<string>",
"details": "<unknown>",
"upgradeUrl": "<string>",
"creditNoteId": "<string>",
"batchId": "<string>"
}{
"type": "https://www.facture.ar/problems/invalid_request",
"title": "Bad Request",
"status": 400,
"detail": "<string>",
"code": "invalid_request",
"message": "<string>",
"resolution": "<string>",
"error": "<string>",
"details": "<unknown>",
"upgradeUrl": "<string>",
"creditNoteId": "<string>",
"batchId": "<string>"
}{
"type": "https://www.facture.ar/problems/invalid_request",
"title": "Bad Request",
"status": 400,
"detail": "<string>",
"code": "invalid_request",
"message": "<string>",
"resolution": "<string>",
"error": "<string>",
"details": "<unknown>",
"upgradeUrl": "<string>",
"creditNoteId": "<string>",
"batchId": "<string>"
}{
"type": "https://www.facture.ar/problems/invalid_request",
"title": "Bad Request",
"status": 400,
"detail": "<string>",
"code": "invalid_request",
"message": "<string>",
"resolution": "<string>",
"error": "<string>",
"details": "<unknown>",
"upgradeUrl": "<string>",
"creditNoteId": "<string>",
"batchId": "<string>"
}Plantillas
Reemplazar una plantilla
Reemplaza la plantilla con el body completo: los campos que no mandás vuelven a su valor por defecto, salvo columnMapping, que se conserva si no lo mandás. Necesita la key de producción: una de testing puede leer la configuración pero no cambiarla.
PUT
/
documents
/
templates
/
{templateId}
Reemplazar una plantilla
curl --request PUT \
--url https://www.facture.ar/api/documents/templates/{templateId} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "<string>"
}
'const options = {
method: 'PUT',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>'})
};
fetch('https://www.facture.ar/api/documents/templates/{templateId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://www.facture.ar/api/documents/templates/{templateId}"
payload = { "name": "<string>" }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.facture.ar/api/documents/templates/{templateId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"template": {
"id": "<string>",
"userId": "<string>",
"name": "<string>",
"cuitId": "<string>",
"ptoVta": 50000,
"mode": "manual",
"concepto": 1,
"ivaRate": 21,
"pricesIncludeIva": true,
"receiverDocType": "CUIT",
"receiverDocNumber": "<string>",
"receiverName": "<string>",
"receiverCondicionIva": 123,
"receiverEmail": "jsmith@example.com",
"items": [
{
"description": "<string>",
"quantity": 123,
"unitPrice": 1
}
],
"priceList": [
{
"description": "<string>",
"unitPrice": 1
}
],
"instructions": "<string>",
"columnMapping": {
"headerRow": 2,
"columns": {},
"groupBy": "<string>",
"pricesIncludeIva": true
},
"paymentTermDays": 182,
"sendEmail": true,
"emailCopyTo": "jsmith@example.com",
"recurrence": "monthly",
"dayOfMonth": 14,
"active": true,
"nextRunAt": "2023-11-07T05:31:56Z",
"lastRunAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"type": "https://www.facture.ar/problems/invalid_request",
"title": "Bad Request",
"status": 400,
"detail": "<string>",
"code": "invalid_request",
"message": "<string>",
"resolution": "<string>",
"error": "<string>",
"details": "<unknown>",
"upgradeUrl": "<string>",
"creditNoteId": "<string>",
"batchId": "<string>"
}{
"type": "https://www.facture.ar/problems/invalid_request",
"title": "Bad Request",
"status": 400,
"detail": "<string>",
"code": "invalid_request",
"message": "<string>",
"resolution": "<string>",
"error": "<string>",
"details": "<unknown>",
"upgradeUrl": "<string>",
"creditNoteId": "<string>",
"batchId": "<string>"
}{
"type": "https://www.facture.ar/problems/invalid_request",
"title": "Bad Request",
"status": 400,
"detail": "<string>",
"code": "invalid_request",
"message": "<string>",
"resolution": "<string>",
"error": "<string>",
"details": "<unknown>",
"upgradeUrl": "<string>",
"creditNoteId": "<string>",
"batchId": "<string>"
}{
"type": "https://www.facture.ar/problems/invalid_request",
"title": "Bad Request",
"status": 400,
"detail": "<string>",
"code": "invalid_request",
"message": "<string>",
"resolution": "<string>",
"error": "<string>",
"details": "<unknown>",
"upgradeUrl": "<string>",
"creditNoteId": "<string>",
"batchId": "<string>"
}Authorizations
API Key que generás en el panel (Desarrolladores > Claves API, https://www.facture.ar/app/api-keys) y mandás en el header x-api-key. Es la única credencial que acepta la API REST. Cada key tiene su entorno fijo: test_sk_... opera siempre en homologación y prod_sk_... en producción; el header x-environment se ignora.
Body
application/json