curl --request POST \
--url https://www.facture.ar/api/webhooks \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"url": "<string>",
"events": []
}
'const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: '<string>', events: []})
};
fetch('https://www.facture.ar/api/webhooks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://www.facture.ar/api/webhooks"
payload = {
"url": "<string>",
"events": []
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.facture.ar/api/webhooks",
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([
'url' => '<string>',
'events' => [
]
]),
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;
}{
"secret": "<string>",
"id": "<string>",
"userId": "<string>",
"url": "<string>",
"headers": {},
"events": [
"invoice.completed"
],
"isActive": true,
"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>"
}Crear un webhook
curl --request POST \
--url https://www.facture.ar/api/webhooks \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"url": "<string>",
"events": []
}
'const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: '<string>', events: []})
};
fetch('https://www.facture.ar/api/webhooks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://www.facture.ar/api/webhooks"
payload = {
"url": "<string>",
"events": []
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.facture.ar/api/webhooks",
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([
'url' => '<string>',
'events' => [
]
]),
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;
}{
"secret": "<string>",
"id": "<string>",
"userId": "<string>",
"url": "<string>",
"headers": {},
"events": [
"invoice.completed"
],
"isActive": true,
"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
1invoice.completed: ARCA autorizó una factura. invoice.failed: una factura falló definitivamente. batch.completed: terminó un lote. draft.review_required: un borrador espera revisión. dfe.message.received: llegó una comunicación al Domicilio Fiscal Electrónico de un CUIT. tax_account.updated: cambió el saldo de la cuenta tributaria de un CUIT
invoice.completed, invoice.failed, batch.completed, draft.review_required, dfe.message.received, tax_account.updated Response
Webhook creado
invoice.completed: ARCA autorizó una factura. invoice.failed: una factura falló definitivamente. batch.completed: terminó un lote. draft.review_required: un borrador espera revisión. dfe.message.received: llegó una comunicación al Domicilio Fiscal Electrónico de un CUIT. tax_account.updated: cambió el saldo de la cuenta tributaria de un CUIT
invoice.completed, invoice.failed, batch.completed, draft.review_required, dfe.message.received, tax_account.updated