You can create an invoice directly from a transaction created with Create a transaction/tax calculation, or from a refund created with Create a refund. Brinta builds the invoice from the stored transaction or refund: supplier, buyer, items, taxes, currency, exchange rate and payment method all come from it, so you don't send them again.
The transaction or refund needs to be in "pending" status.
Once the invoice is created, you can Update a transaction or Update a refund with the invoice information.
Endpoint
POST https://api.brinta.com/invoices
This is the same endpoint as Create an invoice, called with a different body.
Request body
| Parameter | Type | Required | Description |
|---|---|---|---|
transaction_id | String | Conditional | Id of the transaction to invoice. The transaction must be in "pending" status. Send this or refund_id. |
refund_id | String | Conditional | Id of the refund to invoice. The refund must be in "pending" status. Send this or transaction_id. |
document_type | String | Optional | Type of the invoice document, e.g. invoice or services invoice. See possible values in Invoice document types. |
e_invoice | Boolean | Optional | Whether the invoice is processed electronically through the tax authority. Defaults to true. |
invoice_date | String | Optional | Date of the invoice. Defaults to the creation date. |
invoice_due_date | String | Optional | Due date of the invoice. Format: YYYY-MM-DD. |
additional_info | String | Optional | Additional information printed on the invoice. |
buyer | Object | Optional | Buyer of the invoice, with the same shape as in Create an invoice. Replaces the buyer stored on the transaction. |
items | Array | Optional | Changes to the name or description of the transaction items. Each entry has the id of the transaction item and the new name and/or description. Amounts and taxes always come from the transaction. |
origin_company_id | String | Optional | Company id on Brinta's system of the supplier, when it is different from the company holder of the token. |
origin_company_external_id | String | Optional | Company id on the client's system of the supplier, when it is different from the company holder of the token. |
The invoice type is set for you:
- A transaction creates a
debitinvoice. - A refund creates a
creditinvoice.
Send only one oftransaction_idorrefund_idA body with both is rejected with a
400. Don't sendinvoice_typeeither: together withcurrency,document_typeandbuyerit makes the request a regular invoice, and it is rejected. Fields not listed above, such ascurrency,supplier_company_idorcategory, are ignored: they come from the transaction.
Examples
Invoice from a transaction (Mexico)
{
"transaction_id": "e3e83083-9572-4697-bc19-07c9dafe1cec",
"document_type": "invoice",
"e_invoice": true
}Services invoice from a transaction (Brazil)
{
"transaction_id": "653c9a54-d56a-4824-9458-1fecc3f0e97b",
"document_type": "services invoice",
"e_invoice": true,
"invoice_date": "2026-10-01",
"invoice_due_date": "2026-10-31",
"additional_info": "Service provided in October 2026."
}Invoice from a transaction, changing the buyer and an item name
{
"transaction_id": "e3e83083-9572-4697-bc19-07c9dafe1cec",
"document_type": "invoice",
"e_invoice": true,
"buyer": {
"company": {
"legal_name": "BRINTA DEMO TEST SA DE CV",
"type": "business",
"email": "[email protected]",
"address": {
"postal_code": "06500",
"state": "MX-CMX",
"country": "MX"
},
"tax_registrations": [
{
"number": "BDT030917C22",
"type": "RFC",
"level": "country",
"location": "MX"
}
]
}
},
"items": [
{
"id": 1,
"name": "Monthly subscription - October 2026",
"description": "Premium plan"
}
]
}Credit invoice from a refund, for a child company
{
"refund_id": "7c718fe1-afeb-4482-bf09-82de8fce342d",
"e_invoice": true,
"origin_company_external_id": "CLI-98765",
"additional_info": "Refund of order 4569652912."
}Response
201 Created, with the created invoice. The response has the same shape as Create an invoice. Use its id to Get an invoice and follow its status.
