Skip to content
Documentation
Get started

Payments

Create the canonical invoice for a captured payment

POST
/v1/payments/{paymentId}/invoice
curl --request POST \
--url https://api.timbro.do/v1/payments/example/invoice \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'idempotency-key: example' \
--data '{ "additionalInformation": { "referenceNumber": "example", "shipment": { "containerNumber": "example", "deliveryNoteNumber": "example", "driver": "example", "grossWeight": "example", "grossWeightUnit": "example", "netWeight": "example", "netWeightUnit": "example", "packageCount": "example", "packageUnit": "example", "packageVolume": "example", "route": "example", "shipmentDate": "example", "shipmentNumber": "example", "transportDocumentNumber": "example", "transportZone": "example", "vehicleFiche": "example", "vehiclePlate": "example", "volumeUnit": "example" } }, "buyer": { "address": "example", "deliveryPhone": "example", "email": "example", "legalName": "example", "taxId": "example" }, "currency": "DOP", "exchangeRate": { "rate": "example" }, "expectedTotals": { "fiscal": { "net": "example", "tax": "example", "total": "example" }, "net": "example", "nonBillable": "example", "tax": "example", "total": "example" }, "incomeType": "01", "invoiceReference": "example", "items": [ { "additionalDescription": "example", "adjustments": { "discounts": [ { "amount": "example", "kind": "fixed_amount" } ], "surcharges": [ { "amount": "example", "kind": "fixed_amount" } ] }, "description": "example", "id": "example", "itemCodes": [ { "code": "example", "typeCode": "example" } ], "kind": "good", "legalTip": true, "quantity": "example", "tax": { "included": true, "kind": "itbis_18" }, "unit": "barrel", "unitPrice": "example" } ], "numbering": { "eNcf": "example", "sequenceExpiresOn": "example" }, "paymentTerms": { "allocations": [ { "amount": "example", "method": "cash" } ], "paymentAccount": { "accountNumber": "example", "bankName": "example" }, "type": "immediate" }, "pdfLayout": "a4", "referenceInformation": { "attribution": { "fiscalOperationId": "example", "kind": "internal_operation" }, "fiscalNumber": "example", "issuedOn": "2026-04-15", "modificationCode": "4" }, "source": { "id": "example", "version": "example" }, "type": "E31" }'

Submits the posted Invoice against the captured Payment and returns Timbro’s canonical Invoice resource.

paymentId
required
string
/^payment_[0-9a-hjkmnp-tv-z]{24,}$/

Payment whose invoice is being created.

idempotency-key
required
string
>= 1 characters <= 255 characters /^[\x20-\x7e]+$/

Caller-derived unique key, stable under retry. Required.

Media typeapplication/json
object
buyer
required
object
legalName
required
string
>= 1 characters <= 150 characters /^[^\p{White_Space}](?:[\s\S]*[^\p{White_Space}])?$/
taxId
required
string
/^[0-9]{9}([0-9]{2})?$/
address
null
deliveryPhone
null
email
null
currency
required
string
Allowed values: DOP BRL CAD CHF CHY XDR DKK EUR GBP JPY NOK SCP SEK USD VEF HTG MXN COP
invoiceReference
required

The only field a source-system reference travels in, bounded at 128 characters.

string
>= 1 characters <= 128 characters /^[^\p{White_Space}](?:[\s\S]*[^\p{White_Space}])?$/
items
required
Array<object>
>= 1 items <= 1000 items
object
description
required
string
>= 1 characters <= 80 characters /^[^\p{White_Space}](?:[\s\S]*[^\p{White_Space}])?$/
kind
required

Whether a Source line describes a good or a service.

string
Allowed values: good service
quantity
required
string
/^(?=[0-9.]*[1-9])[0-9]{1,16}(\.[0-9]{1,2})?$/
tax
required
discriminator: kind
object
included
required
boolean
kind
required
string
Allowed values: itbis_18
unit
required

A DGII e-CF unit of measure: a readable lowercase name on the Source and Invoice wire, the official numeric catalog code in fiscal documents.

string
Allowed values: barrel bag jar bundle bottle box cigarette_pack centimetre cylinder set container day dozen bale gallon degree gram bulk hour crate kilogram kilowatt_hour pound litre lot metre square_metre cubic_metre million_btu minute package pair foot piece roll envelope second tank ton tube yard square_yard unit element thousand sack tin display drum ration quintal gross_register_tonnage square_foot passenger inch boat_berth_stay tray hectare millilitre milligram ounce troy_ounce
unitPrice
required
string
/^[0-9]{1,16}(\.[0-9]{1,4})?$/
additionalDescription
null
adjustments
null
id
null
itemCodes
null
legalTip
boolean | null
paymentTerms
required
discriminator: type
object
type
required
string
Allowed values: immediate
allocations
null
paymentAccount
object
accountNumber
null
bankName
null
type
required
string
Allowed values: E31
Optional fields
additionalInformation
null
exchangeRate
null
expectedTotals
null
incomeType
null
numbering
null
pdfLayout
null
referenceInformation
null
source
null

