Ir al contenido

Generar URL de descarga del PDF/XML de una factura

GET
/invoices/{id}/download
curl --request GET \
--url 'https://api.dev.lade.com.mx/invoices/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/download?teamId=2489E9AD-2EE2-8E00-8EC9-32D5F69181C0&type=pdf' \
--header 'Authorization: Bearer <token>'

Genera una URL prefirmada de S3 (expira en 900s) para descargar el PDF o XML de una factura ya timbrada o cancelada. No disponible para facturas en DRAFT/PENDING/ERROR.

id
required
string format: uuid

ID de la factura (UUID)

teamId
required
string format: uuid

ID del equipo (UUID)

type
string
default: pdf
Allowed values: pdf xml

Tipo de archivo a descargar

URL de descarga generada

Media typeapplication/json
object
url
string format: uri
type
string
Allowed values: pdf xml
expiresIn
integer
Example
{
"url": "https://lade-dev-invoices.s3.amazonaws.com/550e8400.../990e8400.../invoice.pdf?X-Amz-Signature=...",
"type": "pdf",
"expiresIn": 900
}

Solicitud inválida

Media typeapplication/json
object
error
required
string
message
string
field
string
Example
{
"error": "Validation failed",
"field": "email",
"message": "Invalid email format"
}

Sin permisos

Media typeapplication/json
object
error
required
string
message
string
field
string
Example
{
"error": "Forbidden",
"message": "You don't have permission to access this resource"
}

Recurso no encontrado

Media typeapplication/json
object
error
required
string
message
string
field
string
Example
{
"error": "Not found",
"message": "Resource not found"
}