Update InvoiceV2 record
Replace an invoice. A posted invoice writes general ledger entries. Those entries debit accounts receivable and credit income or a deferral account. Tax and discounts write their own entries. A draft does not post those entries. The save links a contract when you send contract_id. It links a sales order when you send sales_order_id. This call keeps caller-supplied line tax by default. Set auto_calculate_tax to "required" to calculate and replace line tax on write, or receive 422 when calculation cannot complete. The calculation supports native US sales tax (the DualEntry tax engine) and Avalara Sales Tax, VAT, and GST. Native VAT and GST return 422. Tax uses shipping_address, then billing_address, then the customer saved address. When you send no address, DualEntry copies the customer saved address to billing_address and shipping_address. This call does not send email. Use the send endpoint for that.
Side effects
- If an approval workflow matches this request, DualEntry can set
record_statusback todraft. - If this request posts the invoice and the company files e-invoices in its country, DualEntry checks the e-invoice with the authority and queues the filing. The check can take up to 10 seconds.
Additional validations
- Fails with 422 if the e-invoice filing of the invoice runs or the authority cleared it. An archive gets the same answer. The
e_invoicingkey holds the reason. Correct a cleared invoice with a customer credit. - Fails with 422 if the e-invoice of the posted record has data that the authority refuses. The
e_invoicingkey lists the reasons.
Authorizations
Headers
Optional. A unique value (a UUID works well) identifying this operation. If the request is repeated with the same key, the original response is replayed instead of the operation running again, so a retry cannot create a duplicate record. Results are replayable for 48 hours. Reusing a key with a different request body returns 422.
255Path Parameters
The number attribute of the record.
Body
2Deprecated: send the structured billing_address / shipping_address instead.
Deprecated: send the structured billing_address / shipping_address instead.
PERCENTAGE, FIXED Set to "required" to calculate tax for every line and replace any supplied tax amounts before saving, or return 422 when calculation cannot complete. Omit the field to keep caller-supplied tax. The calculation supports native US sales tax (the DualEntry tax engine) and Avalara Sales Tax, VAT, and GST. Native VAT and GST return 422, because this field does not select a rate. Tax addresses: money-in uses shipping_address, then billing_address, then the customer saved address. Money-out uses ship_from_address and ship_to_address, then the vendor and company saved addresses. When a money-in payload has no address, DualEntry copies the customer saved address to billing_address and shipping_address. A money-out record saves only the ship addresses that the payload sends. Returns 422 when calculation cannot resolve a required address.
required If this customer is intercompany, DualEntry also writes a transaction in the elimination company.
AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLF, CLP, CNY, COP, CRC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JMD, JOD, JPY, KES, KGS, KHR, KMF, KPW, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLL, SOS, SRD, STN, SVC, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, UYU, UZS, VES, VND, VUV, WST, XAF, XAG, XAU, XCD, XDR, XOF, XPD, XPF, XPT, YER, ZAR, ZMW, ZWL If omitted or null, calculated from the company base currency, invoice currency, and date.
draft, posted, archived Schema for payment collection configuration input (matches frontend structure).
Response
OK
Deprecated: send the structured billing_address / shipping_address instead.
Deprecated: send the structured billing_address / shipping_address instead.
Base for record-level tax context; regime discriminates data.
Mirrors TaxResultV2Out (core.taxes.api.taxes)
AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLF, CLP, CNY, COP, CRC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JMD, JOD, JPY, KES, KGS, KHR, KMF, KPW, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLL, SOS, SRD, STN, SVC, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, UYU, UZS, VES, VND, VUV, WST, XAF, XAG, XAU, XCD, XDR, XOF, XPD, XPF, XPT, YER, ZAR, ZMW, ZWL ^(?!^[-+.]*$)[+-]?0*\d*\.?\d{0,16}0*$Total amount of transaction
^(?!^[-+.]*$)[+-]?0*\d*\.?\d{0,2}0*$Amount to be paid
^(?!^[-+.]*$)[+-]?0*\d*\.?\d{0,2}0*$Amount that was already paid by Customer Repayment Applications or Customer Payments
^(?!^[-+.]*$)[+-]?0*\d*\.?\d{0,2}0*$Timestamp of the most recent change that could have affected amount_due. Moves whenever the invoice itself is edited, or whenever a posted Customer Payment or Customer Prepayment Application referencing this invoice is written.
Posting date (GL date) - the date when the transaction is recorded in the general ledger
Transaction date (inception date) - the date when the transaction actually occurred
draft, posted, archived PERCENTAGE, FIXED ^(?!^[-+.]*$)[+-]?0*\d*\.?\d{0,6}0*$Date and time the record was created
Date and time the record was last updated
2Schema for payment collection configuration output.
Schema for audit actor information.
Schema for audit actor information.
Schema for rejector information including rejection reason.
The number of the linked sales order.
The e-invoice filing of the record. Null when DualEntry did not file it. Not in v1.