Default Response

Media typeapplication/json
Response fields and codes
discriminator: status
object
acceptedAt
required
string | null format: date-time
additionalInformation
required
null
buyer
required
null
buyerDeliveryReadiness
required
discriminator: status
object
status
required
string
Allowed values: notApplicable
corrections
required
Array<object>
object
affectedDocument
required
object
attribution
required
discriminator: kind
object
invoiceId
required
string format: uuid
kind
required
string
Allowed values: internalOperation
environment
required

DGII execution environment selected before lifecycle admission.

string
Allowed values: sandbox certification production
fiscalNumber
required
string
issuedOn
required
string
issuerTaxId
required
string
createdAt
required
string format: date-time
modificationCode
required
string
reason
required
string
relationshipKind
required

Stable semantic kind for a cross-document fiscal relationship.

string
Allowed values: modification
createdAt
required
string format: date-time
currency
required
string
Allowed values: DOP BRL CAD CHF CHY XDR DKK EUR GBP JPY NOK SCP SEK USD VEF HTG MXN COP
diagnostics
required
Array<object>
<= 20 items
object
code
required
string
message
required
string
path
required
string
environment
required

DGII execution environment selected before lifecycle admission.

string
Allowed values: sandbox certification production
exchangeRate
required
null
files
required
object
pdf
required
discriminator: status
object
status
required
string
Allowed values: notApplicable
xml
required
discriminator: status
object
status
required
string
Allowed values: notApplicable
foreignPayment
required
null
governmentEligibility
required
null
id
required
string format: uuid
invoiceReference
required
string
issuerTaxId
required
string
/^[0-9]{9}([0-9]{2})?$/
items
required
Array<object> | null
object
additionalDescription
required
null
additionalTaxCodes
required
Array<string>
adjustments
required
null
description
required
string
id
required
string
itemCodes
required
Array<object>
object
code
required
string
>= 1 characters <= 35 characters /^(?=.*[^\p{White_Space}])(?!.*[\u0000-\u0008\u000B\u000C\u000E-\u001F\uD800-\uDFFF\uFFFE\uFFFF])[\s\S]+$/
typeCode
required
string
>= 1 characters <= 14 characters /^(?=.*[^\p{White_Space}])(?!.*[\u0000-\u0008\u000B\u000C\u000E-\u001F\uD800-\uDFFF\uFFFE\uFFFF])[\s\S]+$/
kind
required

Whether a Source line describes a good or a service.

string
Allowed values: good service
legalTip
required
boolean
quantity
required
string
/^(?=[0-9.]*[1-9])[0-9]{1,16}(\.[0-9]{1,2})?$/
tax
required
discriminator: kind
object
included
required
boolean
kind
required
string
Allowed values: itbis_18
unit
required

A DGII e-CF unit of measure: a readable lowercase name on the Source and Invoice wire, the official numeric catalog code in fiscal documents.

string
Allowed values: barrel bag jar bundle bottle box cigarette_pack centimetre cylinder set container day dozen bale gallon degree gram bulk hour crate kilogram kilowatt_hour pound litre lot metre square_metre cubic_metre million_btu minute package pair foot piece roll envelope second tank ton tube yard square_yard unit element thousand sack tin display drum ration quintal gross_register_tonnage square_foot passenger inch boat_berth_stay tray hectare millilitre milligram ounce troy_ounce
unitPrice
required
string
/^[0-9]{1,16}(\.[0-9]{1,4})?$/
withholding
required
null
latestEvent
required
null
originalInvoiceId
required
string | null format: uuid
paymentTerms
required
null
referenceInformation
required
null
replacesInvoiceId
required

The predecessor retained when this Invoice replaced a rejected or closed Source operation.

string | null format: uuid
source
required
object
contentSha256
required
string
/^[0-9a-f]{64}$/
id
required
string
version
required
string
status
required
string
Allowed values: rejected
supplier
required
null
totals
required
null
type
required
string
Allowed values: E31 E32 E33 E34 E41 E43 E44 E45 E46 E47
updatedAt
required
string format: date-time
request-id
required
string

Identifies this request. Quote it when you contact support.

Idempotent-Replayed
string
Allowed value: true

true when this response replays the stored result of an earlier request with the same Idempotency-Key.