uninvoice (1.0)

Download OpenAPI specification:

License: Apache-2.0

Handle invoices and accounting in an easy and intuitive way

Company

Your company's configuration.

Retrieve the authenticated user's company configuration

header Parameters
Authorization
required
string

Bearer session token

Responses

Response samples

Content type
application/json
{
  • "address": {
    },
  • "correctiveInvoiceReferenceFormat": "string",
  • "correctiveSimplifiedInvoiceReferenceFormat": "string",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "currencyCode": "string",
  • "customPlaceholders": [
    ],
  • "email": "string",
  • "firstCorrectiveInvoiceYearlyNumber": 0,
  • "firstInvoiceYearlyNumber": 0,
  • "fiscalId": "string",
  • "footerInvoiceTypst": "string",
  • "friendlyName": "string",
  • "id": "string",
  • "invoiceReferenceFormat": "string",
  • "isSettled": true,
  • "name": "string",
  • "phone": "string",
  • "postInvoiceTypst": "string",
  • "proformaReferenceFormat": "string",
  • "simplifiedInvoiceReferenceFormat": "string",
  • "type": "string",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "viesVatId": "string"
}

Update company configuration including contact info, address, and invoice settings

header Parameters
Authorization
required
string

Bearer session token

X-Human-Proof
string

AI Audit gate. Present the token's human_proof secret (returned once when the token was minted) to execute this mutation immediately as a human-driven action. Without it (or with an invalid value) the request is NOT executed: it is recorded in the AI Audit backlog and returns 202 pending_approval for a human to approve.

Request Body schema: application/json
required
required
object (Address)

Company postal address.

correctiveInvoiceReferenceFormat
required
string

Format for the frozen reference of corrective invoices; must use {year} and {number} (e.g. R-INV-{year}-{number}).

correctiveSimplifiedInvoiceReferenceFormat
required
string

Format for the frozen reference of corrective simplified invoices; must use {year} and {number} (e.g. R-SINV-{year}-{number}).

currencyCode
string or null

ISO 4217 default currency for the company.

Array of objects (CustomPlaceholder)

Custom placeholder definitions available to the templates.

email
required
string

Primary contact email.

firstCorrectiveInvoiceYearlyNumber
required
integer <int64>

Starting sequence number for the first corrective invoice of each year.

firstInvoiceYearlyNumber
required
integer <int64>

Starting sequence number for the first invoice of each year.

footerInvoiceTypst
string or null

Typst snippet rendered in the invoice footer.

invoiceReferenceFormat
required
string

Format for the frozen reference of regular invoices; must use {year} and {number} (e.g. INV-{year}-{number}).

phone
required
string

Primary contact phone.

postInvoiceTypst
string or null

Typst snippet appended after the invoice body.

proformaReferenceFormat
required
string

Format for the frozen reference of proformas; must use {year} and {number} (e.g. PRO-{year}-{number}).

simplifiedInvoiceReferenceFormat
required
string

Format for the frozen reference of simplified invoices; must use {year} and {number} (e.g. SINV-{year}-{number}).

Responses

Request samples

Content type
application/json
{
  • "address": {
    },
  • "correctiveInvoiceReferenceFormat": "string",
  • "correctiveSimplifiedInvoiceReferenceFormat": "string",
  • "currencyCode": "string",
  • "customPlaceholders": [
    ],
  • "email": "string",
  • "firstCorrectiveInvoiceYearlyNumber": 0,
  • "firstInvoiceYearlyNumber": 0,
  • "footerInvoiceTypst": "string",
  • "invoiceReferenceFormat": "string",
  • "phone": "string",
  • "postInvoiceTypst": "string",
  • "proformaReferenceFormat": "string",
  • "simplifiedInvoiceReferenceFormat": "string"
}

Response samples

Content type
application/json
{
  • "address": {
    },
  • "correctiveInvoiceReferenceFormat": "string",
  • "correctiveSimplifiedInvoiceReferenceFormat": "string",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "currencyCode": "string",
  • "customPlaceholders": [
    ],
  • "email": "string",
  • "firstCorrectiveInvoiceYearlyNumber": 0,
  • "firstInvoiceYearlyNumber": 0,
  • "fiscalId": "string",
  • "footerInvoiceTypst": "string",
  • "friendlyName": "string",
  • "id": "string",
  • "invoiceReferenceFormat": "string",
  • "isSettled": true,
  • "name": "string",
  • "phone": "string",
  • "postInvoiceTypst": "string",
  • "proformaReferenceFormat": "string",
  • "simplifiedInvoiceReferenceFormat": "string",
  • "type": "string",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "viesVatId": "string"
}

Complete company registration for the current user

Requires authentication and agreement to the ToS/Privacy Policy, but not company settlement.

header Parameters
Authorization
required
string

Bearer session token

X-Human-Proof
string

AI Audit gate. Present the token's human_proof secret (returned once when the token was minted) to execute this mutation immediately as a human-driven action. Without it (or with an invalid value) the request is NOT executed: it is recorded in the AI Audit backlog and returns 202 pending_approval for a human to approve.

Request Body schema: application/json
required
required
object (Address)

Legally-complete postal address.

email
required
string

Primary contact email.

fiscal_id
required
string

Company tax identifier (NIF/VAT/etc.).

foral_tax_regime
boolean or null

Whether the company files its taxes in the Basque Country (País Vasco) or Navarre (Navarra), whose regimes are not supported yet. Required for a company established in Spain and refused for any other; true is refused.

name
required
string

Company display name.

phone
required
string

Primary contact phone.

type
required
string

ISO code of the country the company pays its taxes in, then : and its legal form (ES:SL, DE:GmbH). Decides whether VeriFactu applies. Companies in the Canary Islands, Ceuta or Melilla use ES.

Responses

Request samples

Content type
application/json
{
  • "address": {
    },
  • "email": "string",
  • "fiscal_id": "string",
  • "foral_tax_regime": true,
  • "name": "string",
  • "phone": "string",
  • "type": "string"
}

Response samples

Content type
application/json
{
  • "email": "string",
  • "fiscal_id": "string",
  • "id": "string",
  • "is_settled": true,
  • "name": "string",
  • "phone": "string"
}

Company Users

Members of your company.

List who may access the active company

Includes memberships whose access is currently withdrawn or lapsed: they are the company's to restore, so they stay on the list.

header Parameters
Authorization
required
string

Bearer session token

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Invite someone to the active company

Takes an email address and nothing about how its holder signs in. No account is created and no email is sent: the person signs in to the app (creating their account first if they have none) and accepts the invitation there. They are pending, with no access, until they do. Membership is roleless: once accepted it is full access. Re-admitting an address whose access was withdrawn restores that membership, keeping the date it was first granted.

header Parameters
Authorization
required
string

Bearer session token

X-Human-Proof
string

AI Audit gate. Present the token's human_proof secret (returned once when the token was minted) to execute this mutation immediately as a human-driven action. Without it (or with an invalid value) the request is NOT executed: it is recorded in the AI Audit backlog and returns 202 pending_approval for a human to approve.

Request Body schema: application/json
required
email
required
string

Email of the person to invite to the active company.

expiresAt
string or null <date-time>

RFC 3339 timestamp when access should end; absent means never.

Responses

Request samples

Content type
application/json
{
  • "email": "string",
  • "expiresAt": "2019-08-24T14:15:22Z"
}

Response samples

Content type
application/json
{
  • "email": "string",
  • "expiresAt": "2019-08-24T14:15:22Z",
  • "kind": { },
  • "memberSince": "2019-08-24T14:15:22Z",
  • "name": "string",
  • "status": "active"
}

Set when a member's access ends

path Parameters
user_email
required
string

Email of the member

header Parameters
Authorization
required
string

Bearer session token

X-Human-Proof
string

AI Audit gate. Present the token's human_proof secret (returned once when the token was minted) to execute this mutation immediately as a human-driven action. Without it (or with an invalid value) the request is NOT executed: it is recorded in the AI Audit backlog and returns 202 pending_approval for a human to approve.

Request Body schema: application/json
required
expiresAt
string or null <date-time>

RFC 3339 timestamp when access should end; null means never.

Responses

Request samples

Content type
application/json
{
  • "expiresAt": "2019-08-24T14:15:22Z"
}

Response samples

Content type
application/json
{
  • "email": "string",
  • "expiresAt": "2019-08-24T14:15:22Z",
  • "kind": { },
  • "memberSince": "2019-08-24T14:15:22Z",
  • "name": "string",
  • "status": "active"
}

Withdraw a member's access to the active company

Reversible, and scoped to this company: an address that other companies also admitted keeps their books. Nothing is deleted, so the membership stays listed and can be reactivated with its original date.

path Parameters
user_email
required
string

Email of the member

header Parameters
Authorization
required
string

Bearer session token

X-Human-Proof
string

AI Audit gate. Present the token's human_proof secret (returned once when the token was minted) to execute this mutation immediately as a human-driven action. Without it (or with an invalid value) the request is NOT executed: it is recorded in the AI Audit backlog and returns 202 pending_approval for a human to approve.

