# Create Invoice Creates a new invoice, simplified_invoice, invoice_receipt, credit_note or debit_note. ### Creating new clients or items along with the documents This method also allows to create a new client and/or new items in the same request with the following behavior: * If the client name does not exist, a new one is created. * If items do not exist with the given names, new ones will be created. * If item name already exists, the item is updated with the new values. ### Taxes Regarding item taxes, if the tax name is not found, the default tax is applyed to that item. Portuguese accounts should also send the IVA exemption reason if the invoice contains exempt items (IVA 0%). > Note: Simplified Invoices are only available in Portugal. Endpoint: POST /{invoices-type}.json Version: 2.0.0 Security: apiKeyAuth ## Query parameters: - `api_key` (string, required) Your API Key. Example: "YOUR_API_KEY" ## Path parameters: - `invoices-type` (string, required) The type of the invoice document. Enum: "invoices", "invoice_receipts", "simplified_invoices", "credit_notes", "debit_notes" ## Request fields (application/json): - `invoice` (object, required) Invoice Body - `invoice.date` (string, required) dd/mm/yyyy Example: "22/11/2025" - `invoice.due_date` (string, required) dd/mm/yyyy Example: "22/12/2025" - `invoice.reference` (string) Example: "PO-999" - `invoice.observations` (string) Example: "Services rendered" - `invoice.retention` (string) Example: "0" - `invoice.tax_exemption` (string) Example: "M00" - `invoice.sequence_id` (string) Example: "123456" - `invoice.manual_sequence_number` (string) - `invoice.client` (object, required) Client Details. - `invoice.client.name` (string, required) Example: "Client A" - `invoice.client.code` (string, required) Example: "CLI-001" - `invoice.client.email` (string) Example: "client@mail.com" - `invoice.client.address` (string) Example: "Street A" - `invoice.client.city` (string) Example: "Lisbon" - `invoice.client.postal_code` (string) Example: "1000-100" - `invoice.client.fiscal_id` (string) Example: "500999888" - `invoice.client.country` (string) Example: "Portugal" - `invoice.client.website` (string) Example: "www.client-a.com" - `invoice.client.phone` (string) Example: "912345678" - `invoice.client.fax` (string) Example: "212345678" - `invoice.items` (array, required) - `invoice.items.description` (string, required) Example: "IT Services" - `invoice.items.unit_price` (number, required) Example: 50 - `invoice.items.quantity` (number, required) Example: 2 - `invoice.items.unit` (string) Example: "hour" - `invoice.items.discount` (number) - `invoice.items.tax` (object) - `invoice.mb_reference` (string) Enum: "0", "1" - `invoice.owner_invoice_id` (integer) Example: 1049 - `invoice.tax_exemption_reason` (string) Example: "M00" - `invoice.currency_code` (string) Example: "USD" - `invoice.rate` (string) Example: "1.10" - `invoice.plugin_id` (string) Example: "plugin_123" - `invoice.global_discount` (object) - `invoice.global_discount.value_type` (string) Enum: "percentage", "absolute" - `invoice.global_discount.value` (number) Example: 10 - `proprietary_uid` (string) Example: "uuid-123" ## Response 201 fields (application/json): - `invoice` (object) - `invoice.id` (integer) Example: 2137287 - `invoice.status` (string) Example: "final" - `invoice.archived` (boolean) - `invoice.type` (string) Example: "Invoice" - `invoice.sequence_number` (string) Example: "6/G" - `invoice.inverted_sequence_number` (string) Example: "G/6" - `invoice.atcud` (string) Example: "ABCD1234-6" - `invoice.sequence_id` (string) Example: "12345" - `invoice.tax_exemption` (string) Example: "M01" - `invoice.date` (string) Example: "04/08/2016" - `invoice.due_date` (string) Example: "19/08/2016" - `invoice.reference` (string) Example: "ref123" - `invoice.observations` (string) Example: "Observations" - `invoice.retention` (string) Example: "0" - `invoice.permalink` (string) Example: "https://www.app.invoicexpress.com/documents/..." - `invoice.saft_hash` (string) Example: "J4ay" - `invoice.sum` (number) Example: 24.39 - `invoice.discount` (number) - `invoice.before_taxes` (number) Example: 24.39 - `invoice.taxes` (number) Example: 5.61 - `invoice.total` (number) Example: 30 - `invoice.currency` (string) Example: "Euro" - `invoice.client` (object) - `invoice.client.name` (string) Example: "John Doe" - `invoice.client.code` (string) Example: "C1" - `invoice.client.country` (string) Example: "Portugal" - `invoice.client.email` (string) Example: "john@example.com" - `invoice.items` (array) - `invoice.items.description` (string) Example: "Big Product" - `invoice.items.unit_price` (number) Example: 100 - `invoice.items.quantity` (number) Example: 1 - `invoice.items.unit` (string) Example: "un" - `invoice.items.tax` (object) - `invoice.items.tax.value` (number) Example: 23 - `invoice.mb_reference` (object) - `invoice.mb_reference.entity` (string) Example: "10611" ## Response 401 fields (application/json): - `errors` (object) - `errors.error` (string) Example: "Invalid API key" ## Response 409 fields (application/json): - `reason` (string) Example: "There's an ongoing document creation with the provided UID UUID41237123189981ddajkls23478y" ## Response 422 fields (application/json): - `errors` (object) - `errors.error` (string) Example: "undefined method `match' for 1:Integer"