agency-invoicing
PATCH /v1/agency-invoicing/invoices/{invoiceId}
Edit a draft invoice.
Autenticación
Envía una clave de API como token de portador. La clave debe tener el permiso agency.invoicing.manage; una clave que no lo tenga se rechazará con un código 403, no 404.
Donde va el ID de tu organización
Este endpoint acepta org_id como parámetro de consulta. Omítelo y la llamada abarcará todo tu subárbol de inquilinos; envíalo para acotar la llamada a una sola organización.
El id de tu organización se encuentra en la pantalla de claves de API en tu panel de control, junto a la propia clave. Es el mismo id en cada llamada que realices.
Pruébalo
Reemplaza cualquier elemento entre corchetes angulares por tus propios valores, y el marcador de posición key con una clave de tu panel de control.
curl -X PATCH https://api.zinndigital.com/v1/agency-invoicing/invoices/{invoiceId} \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ }'¿Has iniciado sesión? La consola de la API en tu panel de control rellena el ID de tu organización real y tu propia clave, y ejecuta la solicitud contra la API en vivo para que puedas ver la respuesta real. Abre este endpoint en la consola de la API
Detalles
⛔ A `409` means the invoice has been issued and its figures are frozen. A sent invoice is a document your client is holding — void it and issue a replacement rather than restating it. Requires `agency.invoicing.manage`.
Parámetros
| Nombre | Tipo | Obligatorio | ¿Qué es esto? |
|---|---|---|---|
invoiceId (path) | Uuid | Sí | — |
org_id (query) | Uuid | No | Which of your organizations is invoicing. Required only when you belong to more than one — otherwise it is inferred from your DIRECT membership, never from the subtree-expanded… |
Cuerpo de la solicitud
| Nombre | Tipo | Obligatorio | ¿Qué es esto? |
|---|---|---|---|
currency | string | No | — |
issue_date | string | No | — |
due_date | string | No | — |
reference | string | No | — |
notes | string | No | — |
footer | string | No | — |
lines | AgencyInvoiceLineWrite[] | No | — |
Respuesta
| Nombre | Tipo | Obligatorio | ¿Qué es esto? |
|---|---|---|---|
id | Uuid | Sí | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
number | string | No | The agency's own number. ⛔ Empty until issue: a number allocated to something that may never be sent leaves a hole in a sequence. |
status | string<draft, sent, partially_paid, paid, void> | Sí | — |
is_overdue | boolean | No | ⭐ DERIVED from the due date and the status, never stored — so there is no sweep to maintain a flag and nothing to go stale. A draft is never overdue however old it is: nobody ha… |
client_id | Uuid | No | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
client_name | string | No | — |
currency | string | Sí | — |
issue_date | string | Sí | — |
due_date | string | No | — |
reference | string | No | — |
notes | string | No | — |
footer | string | No | — |
subtotal_minor | integer | No | — |
discount_minor | integer | No | — |
tax_minor | integer | No | — |
total_minor | integer | Sí | — |
amount_paid_minor | integer | No | — |
amount_due_minor | integer | No | — |
tax_breakdown | AgencyInvoiceTaxGroup[] | No | — |
source | string | No | Where the invoice came from — `time_tracking` when it was generated from tracked hours, empty when an agency typed it. |
sent_at | string | No | — |
last_sent_to | string | No | — |
paid_at | string | No | — |
void_reason | string | No | — |
created_at | string | No | — |
lines | AgencyInvoiceLine[] | No | — |
payments | AgencyInvoicePayment[] | No | — |
portal_url | string | No | The payment link to send to the client. ⛔ Returned on a SINGLE-invoice read only, never in a list: a list is the thing that gets logged, cached and pasted into a support ticket,… |
Errores que este endpoint puede devolver
401 · 403 · 404 · 409 · 422 · 429