Responses

Response samples

Content type
application/json
{
  • "email": "string",
  • "expiresAt": "2019-08-24T14:15:22Z",
  • "kind": { },
  • "memberSince": "2019-08-24T14:15:22Z",
  • "name": "string",
  • "status": "active"
}

Give a withdrawn member their access back

path Parameters
user_email
required
string

Email of the member

header Parameters
Authorization
required
string

Bearer session token

X-Human-Proof
string

AI Audit gate. Present the token's human_proof secret (returned once when the token was minted) to execute this mutation immediately as a human-driven action. Without it (or with an invalid value) the request is NOT executed: it is recorded in the AI Audit backlog and returns 202 pending_approval for a human to approve.

Responses

Response samples

Content type
application/json
{
  • "email": "string",
  • "expiresAt": "2019-08-24T14:15:22Z",
  • "kind": { },
  • "memberSince": "2019-08-24T14:15:22Z",
  • "name": "string",
  • "status": "active"
}

Entities

Clients and suppliers you invoice or are invoiced by.

Delete several entities at once

Takes an ids body (DELETE with a payload). Ids that don't resolve for this company, and entities already deleted, are skipped; the response reports how many were actually deleted.

header Parameters
Authorization
required
string

Bearer session token

X-Human-Proof
string

AI Audit gate. Present the token's human_proof secret (returned once when the token was minted) to execute this mutation immediately as a human-driven action. Without it (or with an invalid value) the request is NOT executed: it is recorded in the AI Audit backlog and returns 202 pending_approval for a human to approve.

Request Body schema: application/json
required
ids
required
Array of strings

Document ids the action applies to.

Responses

Request samples

Content type
application/json
{
  • "ids": [
    ]
}

Response samples

Content type
application/json
{
  • "affected": 0
}

List all entities for the current company

header Parameters
Authorization
required
string

Bearer session token

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create an entity for the current company

header Parameters
Authorization
required
string

Bearer session token

X-Human-Proof
string

AI Audit gate. Present the token's human_proof secret (returned once when the token was minted) to execute this mutation immediately as a human-driven action. Without it (or with an invalid value) the request is NOT executed: it is recorded in the AI Audit backlog and returns 202 pending_approval for a human to approve.

Request Body schema: application/json
required
required
object (ThirdPartyAddress)

Postal address; its country is mandatory.

currency_code
string or null

ISO 4217 currency code; defaults to the company currency when omitted.

fiscal_id
string or null

Tax identifier (NIF/VAT number/etc.).

name
required
string

Display name of the entity.

object (EntityTemplate)

Per-recipient Typst template overrides and custom placeholders.

type
required
string

Country the entity is incorporated in, followed by : and its legal form: ES:SL, DE:GmbH, US:Inc. A private individual (end customer) is <country>:individual, for example ES:individual, and carries no VIES VAT ID. The country prefix is what decides how documents to and from this entity are taxed and declared, so it is mandatory and is not derived from the postal address.

null or EntityVerifactu (object)
vies_vat_id
string or null

VIES-registered intra-EU VAT number.

Responses

Request samples

Content type
application/json
{
  • "address": {
    },
  • "currency_code": "string",
  • "fiscal_id": "string",
  • "name": "string",
  • "template": {
    },
  • "type": "string",
  • "verifactu": { },
  • "vies_vat_id": "string"
}

Response samples

Content type
application/json
{
  • "address": {
    },
  • "created_at": "2019-08-24T14:15:22Z",
  • "currency_code": "string",
  • "fiscal_id": "string",
  • "id": "string",
  • "metadata": "string",
  • "name": "string",
  • "template": {
    },
  • "type": "string",
  • "updated_at": "2019-08-24T14:15:22Z",
  • "verifactu": {
    },
  • "vies_vat_id": "string"
}

Delete an entity

The entity stops being listed and can no longer be picked for a new document; invoices and expenses already issued to it are untouched, since they carry their own snapshot of its data.

path Parameters
id
required
string

Entity ID

header Parameters
Authorization
required
string

Bearer session token

X-Human-Proof
string

AI Audit gate. Present the token's human_proof secret (returned once when the token was minted) to execute this mutation immediately as a human-driven action. Without it (or with an invalid value) the request is NOT executed: it is recorded in the AI Audit backlog and returns 202 pending_approval for a human to approve.

Responses

Get an entity by id

path Parameters
id
required
string

Entity ID

header Parameters
Authorization
required
string

Bearer session token

Responses

Response samples

Content type
application/json
{
  • "address": {
    },
  • "created_at": "2019-08-24T14:15:22Z",
  • "currency_code": "string",
  • "fiscal_id": "string",
  • "id": "string",
  • "metadata": "string",
  • "name": "string",
  • "template": {
    },
  • "type": "string",
  • "updated_at": "2019-08-24T14:15:22Z",
  • "verifactu": {
    },
  • "vies_vat_id": "string"
}

Update an existing entity

path Parameters
id
required
string

Entity ID

header Parameters
Authorization
required
string

Bearer session token

X-Human-Proof
string

AI Audit gate. Present the token's human_proof secret (returned once when the token was minted) to execute this mutation immediately as a human-driven action. Without it (or with an invalid value) the request is NOT executed: it is recorded in the AI Audit backlog and returns 202 pending_approval for a human to approve.

Request Body schema: application/json
required
required
object (ThirdPartyAddress)

Postal address; its country is mandatory.

currency_code
string or null

ISO 4217 currency code; defaults to the company currency when omitted.

fiscal_id
string or null

Tax identifier (NIF/VAT number/etc.).

name
required
string

Display name of the entity.

object (EntityTemplate)

Per-recipient Typst template overrides and custom placeholders.

type
required
string

Country the entity is incorporated in, followed by : and its legal form (ES:SL), or <country>:individual for a private individual.

null or EntityVerifactu (object)
vies_vat_id
string or null

VIES-registered intra-EU VAT number. Refused on a private individual.

Responses

Request samples

Content type
application/json
{
  • "address": {
    },
  • "currency_code": "string",
  • "fiscal_id": "string",
  • "name": "string",
  • "template": {
    },
  • "type": "string",
  • "verifactu": { },
  • "vies_vat_id": "string"
}

Response samples

Content type
application/json
{
  • "address": {
    },
  • "created_at": "2019-08-24T14:15:22Z",
  • "currency_code": "string",
  • "fiscal_id": "string",
  • "id": "string",
  • "metadata": "string",
  • "name": "string",
  • "template": {
    },
  • "type": "string",
  • "updated_at": "2019-08-24T14:15:22Z",
  • "verifactu": {
    },
  • "vies_vat_id": "string"
}

List the expenses received from a given supplier entity

path Parameters
id
required
string

Entity ID

header Parameters
Authorization
required
string

Bearer session token

Responses

Response samples

Content type
application/json
[
  • {
    }
]

List the invoices emitted to a given recipient entity

path Parameters
id
required
string

Entity ID

header Parameters
Authorization
required
string

Bearer session token

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Invoices

Create, issue, correct, and download invoices.

List the company's invoices

header Parameters
Authorization
required
string

Bearer session token

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create a draft invoice

Creates an ordinary invoice. To correct an existing invoice, use POST /v1/invoices/{id}/corrections (or the full-reversal shortcut POST /v1/invoices/{id}/correct).

header Parameters
Authorization
required
string

Bearer session token

X-Human-Proof
string

AI Audit gate. Present the token's human_proof secret (returned once when the token was minted) to execute this mutation immediately as a human-driven action. Without it (or with an invalid value) the request is NOT executed: it is recorded in the AI Audit backlog and returns 202 pending_approval for a human to approve.

Request Body schema: application/json
required
bank_account_ids
Array of strings

Ids of the company's bank accounts to show on the invoice as payment instructions. Each is snapshotted onto the invoice at creation; unknown ids are ignored.

currency_code
string or null

ISO 4217 currency the invoice amounts are expressed in. When omitted (or empty) it falls back to the recipient entity's configured currency.

Array of objects (CustomPlaceholderValue)

Per-recipient template placeholder values for this invoice.

Array of objects (ExchangeRateEntry)

Manually-supplied exchange rates for the currency pairs the effective template uses. A pair supplied here is frozen as-is and is not fetched from the provider at issue time.

required
Array of objects (InvoiceLineRequest)

The invoice line items.

locale
string or null

Language to render the document in (en, es, es_ES), frozen onto it at creation and never changed afterwards. Omitted falls back to the acting user's language. An unsupported tag is refused.

recipient_id
required
string

Recipient entity the invoice is billed to.

null or SupplyType (string)

Responses

Request samples

Content type
application/json
{
  • "bank_account_ids": [
    ],
  • "currency_code": "string",
  • "custom_placeholder_values": [
    ],
  • "exchange_rates": [
    ],
  • "lines": [
    ],
  • "locale": "string",
  • "recipient_id": "string",
  • "supply_type": { }
}

Response samples

