Get fiscal sync status
curl --request GET \
--url https://api.prod.payana.cloud/public/api/v1/fiscal-sync/status \
--header 'api-key: <api-key>'import requests
url = "https://api.prod.payana.cloud/public/api/v1/fiscal-sync/status"
headers = {"api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'api-key': '<api-key>'}};
fetch('https://api.prod.payana.cloud/public/api/v1/fiscal-sync/status', 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/fiscal-sync/status",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.prod.payana.cloud/public/api/v1/fiscal-sync/status"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.prod.payana.cloud/public/api/v1/fiscal-sync/status")
.header("api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.prod.payana.cloud/public/api/v1/fiscal-sync/status")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"country": "MEX",
"status": "running",
"fetching_status": "running",
"from": "2026-06-21T15:30:00.000-06:00",
"to": "2026-06-22T15:30:00.000-06:00",
"extraction_id": "ext-abc123",
"error_code": null
}Fiscal Sync
Fiscal Sync Status
Consultar el estado de una sincronización fiscal SAT o DIAN
GET
/
fiscal-sync
/
status
Get fiscal sync status
curl --request GET \
--url https://api.prod.payana.cloud/public/api/v1/fiscal-sync/status \
--header 'api-key: <api-key>'import requests
url = "https://api.prod.payana.cloud/public/api/v1/fiscal-sync/status"
headers = {"api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'api-key': '<api-key>'}};
fetch('https://api.prod.payana.cloud/public/api/v1/fiscal-sync/status', 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/fiscal-sync/status",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.prod.payana.cloud/public/api/v1/fiscal-sync/status"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.prod.payana.cloud/public/api/v1/fiscal-sync/status")
.header("api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.prod.payana.cloud/public/api/v1/fiscal-sync/status")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"country": "MEX",
"status": "running",
"fetching_status": "running",
"from": "2026-06-21T15:30:00.000-06:00",
"to": "2026-06-22T15:30:00.000-06:00",
"extraction_id": "ext-abc123",
"error_code": null
}Consulta el progreso de una sincronización disparada con
POST /fiscal-sync. El formato de la respuesta depende del país de la compañía asociada a la API key.
Parámetros
| Parámetro | Requerido | Descripción |
|---|---|---|
started_at | Recomendado | Timestamp ISO 8601 devuelto por POST /fiscal-sync en el campo started_at. En Colombia se usa como punto de partida para detectar si la sync terminó. Si lo omites en Colombia, Payana usa las últimas 2 horas. |
Respuesta — México
Devuelve el estado de la extracción Satws más reciente de la compañía.| Campo | Descripción |
|---|---|
country | Siempre "MEX". |
status | Estado de la extracción: pending, waiting, running, finished, failed, o not_started si aún no hay extracciones. |
fetching_status | Progreso de descarga de facturas: pending, running, finished, o null. |
from / to | Rango de la extracción (ISO 8601). |
extraction_id | Identificador externo Satws. |
error_code | Código de error si la extracción falló; null en caso contrario. |
Ejemplo — extracción en curso
{
"country": "MEX",
"status": "running",
"fetching_status": "running",
"from": "2026-06-21T15:30:00.000-06:00",
"to": "2026-06-22T15:30:00.000-06:00",
"extraction_id": "ext-abc123",
"error_code": null
}
Ejemplo — sin extracciones previas
{
"country": "MEX",
"status": "not_started",
"fetching_status": null,
"from": null,
"to": null,
"extraction_id": null,
"error_code": null
}
Respuesta — Colombia
Consulta si la sincronización DIAN iniciada después destarted_at ya finalizó, falló o sigue pendiente.
| Campo | Descripción |
|---|---|
country | Siempre "COL". |
status | pending, finished o failed. |
message | Descripción legible del estado. |
Ejemplo — sync completada
{
"country": "COL",
"status": "finished",
"message": "Sync finished"
}
Ejemplo — sync en progreso
{
"country": "COL",
"status": "pending",
"message": "Sync pending"
}
Flujo recomendado de polling
- Llama
POST /fiscal-syncy guardastarted_atde la respuesta. - Consulta
GET /fiscal-sync/status?started_at={started_at}cada 30–60 segundos. - Detén el polling cuando:
- MEX:
statusseafinishedofailed. - COL:
statusseafinishedofailed.
- MEX:
- Opcionalmente, lista documentos nuevos con
GET /documentso espera el webhookdocument.created.
Ejemplo
curl "https://api.prod.payana.cloud/public/api/v1/fiscal-sync/status?started_at=2026-06-22T15:30:00.000Z" \
-H "api-key: YOUR_API_KEY"
Errores
| Código HTTP | Código | Cuándo |
|---|---|---|
401 | — | Falta el header api-key o la clave es inválida. |
422 | fiscal_sync_not_supported_for_country | El país de la compañía no soporta sincronización fiscal. |
422 | company_not_found | La compañía de la API key no existe. |
Authorizations
API key provista por Payana.
Query Parameters
Timestamp ISO 8601 devuelto por POST /fiscal-sync. Recomendado para polling en Colombia.
Response
Estado actual de la sincronización fiscal.
- Option 1
- Option 2
Allowed value:
"MEX"Estado de la extracción Satws.
Available options:
not_started, pending, waiting, running, finished, failed Available options:
pending, running, finished, null