Update Invoice record (partial) (v1)
Change only the fields you send.
contract_id or sales_order_id, DualEntry links that contract or sales order.
When you create an invoice and send neither billing_address nor shipping_address, DualEntry copies the address saved on the customer to both fields.
The tax on each line stays as you send it. Set auto_calculate_tax to required and DualEntry calculates the tax and replaces it before saving the invoice.
The calculation covers native US sales tax using DualEntry’s tax engine. It also covers Avalara US sales tax, VAT, and GST. If the result is DualEntry’s own VAT or GST, the request fails with 422. A calculation that cannot finish also fails with 422.
DualEntry reads shipping_address, then billing_address, then the address saved on the customer. On an update, the calculation also copies the customer’s saved address to both fields when you send neither address.
To email the invoice, call the send endpoint. To download the PDF, call the pdf endpoint.
Side effects
- If an approval workflow matches this request, DualEntry can set
record_statusback todraft. - If the invoice has a tracked inventory item, DualEntry reduces stock at the invoice
location_idand posts cost-of-goods-sold entries to the general ledger. If the invoice has asales_order_idor isarchived, DualEntry skips the stock reduction and the cost-of-goods-sold entries. - 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.
- Fails with
422if the e-invoice filing of the invoice runs or the authority cleared it. An archive gets the same answer. Thee_invoicingkey holds the reason. Correct a cleared invoice with a customer credit. - Fails with
422if the e-invoice of the posted record has data that the authority refuses. Thee_invoicingkey lists the reasons. - Fails with
422oninstallmentswhen the amounts do not add up to the record total, when the term is not an installment term, or when the request changes a paid or partially paid installment. - Fails with
422if you set an inactive, archived, or draft customer or vendor, or an inactive company. - Fails with
422if you set the customer or vendor that stands for the record’s own company as a party. - A reference that the record or its linked source record already holds passes these checks.
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.
255Body
Partial update payload for PATCH /public/invoices/{number}/.
Every field is optional: send only the fields you want to change. Unset fields are left untouched on the existing record.
Updates allowed under the same constraints as PUT: period locks,
payment-applied restrictions, and approval-workflow rules apply.
Tax point date for VAT and GST.
When the saved record uses a VAT or GST tax regime and you omit this field, DualEntry sets it to transaction_date, or to date when there is no transaction_date.
Recurring templates store the value you send. Each generated record that uses VAT or GST and has no supply date gets that default on save.
On PATCH, an omitted field keeps the stored value. Send supply_date again when you change date or transaction_date.
Configures how to handle automatic tax calculations.
If auto_calculate_tax is unset, the tax you send on each line is stored. Set it to required to have DualEntry calculate the tax, replacing the tax on every line before it saves the record.
The calculation covers native US sales tax using DualEntry's tax engine. It also covers Avalara US sales tax, VAT, and GST.
- For native VAT and GST, leave this field unset and send the rate and the tax on each line. Set it to
requiredwhen a tax provider returns the tax. - The request fails with
422when the result is DualEntry's own VAT or GST, when the calculation cannot finish, or when a required address is still missing. - When the record has a customer, DualEntry reads
shipping_address, thenbilling_address, then the address saved on the customer. - If you send neither address, DualEntry copies the customer's saved address to
billing_addressandshipping_address. - When the record has a vendor, DualEntry reads
ship_from_addressandship_to_address, then the addresses saved on the vendor and the company. - DualEntry stores only the ship addresses you sent.
required 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 Installment schedule of the record. Send rows to store a custom schedule; the record needs an installment term, and the amounts must add up to the record total. Paid and partially paid rows must keep their position, due date, and amount. Send [] to store no rows; that is valid only when the term is not an installment term.
Omit this field, or send null, to use the schedule of the installment term. A create or PUT without rows rebuilds the schedule from the term, so it replaces a custom schedule. A PATCH without rows keeps the stored schedule while the term, date, and transaction_date stay the same and the rows still add up to the record total; otherwise it rebuilds the schedule from the term too. When some installments are already paid, a rebuild keeps the paid rows and spreads the rest of the total over the unpaid rows.
Who arranges the transport of the physical goods. Only Avalara reads this value, as the Transport parameter of a VAT or GST transaction. Use none when there is no transport, for example for services or for goods that the buyer collects at the seller. Send null when you do not specify the party. Avalara then treats the seller as the party for goods.
none, seller, buyer, third_party_for_seller, third_party_for_buyer Response
OK
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 Who arranges the transport of the physical goods. Only Avalara reads this value, as the Transport parameter of a VAT or GST transaction. Use none when there is no transport, for example for services or for goods that the buyer collects at the seller. Send null when you do not specify the party. Avalara then treats the seller as the party for goods.
none, seller, buyer, third_party_for_seller, third_party_for_buyer