Content type
application/json
{
  • "currency_code": "string",
  • "custom_placeholder_values": [
    ],
  • "id": "string",
  • "invoice_number": 0,
  • "invoice_year": 0,
  • "issued_at": "2019-08-24T14:15:22Z",
  • "lines": [
    ],
  • "locale": "string",
  • "order_number": 0,
  • "order_year": 0,
  • "origin": "native",
  • "recipient_id": "string",
  • "reference": "string",
  • "supply_type": "services",
  • "total": 0
}

Download several invoice PDFs as a single ZIP

Selects the ids given in ?ids=a,b,c; ids that don't resolve for this company are dropped from the archive. Drafts bundle their watermarked preview, exactly as the single-invoice download does.

query Parameters
ids
required
string

Comma-separated document ids to bundle, e.g. ids=abc,def.

header Parameters
Authorization
required
string

Bearer session token

Responses

Import an already-existing invoice

Records an invoice that was created (and, where applicable, already reported) elsewhere. It is stored issued with its original reference and date, so it counts towards reports and totals. The reference must be unique within the company.

Spain-incorporated companies: an imported invoice is never submitted to VeriFactu; it is treated as already reported at its origin.

header Parameters
Authorization
required
string

Bearer session token

X-Human-Proof
string

AI Audit gate. Present the token's human_proof secret (returned once when the token was minted) to execute this mutation immediately as a human-driven action. Without it (or with an invalid value) the request is NOT executed: it is recorded in the AI Audit backlog and returns 202 pending_approval for a human to approve.

Request Body schema: application/json
required
bank_account_ids
Array of strings

Ids of the company's bank accounts to show on the invoice as payment instructions. Unknown ids are ignored.

currency_code
string or null

ISO 4217 currency. When omitted (or empty) it falls back to the company default, then the recipient entity's configured currency.

Array of objects (CustomPlaceholderValue)

Per-recipient template placeholder values for this invoice.

Array of objects (ExchangeRateEntry)

Frozen exchange rates for any currency pair the effective template uses.

invoice_date
required
string <date>

The original issue date, a calendar date (YYYY-MM-DD); its year places the invoice in reports.

required
Array of objects (InvoiceLineRequest)

The invoice line items, exactly as on the original document (amounts are used verbatim; no VAT is recomputed). Include tax lines explicitly.

locale
string or null

The language the original document was written in (en, es, es_ES), frozen onto the imported invoice. Omitted falls back to the acting user's language. An unsupported tag is refused.

recipient_id
required
string

Recipient entity the invoice was billed to.

reference
required
string

The original document identifier (any format, e.g. A/2024/99). Mandatory and unique within the company.

null or SupplyType (string)

Responses

Request samples

Content type
application/json
{
  • "bank_account_ids": [
    ],
  • "currency_code": "string",
  • "custom_placeholder_values": [
    ],
  • "exchange_rates": [
    ],
  • "invoice_date": "2019-08-24",
  • "lines": [
    ],
  • "locale": "string",
  • "recipient_id": "string",
  • "reference": "string",
  • "supply_type": { }
}

Response samples

Content type
application/json
{
  • "currency_code": "string",
  • "custom_placeholder_values": [
    ],
  • "id": "string",
  • "invoice_number": 0,
  • "invoice_year": 0,
  • "issued_at": "2019-08-24T14:15:22Z",
  • "lines": [
    ],
  • "locale": "string",
  • "order_number": 0,
  • "order_year": 0,
  • "origin": "native",
  • "recipient_id": "string",
  • "reference": "string",
  • "supply_type": "services",
  • "total": 0
}

Fetch the dynamic invoice-form context for a recipient

Returns the effective custom-placeholder definitions and the exchange-rate pairs the recipient's template needs, which drive the adaptive invoice-creation form.

query Parameters
recipient_id
required
string

Recipient entity ID

header Parameters
Authorization
required
string

Bearer session token

Responses

Response samples

Content type
application/json
{
  • "custom_placeholders": [
    ],
  • "required_exchange_rates": [
    ]
}

Delete a draft invoice

Deletes a draft that has not been issued. A draft has no number and no VeriFactu record, so nothing is consumed. An issued invoice cannot be deleted.

path Parameters
id
required
string

Draft invoice ID

header Parameters
Authorization
required
string

Bearer session token

X-Human-Proof
string

AI Audit gate. Present the token's human_proof secret (returned once when the token was minted) to execute this mutation immediately as a human-driven action. Without it (or with an invalid value) the request is NOT executed: it is recorded in the AI Audit backlog and returns 202 pending_approval for a human to approve.

Responses

Fetch a single invoice by ID

path Parameters
id
required
string

Invoice ID

header Parameters
Authorization
required
string

Bearer session token

Responses

Response samples

Content type
application/json
{
  • "bank_account_ids": [
    ],
  • "corrected_invoice_id": "string",
  • "currency_code": "string",
  • "custom_placeholder_values": [
    ],
  • "exchange_rates": [
    ],
  • "id": "string",
  • "invoice_number": 0,
  • "invoice_year": 0,
  • "issued_at": "2019-08-24T14:15:22Z",
  • "lines": [
    ],
  • "locale": "string",
  • "order_number": 0,
  • "order_year": 0,
  • "origin": "native",
  • "recipient_id": "string",
  • "reference": "string",
  • "supply_type": "services",
  • "total": 0,
  • "verifactu": { },
  • "verifactu_records": [
    ]
}

Edit a draft invoice

Replaces the draft in full with the request body, which takes the same fields as creating an invoice. The draft is validated and its lines are resolved exactly as at creation, and the issuer and recipient details, language, exchange rates and bank accounts are captured again as they are now. A draft can be edited until it is issued; an issued invoice cannot be edited and is changed by a corrective invoice instead. A corrective draft keeps the recipient, currency and language of the invoice it corrects.

path Parameters
id
required
string

Draft invoice ID

header Parameters
Authorization
required
string

Bearer session token

X-Human-Proof
string

AI Audit gate. Present the token's human_proof secret (returned once when the token was minted) to execute this mutation immediately as a human-driven action. Without it (or with an invalid value) the request is NOT executed: it is recorded in the AI Audit backlog and returns 202 pending_approval for a human to approve.

Request Body schema: application/json
required
bank_account_ids
Array of strings

Ids of the company's bank accounts to show on the invoice as payment instructions. Each is snapshotted onto the invoice at creation; unknown ids are ignored.

currency_code
string or null

ISO 4217 currency the invoice amounts are expressed in. When omitted (or empty) it falls back to the recipient entity's configured currency.

Array of objects (CustomPlaceholderValue)

Per-recipient template placeholder values for this invoice.

Array of objects (ExchangeRateEntry)

Manually-supplied exchange rates for the currency pairs the effective template uses. A pair supplied here is frozen as-is and is not fetched from the provider at issue time.

required
Array of objects (InvoiceLineRequest)

The invoice line items.

locale
string or null

Language to render the document in (en, es, es_ES), frozen onto it at creation and never changed afterwards. Omitted falls back to the acting user's language. An unsupported tag is refused.

recipient_id
required
string

Recipient entity the invoice is billed to.

null or SupplyType (string)

Responses

Request samples

Content type
application/json
{
  • "bank_account_ids": [
    ],
  • "currency_code": "string",
  • "custom_placeholder_values": [
    ],
  • "exchange_rates": [
    ],
  • "lines": [
    ],
  • "locale": "string",
  • "recipient_id": "string",
  • "supply_type": { }
}

Response samples

Content type
application/json
{
  • "bank_account_ids": [
    ],
  • "corrected_invoice_id": "string",
  • "currency_code": "string",
  • "custom_placeholder_values": [
    ],
  • "exchange_rates": [
    ],
  • "id": "string",
  • "invoice_number": 0,
  • "invoice_year": 0,
  • "issued_at": "2019-08-24T14:15:22Z",
  • "lines": [
    ],
  • "locale": "string",
  • "order_number": 0,
  • "order_year": 0,
  • "origin": "native",
  • "recipient_id": "string",
  • "reference": "string",
  • "supply_type": "services",
  • "total": 0,
  • "verifactu": { },
  • "verifactu_records": [
    ]
}

Create a corrective invoice that fully reverses an issued invoice

Convenience wrapper over POST /v1/invoices/{id}/corrections for the most common correction: it copies every line of the source invoice with negated amounts (a complete reversal). The source invoice must be issued and not cancelled. Takes no body.

When you need a partial correction, or corrective lines that differ from the original, use POST /v1/invoices/{id}/corrections.

path Parameters
id
required
string

Invoice ID to correct

header Parameters
Authorization
required
string

Bearer session token

X-Human-Proof
string

AI Audit gate. Present the token's human_proof secret (returned once when the token was minted) to execute this mutation immediately as a human-driven action. Without it (or with an invalid value) the request is NOT executed: it is recorded in the AI Audit backlog and returns 202 pending_approval for a human to approve.

Responses

Response samples

