Skip to main content
PATCH
Update Invoice record (partial)
Other fields stay as they are. Period locks, payments, and approval rules match the full update. 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. When 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_status back to draft.
  • If the invoice has a tracked inventory item, DualEntry reduces stock at the invoice location_id and posts cost-of-goods-sold entries to the general ledger. If the invoice has a sales_order_id or is archived, 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.
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_invoicing key 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_invoicing key lists the reasons.
  • Fails with 422 on installments when 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 422 if you set an inactive, archived, or draft customer or vendor, or an inactive company.
  • Fails with 422 if 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.

Authorizations

X-API-KEY
string
header
required

Headers

Idempotency-Key
string

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.

Maximum string length: 255

Path Parameters

record_number
integer
required

The number attribute of the record.

Body

application/json

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.

custom_fields
Custom Fields · object[] | null
supply_date
string<date> | null

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.

place_of_supply
string | null
Maximum string length: 2
tax_registration_numbers
TaxRegistrationNumbersSnapshot · object | null
tax_metadata
object | null
auto_calculate_tax
enum<string> | null

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 required when a tax provider returns the tax.
  • The request fails with 422 when 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, then billing_address, then the address saved on the customer.
  • If you send neither address, DualEntry copies the customer's saved address to billing_address and shipping_address.
  • When the record has a vendor, DualEntry reads ship_from_address and ship_to_address, then the addresses saved on the vendor and the company.
  • DualEntry stores only the ship addresses you sent.
Available options:
required
memo
string | null
due_date
string<date> | null
company_id
integer | null
customer_id
integer | null

If this customer is intercompany, DualEntry also writes a transaction in the elimination company.

currency_iso_4217_code
enum<string> | null
Available options:
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
exchange_rate
items
PublicInvoiceItemIn · object[] | null
bill_to_address
string | null
deprecated

Deprecated: send the structured billing_address / shipping_address instead.

billing_address
AddressSchemaIn · object | null
ship_to_address
string | null
deprecated

Deprecated: send the structured billing_address / shipping_address instead.

shipping_address
AddressSchemaIn · object | null
sales_order_id
integer | null
location_id
integer | null
project_id
integer | null
record_status
enum<string> | null
Available options:
draft,
posted,
archived
attachments
AttachmentSchemaOut · object[] | null
contracted
boolean
default:false
contract_id
integer | null
term_id
integer | null
reference_number
string
default:""
ar_account_id
integer | null
payment
PaymentSchemaIn · object | null

Schema for payment collection configuration input (matches frontend structure).

installments
RecordInstallmentSchemaIn · object[] | null

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.

date
string<date> | null
transaction_date
string<date> | null
discount_type
enum<string> | null
Available options:
PERCENTAGE,
FIXED
discount_value
discount_strategy
enum<string>
default:spread_across_lines
Available options:
separate_discount_line,
spread_across_lines
discount_item_id
integer | null
transport_arranged_by
enum<string> | null

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.

Available options:
none,
seller,
buyer,
third_party_for_seller,
third_party_for_buyer

Response

OK

bill_to_address
string
required
deprecated

Deprecated: send the structured billing_address / shipping_address instead.

ship_to_address
string
required
deprecated

Deprecated: send the structured billing_address / shipping_address instead.

supply_date
string<date> | null
required
tax
RecordTaxContextOut · object | null
required

Base for record-level tax context; regime discriminates data.

Mirrors TaxResultV2Out (core.taxes.api.taxes)

term_id
integer | null
required
term_name
string
required
transaction_ids
integer[]
required
discount_strategy
enum<string> | null
required
Available options:
separate_discount_line,
spread_across_lines
discount_item_id
integer | null
required
discount_account_id
integer | null
required
internal_id
integer
required
number
integer
required
items
PublicInvoiceItemOut · object[]
required
company_id
integer
required
company_name
string
required
company_currency
string
required
customer_id
integer | null
required
currency_iso_4217_code
enum<string>
required
Available options:
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
exchange_rate
string
required
Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d{0,16}0*$
amount
string
required

Total amount of transaction

Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d{0,2}0*$
amount_due
string
required

Amount to be paid

Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d{0,2}0*$
paid_total
string
required

Amount that was already paid by Customer Repayment Applications or Customer Payments

Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d{0,2}0*$
amount_due_updated_at
string<date-time>
required

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.

memo
string
required
date
string<date>
required

Posting date (GL date) - the date when the transaction is recorded in the general ledger

transaction_date
string<date>
required

Transaction date (inception date) - the date when the transaction actually occurred

due_date
string<date> | null
required
location_id
integer | null
required
record_status
enum<string>
required
Available options:
draft,
posted,
archived
recurring_record_number
integer | null
required
contracted
boolean
required
ar_account_id
integer | null
required
discount_type
enum<string> | null
required
Available options:
PERCENTAGE,
FIXED
discount_value
string | null
required
Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d{0,6}0*$
reference_number
string
required
tax_total
string
required

Sum of line-item tax amounts, net of discount-line tax.

Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d{0,2}0*$
created_at
string<date-time>
required

Date and time the record was created

updated_at
string<date-time>
required

Date and time the record was last updated

billing_address
AddressSchemaOut · object | null
shipping_address
AddressSchemaOut · object | null
custom_fields
CustomFieldValuePairOutputSchema · object[]
place_of_supply
string | null
Maximum string length: 2
tax_registration_numbers
TaxRegistrationNumbersSnapshot · object | null
tax_metadata
object | null
integration_remote_records
IntegrationRemoteRecordSchemaOut · object[]
customer_name
string | null
attachments
PublicAttachmentSchemaOut · object[]
payment
PaymentSchemaOut · object | null

Schema for payment collection configuration output.

bank_match_status
string | null
reconciliation_status
string | null
created_by
AuditActorSchemaOut · object | null

Schema for audit actor information.

updated_by
AuditActorSchemaOut · object | null

Schema for audit actor information.

approval_status
string | null
next_approvers
ApproverDictSchema · object[] | null
rejected_by
RejectedBySchema · object | null

Rejector info from pre-serialized dict, with the reason of that rejection.

email_status
enum<string>
default:not_sent

The latest email send for this record: not_sent, sent, or failed.

Available options:
not_sent,
sent,
failed
last_emailed_at
string<date-time> | null

When the latest email send was attempted.

early_payment_discount_date
string<date> | null

Last date to take the early-payment discount. Empty when the record has no early-payment term.

early_payment_discount_amount
string | null

Discount amount in the record currency. Empty when the record has no early-payment term.

Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d{0,2}0*$
code
string | null
sales_order_number
integer | null

The number of the linked sales order.

project_id
integer | null
contract_id
integer | null
transport_arranged_by
enum<string> | null

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.

Available options:
none,
seller,
buyer,
third_party_for_seller,
third_party_for_buyer
installments
RecordInstallmentSchemaOut · object[]

Installment schedule of the record, ordered by position. Empty when the term is not an installment term. amount_paid fills the earliest installment first.