Where the contract and the API disagreed, they now agree
A check of the published contract against the live API found a dozen differences. A few were fixed in the API, and the rest in the contract.
We replayed the published contract against the live API and wrote down every place where they disagreed. Where the API was wrong, the API changed. The first four highlights are those, and they are the only ones where a response differs from before. Where the document was wrong, the document changed and the server behaves as it always did.
What else changed
logo_urlon a company is an absolute URL.GET /v1/companies/{company_id}returned a storage path for a logo uploaded through the logo endpoint. It now returns the same fetchable URL as the invoice-customization resource and an invoice'sissuer.logo_url.- A number field that receives text answers
400 INVALID_JSON_FORMATwithdetailsfilled in:field,invalid_valueandexpected_format(numberorinteger). It used to come back withdetails: {}. - A deprecated route that rejects an unknown query parameter still sends
DeprecationandSunseton that400, like on any other answer from it. - A property that breaks two rules at once gets one stable message with both reasons, instead of one of the two, picked differently on identical calls.
- Contract corrections, server unchanged:
GET /v1/accounts/{account_id}/companiesis always paginated and always carriespagination. A value outside an enum in a body answers422 VALIDATION_ERRORwithallowed_values, not400.POST …/customerscan answer422 NIF_NOT_IN_CENSUS. A body property the operation does not declare is ignored without a warning. 404and409name what failed. The contract now lists the codes the API already returned, such asINVOICE_NOT_FOUND,CLIENT_NOT_FOUND,CLIENT_DUPLICATEandENDPOINT_NOT_FOUND, in place of a genericNOT_FOUNDorCONFLICTthat it never sent.
Where to go next
A simplified invoice can no longer name an identified recipient
Creating or updating a `SIMPLIFIED` invoice whose recipient has a NIF or an alternative identifier now answers `400 SIMPLIFIED_INVOICE_FORBIDS_IDENTIFIED_RECIPIENT`. Issue it as `STANDARD`.
Export lines take regime 02 on their own
A VAT line exempt under art. 21 or 22 that arrives with `regime_key: "01"` is stored with `"02"`, instead of being refused by AEAT after issue.