Content type
application/json
{
  • "corrected_invoice_id": "string",
  • "currency_code": "string",
  • "custom_placeholder_values": [
    ],
  • "id": "string",
  • "invoice_number": 0,
  • "invoice_year": 0,
  • "issued_at": "2019-08-24T14:15:22Z",
  • "lines": [
    ],
  • "locale": "string",
  • "order_number": 0,
  • "order_year": 0,
  • "origin": "native",
  • "recipient_id": "string",
  • "reference": "string",
  • "supply_type": "services",
  • "total": 0,
  • "verifactu": { }
}

Create a corrective invoice for an existing invoice

The new invoice corrects the invoice named in the path, which must be finalized (issued) and not cancelled. Its recipient and currency are inherited from the corrected invoice and cannot be changed. Supply type, lines, custom placeholder values and exchange rates default to the corrected invoice's but may be overridden in the body; an empty lines list copies the corrected invoice's lines with negated amounts (a full reversal).

path Parameters
id
required
string

Invoice ID being corrected

header Parameters
Authorization
required
string

Bearer session token

X-Human-Proof
string

AI Audit gate. Present the token's human_proof secret (returned once when the token was minted) to execute this mutation immediately as a human-driven action. Without it (or with an invalid value) the request is NOT executed: it is recorded in the AI Audit backlog and returns 202 pending_approval for a human to approve.

Request Body schema: application/json
required
Array of objects (CustomPlaceholderValue)

Override the custom placeholder values. When empty, the corrected invoice's are kept.

Array of objects (ExchangeRateEntry)

Override the frozen exchange rates. When empty, the corrected invoice's are kept.

Array of objects (InvoiceLineRequest)

The corrective lines. Leave empty to copy the corrected invoice's lines with negated amounts (a full reversal).

null or SupplyType (string)
null or InvoiceVerifactu (object)

Responses

Request samples

Content type
application/json
{
  • "custom_placeholder_values": [
    ],
  • "exchange_rates": [
    ],
  • "lines": [
    ],
  • "supply_type": { },
  • "verifactu": { }
}

Response samples

Content type
application/json
{
  • "corrected_invoice_id": "string",
  • "currency_code": "string",
  • "custom_placeholder_values": [
    ],
  • "id": "string",
  • "invoice_number": 0,
  • "invoice_year": 0,
  • "issued_at": "2019-08-24T14:15:22Z",
  • "lines": [
    ],
  • "locale": "string",
  • "order_number": 0,
  • "order_year": 0,
  • "origin": "native",
  • "recipient_id": "string",
  • "reference": "string",
  • "supply_type": "services",
  • "total": 0,
  • "verifactu": { }
}

Issue (finalize) a draft invoice

Assigns the fiscal invoice number and freezes the document; any missing exchange rates are fetched at this point.

path Parameters
id
required
string

Invoice ID

header Parameters
Authorization
required
string

Bearer session token

X-Human-Proof
string

AI Audit gate. Present the token's human_proof secret (returned once when the token was minted) to execute this mutation immediately as a human-driven action. Without it (or with an invalid value) the request is NOT executed: it is recorded in the AI Audit backlog and returns 202 pending_approval for a human to approve.

Responses

Response samples

Content type
application/json
{
  • "bank_account_ids": [
    ],
  • "corrected_invoice_id": "string",
  • "currency_code": "string",
  • "custom_placeholder_values": [
    ],
  • "exchange_rates": [
    ],
  • "id": "string",
  • "invoice_number": 0,
  • "invoice_year": 0,
  • "issued_at": "2019-08-24T14:15:22Z",
  • "lines": [
    ],
  • "locale": "string",
  • "order_number": 0,
  • "order_year": 0,
  • "origin": "native",
  • "recipient_id": "string",
  • "reference": "string",
  • "supply_type": "services",
  • "total": 0,
  • "verifactu": { },
  • "verifactu_records": [
    ]
}

Download an invoice PDF

path Parameters
id
required
string

Invoice ID

header Parameters
Authorization
required
string

Bearer session token

Responses

Resend an invoice's VeriFactu record the AEAT rejected or flagged

When the AEAT rejected the invoice's last VeriFactu record, or accepted its registration with errors, this appends the record that answer prescribes and sends it: a rejected registration or cancellation is resent with RechazoPrevio, a registration accepted with errors is corrected with a subsanación. The new record is generated from the issued invoice, which does not change, and the earlier record stays in the chain as it was.

This is a technical resend of the record, not a tax correction of the invoice. Use it once the cause the AEAT reported is fixed; a record carrying repairable: true is the one it resends. Answers 409 when there is nothing to resend: the last record was accepted, is still on its way, or is unresolved (uninvoice.app settles those).

path Parameters
id
required
string

Invoice ID

header Parameters
Authorization
required
string

Bearer session token

X-Human-Proof
string

AI Audit gate. Present the token's human_proof secret (returned once when the token was minted) to execute this mutation immediately as a human-driven action. Without it (or with an invalid value) the request is NOT executed: it is recorded in the AI Audit backlog and returns 202 pending_approval for a human to approve.

Responses

Response samples

Content type
application/json
{
  • "bank_account_ids": [
    ],
  • "corrected_invoice_id": "string",
  • "currency_code": "string",
  • "custom_placeholder_values": [
    ],
  • "exchange_rates": [
    ],
  • "id": "string",
  • "invoice_number": 0,
  • "invoice_year": 0,
  • "issued_at": "2019-08-24T14:15:22Z",
  • "lines": [
    ],
  • "locale": "string",
  • "order_number": 0,
  • "order_year": 0,
  • "origin": "native",
  • "recipient_id": "string",
  • "reference": "string",
  • "supply_type": "services",
  • "total": 0,
  • "verifactu": { },
  • "verifactu_records": [
    ]
}

Compute tax lines for a set of invoice lines

Returns the lines as they would be stored: each goods or services line with its rate and VAT, and one vat line per rate, and the total the document would be stored with. On a new invoice, lines that state no rate take the default for the operation; on an import they carry no VAT. Filling in a Spanish autónomo's invoice to a Spanish business also adds the IRPF withholding (see mode).

header Parameters
Authorization
required
string

Bearer session token

X-Human-Proof
string

AI Audit gate. Present the token's human_proof secret (returned once when the token was minted) to execute this mutation immediately as a human-driven action. Without it (or with an invalid value) the request is NOT executed: it is recorded in the AI Audit backlog and returns 202 pending_approval for a human to approve.

Request Body schema: application/json
required
required
Array of objects (InvoiceLineRequest)

The lines as they would be sent to create the invoice.

locale
string or null

The language the invoice would be created in (en or es), which the derived tax lines' concepts are worded in. As on creation, the caller's language when omitted.

mode
string (TaxPrefillMode)
Enum: "autofill" "resolve"

autofill (the default) fills a new invoice or proforma in: for a Spanish autónomo invoicing a Spanish business or professional, it also adds the IRPF withholding at the general 15 % when no line states one. resolve adds nothing, and its total is the one the lines as sent would be stored with.

origin
string (InvoiceOrigin)
Enum: "native" "imported"

How the lines would be stored. imported previews an import: a line stating no rate carries no VAT and a stated VAT amount is kept as written. Defaults to native, a new invoice.

recipient_id
required
string

Recipient entity whose tax rules decide the default rate.

null or SupplyType (string)

Responses

Request samples

Content type
application/json
{
  • "lines": [
    ],
  • "locale": "string",
  • "mode": "autofill",
  • "origin": "native",
  • "recipient_id": "string",
  • "supply_type": { }
}

Response samples

Content type
application/json
{
  • "lines": [
    ],
  • "total": 0
}

Proformas

Non-fiscal quotes; promote them into invoices.

Delete several proformas at once

