Create invoice

View as Markdown
## Create invoice Creates an **invoice** — a payment request of type `INVOICE`. An invoice is a bill you issue to a customer (line items, quantity, sales tax, issue/due dates, PO number, memo). When the customer decides to pay it, the API generates a **checkout invoice** for the amount. The record is stored as a `PaymentRequests` row with `Type = INVOICE`; fields beyond the shared base are kept in the request's JSON `Data` blob and returned via the presenter. The store is resolved from the API key (`user.store_id`); you do not pass a store id. ### Authentication - Merchant API key in `x-api-key` (alias `x-account-api-key`). - Requires scope `Merchant.payment_link.create`. - Optionally scope with `x-application-account-id` (alias `x-account-id`) or the `application_account_id` / `account_id` query param. ### Body (application/json) Required (shared base): `amount`, `currency`, `title`, `frecuency` (`ONE_TIME` | `MULTIPLE` | `RECURRING`; `frecuencyData` JSON string required when `RECURRING`). Invoice-specific (all optional): `customerId` (the billed customer), `invoiceNumber`, `invoiceDate`, `dueDate`, `salesTax`, `quantity` (min 1, when there is no itemized list), `items[]` (`{ productId, itemName, quantity, price }` — all four are required inside each item), `repeat`, `poNumber`, `memo`. `appId` optionally links a sale terminal (app). Returns the created invoice (BillingInvoiceResponseDto). --- **Notas:** Handler: billingInvoicesService.create. Type-agnostic operations (find, pay, activate, archive, complete, delete) use the shared /v1/payment-requests routes. Not to be confused with /v1/invoice (checkout invoices).

Authentication

x-api-keystring
API Key authentication via header

Headers

x-application-account-idstringOptional

Scope the request to a specific store / account instead of the one resolved from the API key. Aliases: the x-account-id header, or the application_account_id / account_id query parameter.

Request

This endpoint expects an object.
amountdoubleRequired
currencystringRequired
titlestringRequired
frecuencystringRequired

ONE_TIME | MULTIPLE | RECURRING. frecuencyData (JSON string) becomes required when RECURRING.