Invoices

Update Invoice record (partial)

Changed on

Change only the fields you send. 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.

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. If you send neither address, DualEntry copies the customer's saved address to billing_address and shipping_address.

To email the invoice, call the send endpoint.

Side effects

  • If an approval workflow matches this request, DualEntry can set record_status back to draft.
  • 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.
patch/public/v2/invoices/{record_number}/

Request

  • Base URL: https://api.dualentry.com
  • URL: https://api.dualentry.com/public/v2/invoices/{record_number}/
  • Auth: none declared

Path parameters

record_numberinteger required

The number attribute of the record.

Headers

Idempotency-Keystring

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.

Request body

custom_fieldsobject[] nullable
supply_datestring date nullable
place_of_supplystring nullable
tax_metadataRecordTaxMetadata
auto_calculate_tax'required'
memostring nullable
due_datestring date nullable
company_idinteger nullable
customer_idinteger nullable

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

currency_iso_4217_code'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'
bill_to_addressstring nullable

Deprecated: send the structured billing_address / shipping_address instead.

ship_to_addressstring nullable

Deprecated: send the structured billing_address / shipping_address instead.

sales_order_idinteger nullable
record_status'draft' | 'posted' | 'archived'
contractedboolean
contract_idinteger nullable
term_idinteger nullable
reference_numberstring
ar_account_idinteger nullable
datestring date nullable
transaction_datestring date nullable
discount_type'PERCENTAGE' | 'FIXED'

Response

OK

bill_to_addressstring required

Deprecated: send the structured billing_address / shipping_address instead.

ship_to_addressstring required

Deprecated: send the structured billing_address / shipping_address instead.

supply_datestring date nullable required
place_of_supplystring nullable
tax_metadataRecordTaxMetadata
customer_namestring nullable
term_idinteger nullable required
term_namestring required
transaction_idsinteger[] required
bank_match_statusstring nullable
reconciliation_statusstring nullable
approval_statusstring nullable
internal_idinteger required
numberinteger required
codestring nullable
company_idinteger required
company_namestring required
company_currencystring required
customer_idinteger nullable required
currency_iso_4217_code'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' required
exchange_ratestring required
sales_order_numberinteger nullable

The number of the linked sales order.

amountstring required

Total amount of transaction

amount_duestring required

Amount to be paid

paid_totalstring required

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

amount_due_updated_atstring 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.

memostring required
datestring date required

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

transaction_datestring date required

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

due_datestring date nullable required
record_status'draft' | 'posted' | 'archived' required
recurring_record_numberinteger nullable required
contractedboolean required
contract_idinteger nullable
ar_account_idinteger nullable required
discount_type'PERCENTAGE' | 'FIXED' required
discount_valuestring nullable required
reference_numberstring required
created_atstring date-time required

Date and time the record was created

updated_atstring date-time required

Date and time the record was last updated

Changes

    • info

      added the optional property ///// to the response with the status

    • warning

      added the new kintsugi enum value to the ///// response property for the response status

    • warning

      added the new kintsugi enum value to the ///// response property for the response status

    • info

      added the new optional request property

    • info

      added the optional property to the response with the status