Takes an ids body (DELETE with a payload). Unknown ids, and proformas that were already promoted (and so can't be deleted), are skipped; the response reports how many were actually deleted.

header Parameters
Authorization
required
string

Bearer session token

X-Human-Proof
string

AI Audit gate. Present the token's human_proof secret (returned once when the token was minted) to execute this mutation immediately as a human-driven action. Without it (or with an invalid value) the request is NOT executed: it is recorded in the AI Audit backlog and returns 202 pending_approval for a human to approve.

Request Body schema: application/json
required
ids
required
Array of strings

Document ids the action applies to.

Responses

Request samples

Content type
application/json
{
  • "ids": [
    ]
}

Response samples

Content type
application/json
{
  • "affected": 0
}

List the company's proformas

header Parameters
Authorization
required
string

Bearer session token

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create a proforma invoice

header Parameters
Authorization
required
string

Bearer session token

X-Human-Proof
string

AI Audit gate. Present the token's human_proof secret (returned once when the token was minted) to execute this mutation immediately as a human-driven action. Without it (or with an invalid value) the request is NOT executed: it is recorded in the AI Audit backlog and returns 202 pending_approval for a human to approve.

Request Body schema: application/json
required
bank_account_ids
Array of strings

Ids of the company's bank accounts to show on the invoice as payment instructions. Each is snapshotted onto the invoice at creation; unknown ids are ignored.

currency_code
string or null

ISO 4217 currency the invoice amounts are expressed in. When omitted (or empty) it falls back to the recipient entity's configured currency.

Array of objects (CustomPlaceholderValue)

Per-recipient template placeholder values for this invoice.

Array of objects (ExchangeRateEntry)

Manually-supplied exchange rates for the currency pairs the effective template uses. A pair supplied here is frozen as-is and is not fetched from the provider at issue time.

required
Array of objects (InvoiceLineRequest)

The invoice line items.

locale
string or null

Language to render the document in (en, es, es_ES), frozen onto it at creation and never changed afterwards. Omitted falls back to the acting user's language. An unsupported tag is refused.

recipient_id
required
string

Recipient entity the invoice is billed to.

null or SupplyType (string)

Responses

Request samples

Content type
application/json
{
  • "bank_account_ids": [
    ],
  • "currency_code": "string",
  • "custom_placeholder_values": [
    ],
  • "exchange_rates": [
    ],
  • "lines": [
    ],
  • "locale": "string",
  • "recipient_id": "string",
  • "supply_type": { }
}

Response samples

Content type
application/json
{
  • "currency_code": "string",
  • "custom_placeholder_values": [
    ],
  • "id": "string",
  • "invoice_number": 0,
  • "invoice_year": 0,
  • "issued_at": "2019-08-24T14:15:22Z",
  • "lines": [
    ],
  • "locale": "string",
  • "order_number": 0,
  • "order_year": 0,
  • "origin": "native",
  • "recipient_id": "string",
  • "reference": "string",
  • "supply_type": "services",
  • "total": 0
}

Download several proforma PDFs as a single ZIP

Selects the ids given in ?ids=a,b,c; ids that don't resolve for this company are dropped from the archive.

query Parameters
ids
required
string

Comma-separated document ids to bundle, e.g. ids=abc,def.

header Parameters
Authorization
required
string

Bearer session token

Responses

Promote several proformas at once

Runs the same issue flow as the single-proforma promotion for each id. Unknown ids, and proformas that were already promoted, are skipped; the response reports how many were promoted. A real failure (e.g. the VeriFactu authorization gate) aborts the batch and is surfaced, leaving the proformas promoted so far promoted.

header Parameters
Authorization
required
string

Bearer session token

X-Human-Proof
string

AI Audit gate. Present the token's human_proof secret (returned once when the token was minted) to execute this mutation immediately as a human-driven action. Without it (or with an invalid value) the request is NOT executed: it is recorded in the AI Audit backlog and returns 202 pending_approval for a human to approve.

Request Body schema: application/json
required
ids
required
Array of strings

Document ids the action applies to.

Responses

Request samples

Content type
application/json
{
  • "ids": [
    ]
}

Response samples

Content type
application/json
{
  • "affected": 0
}

Delete a proforma

path Parameters
id
required
string

Proforma ID

header Parameters
Authorization
required
string

Bearer session token

X-Human-Proof
string

AI Audit gate. Present the token's human_proof secret (returned once when the token was minted) to execute this mutation immediately as a human-driven action. Without it (or with an invalid value) the request is NOT executed: it is recorded in the AI Audit backlog and returns 202 pending_approval for a human to approve.

Responses

Fetch a single proforma by ID

path Parameters
id
required
string

Proforma ID

header Parameters
Authorization
required
string

Bearer session token

Responses

Response samples

Content type
application/json
{
  • "currency_code": "string",
  • "custom_placeholder_values": [
    ],
  • "id": "string",
  • "invoice_number": 0,
  • "invoice_year": 0,
  • "issued_at": "2019-08-24T14:15:22Z",
  • "lines": [
    ],
  • "locale": "string",
  • "order_number": 0,
  • "order_year": 0,
  • "origin": "native",
  • "recipient_id": "string",
  • "reference": "string",
  • "supply_type": "services",
  • "total": 0
}

Download a proforma PDF

path Parameters
id
required
string

Proforma invoice ID

header Parameters
Authorization
required
string

Bearer session token

Responses

Promote a proforma to a draft invoice

Converts the proforma into an ordinary draft invoice, which can then be issued.

path Parameters
id
required
string

Proforma invoice ID

header Parameters
Authorization
required
string

Bearer session token

X-Human-Proof
string

AI Audit gate. Present the token's human_proof secret (returned once when the token was minted) to execute this mutation immediately as a human-driven action. Without it (or with an invalid value) the request is NOT executed: it is recorded in the AI Audit backlog and returns 202 pending_approval for a human to approve.

Responses

Response samples

Content type
application/json
{
  • "currency_code": "string",
  • "custom_placeholder_values": [
    ],
  • "id": "string",
  • "invoice_number": 0,
  • "invoice_year": 0,
  • "issued_at": "2019-08-24T14:15:22Z",
  • "lines": [
    ],
  • "locale": "string",
  • "order_number": 0,
  • "order_year": 0,
  • "origin": "native",
  • "recipient_id": "string",
  • "reference": "string",
  • "supply_type": "services",
  • "total": 0
}

Expenses

Bills received from suppliers, with receipts.

Delete several expenses at once

Takes an ids body (DELETE with a payload). Ids that don't resolve for this company are skipped; the response reports how many were deleted.

header Parameters
Authorization
required
string

Bearer session token

X-Human-Proof
string

AI Audit gate. Present the token's human_proof secret (returned once when the token was minted) to execute this mutation immediately as a human-driven action. Without it (or with an invalid value) the request is NOT executed: it is recorded in the AI Audit backlog and returns 202 pending_approval for a human to approve.

Request Body schema: application/json
required
ids
required
Array of strings

Document ids the action applies to.

Responses

Request samples

Content type
application/json
{
  • "ids": [
    ]
}

Response samples

Content type
application/json
{
  • "affected": 0
}

List expenses for the current company

header Parameters
Authorization
required
string

Bearer session token

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create an expense for the current company

header Parameters
Authorization
required
string

Bearer session token

X-Human-Proof
string

AI Audit gate. Present the token's human_proof secret (returned once when the token was minted) to execute this mutation immediately as a human-driven action. Without it (or with an invalid value) the request is NOT executed: it is recorded in the AI Audit backlog and returns 202 pending_approval for a human to approve.

Request Body schema: application/json
required
category
string or null

Free-form accounting category for the expense.

currency_code
string or null

ISO 4217 currency code of the expense.

description
string or null

Free-form description of the expense.

exchange_rate
integer or null <int64>

Frozen FX rate used to convert the expense to the company currency.

expense_date
string or null <date-time>

Date of the expense (RFC 3339).

invoice_reference
required
string

The supplier invoice's reference/number (required, non-empty, unique per company+supplier).

required
Array of objects (ExpenseLineRequest)

Line items making up the expense.

supplier_id
required
string

Supplier entity id (the counterparty the bill was received from).

Responses

Request samples

Content type
application/json
{
  • "category": "string",
  • "currency_code": "string",
  • "description": "string",
  • "exchange_rate": 0,
  • "expense_date": "2019-08-24T14:15:22Z",
  • "invoice_reference": "string",
  • "lines": [
    ],
  • "supplier_id": "string"
}

Response samples

Content type
application/json
{
  • "category": "string",
  • "created_at": "2019-08-24T14:15:22Z",
  • "currency_code": "string",
  • "description": "string",
  • "exchange_rate": 0,
  • "expense_date": "2019-08-24T14:15:22Z",
  • "id": "string",
  • "invoice_reference": "string",
  • "lines": [
    ],
  • "receipt": { },
  • "supplier_fiscal_id": "string",
  • "supplier_id": "string",
  • "supplier_name": "string",
  • "total": 0,
  • "updated_at": "2019-08-24T14:15:22Z"
}

Delete an expense

path Parameters
id
required
string

Expense ID

header Parameters
Authorization
required
string

Bearer session token

X-Human-Proof
string

AI Audit gate. Present the token's human_proof secret (returned once when the token was minted) to execute this mutation immediately as a human-driven action. Without it (or with an invalid value) the request is NOT executed: it is recorded in the AI Audit backlog and returns 202 pending_approval for a human to approve.

Responses

Get an expense by id

path Parameters
id
required
string

Expense ID

header Parameters
Authorization
required
string

Bearer session token

Responses

Response samples

Content type
application/json
{
  • "category": "string",
  • "created_at": "2019-08-24T14:15:22Z",
  • "currency_code": "string",
  • "description": "string",
  • "exchange_rate": 0,
  • "expense_date": "2019-08-24T14:15:22Z",
  • "id": "string",
  • "invoice_reference": "string",
  • "lines": [
    ],
  • "receipt": { },
  • "supplier_fiscal_id": "string",
  • "supplier_id": "string",
  • "supplier_name": "string",
  • "total": 0,
  • "updated_at": "2019-08-24T14:15:22Z"
}

Confirm a completed receipt upload and attach it to the expense

The stored object is checked, not the client's description of it: its size must be within the limit and its content a PDF, PNG, JPEG or WebP file matching its declared type. The checked bytes are then copied to the receipt the expense keeps, which no upload URL can overwrite.

path Parameters
id
required
string

Expense ID

header Parameters
Authorization
required
string

Bearer session token

X-Human-Proof
string

AI Audit gate. Present the token's human_proof secret (returned once when the token was minted) to execute this mutation immediately as a human-driven action. Without it (or with an invalid value) the request is NOT executed: it is recorded in the AI Audit backlog and returns 202 pending_approval for a human to approve.

Request Body schema: application/json
required
filename
required
string

Original filename of the uploaded receipt.

object_key
required
string

Storage key of the uploaded receipt object.

Responses

Request samples

Content type
application/json
{
  • "filename": "string",
  • "object_key": "string"
}

Response samples

Content type
application/json
{
  • "category": "string",
  • "created_at": "2019-08-24T14:15:22Z",
  • "currency_code": "string",
  • "description": "string",
  • "exchange_rate": 0,
  • "expense_date": "2019-08-24T14:15:22Z",
  • "id": "string",
  • "invoice_reference": "string",
  • "lines": [
    ],
  • "receipt": { },
  • "supplier_fiscal_id": "string",
  • "supplier_id": "string",
  • "supplier_name": "string",
  • "total": 0,
  • "updated_at": "2019-08-24T14:15:22Z"
}

Get a presigned URL to download an expense receipt

Returns a short-lived presigned URL; the browser GETs the receipt bytes directly from object storage, never through the backend.

path Parameters
id
required
string

Expense ID

header Parameters
Authorization
required
string

Bearer session token

Responses

Response samples

Content type
application/json
{
  • "expires_at": "2019-08-24T14:15:22Z",
  • "filename": "string",
  • "url": "string"
}

Get a presigned URL to upload an expense receipt

Returns a short-lived presigned URL; the browser PUTs the receipt bytes directly to object storage, never through the backend. The URL accepts only the declared type and size, and writes a staging object that becomes the receipt only once confirmed.

path Parameters
id
required
string

Expense ID

header Parameters
Authorization
required
string

Bearer session token

X-Human-Proof
string

AI Audit gate. Present the token's human_proof secret (returned once when the token was minted) to run this action as a human-driven one. Its response is a one-time secret or link, so without it (or with an invalid value) the request is refused with 403 rather than held for approval.

Request Body schema: application/json
required
content_type
required
string

MIME type of the receipt to upload: application/pdf, image/png, image/jpeg or image/webp. The upload must send this exact Content-Type.

size
required
integer <int64>

Size of the receipt to upload in bytes, at most 20 MiB. The upload must be exactly this long.

Responses

Request samples

Content type
application/json
{
  • "content_type": "string",
  • "size": 0
}

Response samples

Content type
application/json
{
  • "expires_at": "2019-08-24T14:15:22Z",
  • "object_key": "string",
  • "url": "string"
}

Bank Accounts

Your company's bank accounts and balance snapshots.

Delete several bank accounts at once

Takes an ids body (DELETE with a payload). Ids that don't resolve for this company are skipped; the response reports how many were deleted.

header Parameters
Authorization
required
string

Bearer session token

X-Human-Proof
string

AI Audit gate. Present the token's human_proof secret (returned once when the token was minted) to execute this mutation immediately as a human-driven action. Without it (or with an invalid value) the request is NOT executed: it is recorded in the AI Audit backlog and returns 202 pending_approval for a human to approve.

Request Body schema: application/json
required
ids
required
Array of strings

Document ids the action applies to.

Responses

Request samples

Content type
application/json
{
  • "ids": [
    ]
}

Response samples

Content type
application/json
{
  • "affected": 0
}

List the current company's bank accounts (with balances)

header Parameters
Authorization
required
string

Bearer session token

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create a bank account for the current company

header Parameters
Authorization
required
string

Bearer session token

X-Human-Proof
string

AI Audit gate. Present the token's human_proof secret (returned once when the token was minted) to execute this mutation immediately as a human-driven action. Without it (or with an invalid value) the request is NOT executed: it is recorded in the AI Audit backlog and returns 202 pending_approval for a human to approve.

Request Body schema: application/json
required
bank_name
string or null

Institution name.

bic
string or null

Bank Identifier Code / SWIFT.

currency_code
string or null

ISO 4217 currency code. Defaults to EUR when omitted.

iban
string or null

International Bank Account Number.

intermediary_bic
string or null

BIC/SWIFT of the correspondent/intermediary bank some cross-border wires must be routed through — a separate bank from the account's own, not an alternative to bic.

is_main
boolean or null

Make this the company's default account. The first account is always made the default regardless of this flag.

name
required
string

User-facing label for the account.

Responses

Request samples

Content type
application/json
{
  • "bank_name": "string",
  • "bic": "string",
  • "currency_code": "string",
  • "iban": "string",
  • "intermediary_bic": "string",
  • "is_main": true,
  • "name": "string"
}

Response samples

Content type
application/json
{
  • "balance_as_of": "2019-08-24T14:15:22Z",
  • "bank_name": "string",
  • "bic": "string",
  • "created_at": "2019-08-24T14:15:22Z",
  • "currency_code": "string",
  • "current_balance_minor": 0,
  • "iban": "string",
  • "id": "string",
  • "intermediary_bic": "string",
  • "is_main": true,
  • "name": "string",
  • "updated_at": "2019-08-24T14:15:22Z"
}

Delete a bank account

path Parameters
id
required
string

Bank account ID

header Parameters
Authorization
required
string

Bearer session token

X-Human-Proof
string

AI Audit gate. Present the token's human_proof secret (returned once when the token was minted) to execute this mutation immediately as a human-driven action. Without it (or with an invalid value) the request is NOT executed: it is recorded in the AI Audit backlog and returns 202 pending_approval for a human to approve.

Responses

Get a bank account with its balance-snapshot history

path Parameters
id
required
string

Bank account ID

header Parameters
Authorization
required
string

Bearer session token

Responses

Response samples

Content type
application/json
{
  • "account": {
    },
  • "snapshots": [
    ]
}

Update a bank account

path Parameters
id
required
string

Bank account ID

header Parameters
Authorization
required
string

Bearer session token

X-Human-Proof
string

AI Audit gate. Present the token's human_proof secret (returned once when the token was minted) to execute this mutation immediately as a human-driven action. Without it (or with an invalid value) the request is NOT executed: it is recorded in the AI Audit backlog and returns 202 pending_approval for a human to approve.

Request Body schema: application/json
required
bank_name
string or null

Institution name.

bic
string or null

Bank Identifier Code / SWIFT.

currency_code
required
string

ISO 4217 currency code of the account.

iban
string or null

International Bank Account Number.

intermediary_bic
string or null

BIC/SWIFT of the correspondent/intermediary bank some cross-border wires must be routed through — a separate bank from the account's own, not an alternative to bic.

name
required
string

User-facing label for the account.

Responses

Request samples

Content type
application/json
{
  • "bank_name": "string",
  • "bic": "string",
  • "currency_code": "string",
  • "iban": "string",
  • "intermediary_bic": "string",
  • "name": "string"
}

Response samples

Content type
application/json
{
  • "balance_as_of": "2019-08-24T14:15:22Z",
  • "bank_name": "string",
  • "bic": "string",
  • "created_at": "2019-08-24T14:15:22Z",
  • "currency_code": "string",
  • "current_balance_minor": 0,
  • "iban": "string",
  • "id": "string",
  • "intermediary_bic": "string",
  • "is_main": true,
  • "name": "string",
  • "updated_at": "2019-08-24T14:15:22Z"
}

Make a bank account the company's default

Clears the previous default and marks this account as the one pre-selected wherever an account is picked (e.g. invoice payment details).

path Parameters
id
required
string

Bank account ID

header Parameters
Authorization
required
string

Bearer session token

X-Human-Proof
string

AI Audit gate. Present the token's human_proof secret (returned once when the token was minted) to execute this mutation immediately as a human-driven action. Without it (or with an invalid value) the request is NOT executed: it is recorded in the AI Audit backlog and returns 202 pending_approval for a human to approve.

Responses

Response samples

Content type
application/json
{
  • "balance_as_of": "2019-08-24T14:15:22Z",
  • "bank_name": "string",
  • "bic": "string",
  • "created_at": "2019-08-24T14:15:22Z",
  • "currency_code": "string",
  • "current_balance_minor": 0,
  • "iban": "string",
  • "id": "string",
  • "intermediary_bic": "string",
  • "is_main": true,
  • "name": "string",
  • "updated_at": "2019-08-24T14:15:22Z"
}

List a bank account's balance snapshots (newest first)

path Parameters
id
required
string

Bank account ID

header Parameters
Authorization
required
string

Bearer session token

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Record a balance snapshot for a bank account

path Parameters
id
required
string

Bank account ID

header Parameters
Authorization
required
string

Bearer session token

X-Human-Proof
string

AI Audit gate. Present the token's human_proof secret (returned once when the token was minted) to execute this mutation immediately as a human-driven action. Without it (or with an invalid value) the request is NOT executed: it is recorded in the AI Audit backlog and returns 202 pending_approval for a human to approve.

Request Body schema: application/json
required
as_of_date
string or null <date-time>

Date the balance was observed (RFC 3339). Defaults to now when omitted.

balance_minor
required
integer <int64>

The balance in the account's currency (minor units, signed).

note
string or null

Optional note (e.g. "opening balance").

Responses

Request samples

Content type
application/json
{
  • "as_of_date": "2019-08-24T14:15:22Z",
  • "balance_minor": 0,
  • "note": "string"
}

Response samples

Content type
application/json
{
  • "as_of_date": "2019-08-24T14:15:22Z",
  • "balance_minor": 0,
  • "bank_account_id": "string",
  • "created_at": "2019-08-24T14:15:22Z",
  • "id": "string",
  • "note": "string"
}

Delete a bank account's balance snapshot

path Parameters
id
required
string

Bank account ID

snapshot_id
required
string

Balance snapshot ID

header Parameters
Authorization
required
string

Bearer session token

X-Human-Proof
string

AI Audit gate. Present the token's human_proof secret (returned once when the token was minted) to execute this mutation immediately as a human-driven action. Without it (or with an invalid value) the request is NOT executed: it is recorded in the AI Audit backlog and returns 202 pending_approval for a human to approve.

Responses

Reports

Background-generated PDF business reports.

Delete several reports for the current company

Takes an ids body (DELETE with a payload). Ids that don't resolve for this company are ignored; the response reports how many were actually deleted.

header Parameters
Authorization
required
string

Bearer session token

X-Human-Proof
string

AI Audit gate. Present the token's human_proof secret (returned once when the token was minted) to execute this mutation immediately as a human-driven action. Without it (or with an invalid value) the request is NOT executed: it is recorded in the AI Audit backlog and returns 202 pending_approval for a human to approve.

Request Body schema: application/json
required
ids
required
Array of strings

Document ids the action applies to.

Responses

Request samples

Content type
application/json
{
  • "ids": [
    ]
}

Response samples

Content type
application/json
{
  • "affected": 0
}

List reports for the current company

header Parameters
Authorization
required
string

Bearer session token

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Request a report for the current company

Returns one [ReportView] per requested locale (one report is generated per locale); a single-locale request yields a one-element list.

header Parameters
Authorization
required
string

Bearer session token

X-Human-Proof
string

AI Audit gate. Present the token's human_proof secret (returned once when the token was minted) to execute this mutation immediately as a human-driven action. Without it (or with an invalid value) the request is NOT executed: it is recorded in the AI Audit backlog and returns 202 pending_approval for a human to approve.

Request Body schema: application/json
required
locales
Array of strings or null

Locale(s) to render the report in (en, es, es_ES, …). One report is generated per locale. Numbers are formatted per region, so the same language in two regions (es_ES vs es_MX) can render differently. Omitted/empty renders a single report in the requesting user's language.

period_end
required
string <date-time>

End of the reporting window (RFC 3339, exclusive).

period_start
required
string <date-time>

Start of the reporting window (RFC 3339, inclusive).

projection_months
integer or null <int32> >= 0

For cash_flow_projection only: how many months to carry the window's pace forward, from 1 to 60. Defaults to 12.

report_type
required
string (ReportType)
Enum: "business_overview" "vat_summary" "profit_loss" "client_revenue" "expense_supplier" "cash_flow_projection"

Which report to generate.

Responses

Request samples

Content type
application/json
{
  • "locales": [
    ],
  • "period_end": "2019-08-24T14:15:22Z",
  • "period_start": "2019-08-24T14:15:22Z",
  • "projection_months": 0,
  • "report_type": "business_overview"
}

Response samples

Content type
application/json
[
  • {
    }
]

Download several report PDFs as a single ZIP

Selects the ids given in ?ids=a,b,c; ids that aren't ready (still pending, failed, unknown, or another company's) are dropped from the archive.

query Parameters
ids
required
string

Comma-separated document ids to bundle, e.g. ids=abc,def.

header Parameters
Authorization
required
string

Bearer session token

Responses

Delete a report for the current company

path Parameters
id
required
string

Report ID

header Parameters
Authorization
required
string

Bearer session token

X-Human-Proof
string

AI Audit gate. Present the token's human_proof secret (returned once when the token was minted) to execute this mutation immediately as a human-driven action. Without it (or with an invalid value) the request is NOT executed: it is recorded in the AI Audit backlog and returns 202 pending_approval for a human to approve.

Responses

Get a single report's status

path Parameters
id
required
string

Report ID

header Parameters
Authorization
required
string

Bearer session token

Responses

Response samples

Content type
application/json
{
  • "completed_at": "2019-08-24T14:15:22Z",
  • "created_at": "2019-08-24T14:15:22Z",
  • "error": "string",
  • "filename": "string",
  • "id": "string",
  • "locale": "string",
  • "period_end": "2019-08-24T14:15:22Z",
  • "period_start": "2019-08-24T14:15:22Z",
  • "projection_months": 0,
  • "report_type": "string",
  • "requested_by": "string",
  • "requested_by_name": "string",
  • "status": "string"
}

Download a report PDF

path Parameters
id
required
string

Report ID

header Parameters
Authorization
required
string

Bearer session token

Responses

AI Audit

Review and approve/reject AI-requested mutations.

List captured AI actions for the company

Optionally filtered by status.

query Parameters
status
string (AuditStatus)
Enum: "pending" "executing" "approved" "rejected" "failed"

Filter by status

header Parameters
Authorization
required
string

Bearer session token

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Approve several pending AI-requested actions at once

Approve several pending AI-requested actions: each original request is replayed and executed. Human-only: the caller must present a valid X-Human-Proof (the API token's human_proof secret); an API-token caller without it is refused with 403.

header Parameters
Authorization
required
string

Bearer session token driving the request

X-Human-Proof
string or null

The API token's human_proof secret (returned once when the token was minted); present it to prove a human is driving this review.

Request Body schema: application/json
required
ids
required
Array of strings

Document ids the action applies to.

Responses

Request samples

Content type
application/json
{
  • "ids": [
    ]
}

Response samples

Content type
application/json
{
  • "affected": 0
}

Reject several pending AI-requested actions at once

Reject several pending AI-requested actions: nothing is executed and each entry is marked rejected. Human-only: the caller must present a valid X-Human-Proof (the API token's human_proof secret); an API-token caller without it is refused with 403.

header Parameters
Authorization
required
string

Bearer session token driving the request

X-Human-Proof
string or null

The API token's human_proof secret (returned once when the token was minted); present it to prove a human is driving this review.

Request Body schema: application/json
required
ids
required
Array of strings

Document ids the action applies to.

Responses

Request samples

Content type
application/json
{
  • "ids": [
    ]
}

Response samples

Content type
application/json
{
  • "affected": 0
}

Get a single captured AI action by id

path Parameters
id
required
string

AI Audit entry ID

header Parameters
Authorization
required
string

Bearer session token

Responses

Response samples

Content type
application/json
{
  • "action": "string",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "errorMessage": "string",
  • "httpMethod": "string",
  • "httpPath": "string",
  • "id": "string",
  • "requestBody": "string",
  • "resourceId": "string",
  • "reviewedAt": "2019-08-24T14:15:22Z",
  • "reviewedBy": "string",
  • "source": "string",
  • "status": "pending"
}

approve-ai-audit-entry

Approve a pending AI-requested action: the original request is replayed and executed. Human-only: the caller must present a valid X-Human-Proof (the API token's human_proof secret); an API-token caller without it is refused with 403.

path Parameters
id
required
string

AI Audit entry ID

header Parameters
Authorization
required
string

Bearer session token driving the request

X-Human-Proof
string or null

The API token's human_proof secret (returned once when the token was minted); present it to prove a human is driving this review.

Responses

Response samples

Content type
application/json
{
  • "action": "string",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "errorMessage": "string",
  • "httpMethod": "string",
  • "httpPath": "string",
  • "id": "string",
  • "requestBody": "string",
  • "resourceId": "string",
  • "reviewedAt": "2019-08-24T14:15:22Z",
  • "reviewedBy": "string",
  • "source": "string",
  • "status": "pending"
}

reject-ai-audit-entry

Reject a pending AI-requested action: nothing is executed and the entry is marked rejected. Human-only: the caller must present a valid X-Human-Proof (the API token's human_proof secret); an API-token caller without it is refused with 403.

path Parameters
id
required
string

AI Audit entry ID

header Parameters
Authorization
required
string

Bearer session token driving the request

X-Human-Proof
string or null

The API token's human_proof secret (returned once when the token was minted); present it to prove a human is driving this review.

Responses

Response samples

Content type
application/json
{
  • "action": "string",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "errorMessage": "string",
  • "httpMethod": "string",
  • "httpPath": "string",
  • "id": "string",
  • "requestBody": "string",
  • "resourceId": "string",
  • "reviewedAt": "2019-08-24T14:15:22Z",
  • "reviewedBy": "string",
  • "source": "string",
  • "status": "pending"
}

VeriFactu

Spanish AEAT authorization (Veri*Factu) status.

Return the current VeriFactu authorization status for the acting company

Always responds 200: the request authenticated and succeeded, so "nothing signed yet" is a valid state, not an error. When no authorization row exists, the body carries status: "not_granted" (a first-class status alongside pending/active/revoked), never a 404 (which would read as "this endpoint does not exist") or a 403 (which would imply the caller isn't allowed here; it is).

Also answers a company that has not completed setup yet, which the registration flow reads to resume where the customer left off.

header Parameters
Authorization
required
string

Bearer session token

Responses

Response samples

Content type
application/json
{
  • "colaboracion_social": { },
  • "company_id": "string",
  • "fiscal_id": "string",
  • "granted_at": "2019-08-24T14:15:22Z",
  • "status": "NotGranted",
  • "outstanding": { },
  • "representativeFiscalId": "string",
  • "representativeName": "string"
}

Ask for the otorgamiento for the acting company to be prepared

Records what the form declared and queues the work. The document is the AEAT's normalized model filled with the parties' data and then signed with our own certificate, and it is prepared in the background, so this returns an authorization whose generationStatus is pending; poll the authorization and download the document once it says ready.

Asking authorizes nothing: the authorization stays pending until the signed document comes back and the certificate behind it holds up. Calling this again replaces the document and discards any signature held against the previous one, which would be a signature over bytes we no longer serve.

header Parameters
Authorization
required
string

Bearer session token

X-Human-Proof
string

AI Audit gate. Present the token's human_proof secret (returned once when the token was minted) to execute this mutation immediately as a human-driven action. Without it (or with an invalid value) the request is NOT executed: it is recorded in the AI Audit backlog and returns 202 pending_approval for a human to approve.

Request Body schema: application/json
required
companyCity
required
string
companyNumber
required
string
companyStreet
required
string
place
required
string

Place the document states it was signed in.

signerCapacity
required
string (SignerCapacity)
Enum: "self" "Representative"

self for a natural person authorizing in their own name, representative for an entity signed for by its legal representative. Which one applies follows from the company's legal form rather than being a choice, and a request declaring the other is refused.

signerCity
required
string
signerFiscalId
required
string

Fiscal id that person signs under. The signing certificate must carry this same one, and for a self-employed obligado it is the company's own.

signerName
required
string

Full name of the person who will sign.

signerNumber
required
string
signerStreet
required
string

Responses

Request samples

Content type
application/json
{
  • "companyCity": "string",
  • "companyNumber": "string",
  • "companyStreet": "string",
  • "place": "string",
  • "signerCapacity": "self",
  • "signerCity": "string",
  • "signerFiscalId": "string",
  • "signerName": "string",
  • "signerNumber": "string",
  • "signerStreet": "string"
}

Response samples

Content type
application/json
{
  • "colaboracion_social": { },
  • "company_id": "string",
  • "fiscal_id": "string",
  • "granted_at": "2019-08-24T14:15:22Z",
  • "status": "NotGranted",
  • "outstanding": { },
  • "representativeFiscalId": "string",
  • "representativeName": "string"
}

Download the prepared otorgamiento

Returns exactly the bytes whose digest was recorded, which is what the customer must sign: signing a rebuilt document would produce one that no longer matches what we hold.

The document is prepared in the background, so this is a 409 until the authorization's generationStatus says ready, and a 409 again if it could not be prepared, in which case the remedy is to submit the details once more.

header Parameters
Authorization
required
string

Bearer session token

Responses

Download the signed otorgamiento

Returns the signed document held for this company, exactly as it was uploaded and accepted. A 404 until one has been accepted.

header Parameters
Authorization
required
string

Bearer session token

Responses

Upload the signed otorgamiento

The body is the signed PDF. It is verified before anything is stored: it must be the document we generated (its unsigned bytes matching what we rendered), the signature must cover all of it and verify, and the certificate must carry the NIF the form declared, naming the company for a sociedad.

A document that does not verify is refused and stored nowhere, with the ground in the error: an upload nobody could check has no business sitting in the evidence bucket looking like evidence. A document that does verify is stored and the authorization stays pending while the certificate chain is checked in the background, which GET /v1/verifactu/authorization reports as outstanding (ChainValidation). That check normally answers within seconds: the authorization becomes active, or the certificate turns out not to be one we trust (TrustedCertificate, with the ground in verification_reason) and the document has to be signed again. An authorization already in force refuses a new upload.

An accepted upload is recorded with the moment it arrived and the address it came from, as part of the evidence held for this authorization.

header Parameters
Authorization
required
string

Bearer session token

X-Human-Proof
string

AI Audit gate. Present the token's human_proof secret (returned once when the token was minted) to execute this mutation immediately as a human-driven action. Without it (or with an invalid value) the request is NOT executed: it is recorded in the AI Audit backlog and returns 202 pending_approval for a human to approve.

Request Body schema: application/pdf
required
Array
integer <int32> >= 0

Responses

Response samples

Content type
application/json
{
  • "colaboracion_social": { },
  • "company_id": "string",
  • "fiscal_id": "string",
  • "granted_at": "2019-08-24T14:15:22Z",
  • "status": "NotGranted",
  • "outstanding": { },
  • "representativeFiscalId": "string",
  • "representativeName": "string"
}

Return how VeriFactu transmission to the AEAT stands for the acting company

While transmission is interrupted, and until every record the interruption affected has been answered, notice is true and the app shows a notice with pendingRecords (Order HAC/1177/2024 art. 16.4). Records sent after an interruption are flagged to the AEAT as affected by it. A company outside VeriFactu, or one with nothing pending, answers normal.

header Parameters
Authorization
required
string

Bearer session token

Responses

Response samples

Content type
application/json
{
  • "interruptedSince": "2019-08-24T14:15:22Z",
  • "notice": true,
  • "pendingRecords": 0,
  • "state": "normal"
}

User

Your user profile, and the ways you can sign in to it.

Update the signed-in user's own profile

The profile belongs to the account, not to a company, so this requires a signed-in session: an API token is refused with 403.

header Parameters
Authorization
required
string

Bearer session token

X-Human-Proof
string

AI Audit gate. Present the token's human_proof secret (returned once when the token was minted) to execute this mutation immediately as a human-driven action. Without it (or with an invalid value) the request is NOT executed: it is recorded in the AI Audit backlog and returns 202 pending_approval for a human to approve.

Request Body schema: application/json
required
language
required
string

Preferred UI language; empty clears the preference.

Responses

Request samples

Content type
application/json
{
  • "language": "string"
}

Response samples

Content type
application/json
{
  • "accessibleCompanies": [
    ],
  • "company": {
    },
  • "currentDpaId": "string",
  • "currentPrivacyPolicyId": "string",
  • "currentTosId": "string",
  • "dpaAgreed": true,
  • "email": "string",
  • "id": "string",
  • "language": "string",
  • "name": "string",
  • "pendingInvitations": [
    ],
  • "privacyPolicyAgreed": true,
  • "profileImageUrl": "string",
  • "tosAgreed": true
}

Dashboard

Aggregate dashboard data.

Get aggregate figures for the active company's dashboard

header Parameters
Authorization
required
string

Bearer session token

Responses

Response samples

Content type
application/json
{
  • "customer_stats": {
    },
  • "expenses_this_month": [
    ],
  • "expenses_total": [
    ],
  • "invoice_counts": {
    },
  • "monthly_revenue": [
    ],
  • "points_balance_minor": 0,
  • "points_currency": "string",
  • "primary_currency": "string",
  • "revenue_this_month": [
    ],
  • "revenue_total": [
    ],
  • "subscription_tier": "string",
  • "top_customers": [
    ]
}

invitations

Accept a company's invitation

Turns the invitation into a membership with full access to the company. Switch the session into it afterwards with PUT /v1/sessions/current/company. Requires a signed-in session: an API token is refused with 403.

path Parameters
company_id
required
string

Company that sent the invitation

header Parameters
Authorization
required
string

Bearer session token

X-Human-Proof
string

AI Audit gate. Present the token's human_proof secret (returned once when the token was minted) to execute this mutation immediately as a human-driven action. Without it (or with an invalid value) the request is NOT executed: it is recorded in the AI Audit backlog and returns 202 pending_approval for a human to approve.

Responses

Decline a company's invitation

Removes the invitation. The company may send another. Requires a signed-in session: an API token is refused with 403.

path Parameters
company_id
required
string

Company that sent the invitation

header Parameters
Authorization
required
string

Bearer session token

X-Human-Proof
string

AI Audit gate. Present the token's human_proof secret (returned once when the token was minted) to execute this mutation immediately as a human-driven action. Without it (or with an invalid value) the request is NOT executed: it is recorded in the AI Audit backlog and returns 202 pending_approval for a human to approve.

Responses