## Update `client.invoices.update(stringid, InvoiceUpdateParamsbody, RequestOptionsoptions?): InvoiceUpdateResponse` **post** `/invoices/{id}` Updates an invoice with line item operations ### Parameters - `id: string` Invoice ID - `body: InvoiceUpdateParams` - `line_items_update: Array` List of line item operations to apply to the invoice - `AddLineItemOperation` Operation to add a new line item to an invoice - `amount: string` Amount in smallest currency unit (e.g., cents) - `currency_code: "ADA" | "BTC" | "DAI" | 176 more` Currency code (ISO 4217 or crypto) - `"ADA"` - `"BTC"` - `"DAI"` - `"ETH"` - `"SOL"` - `"USDC"` - `"USDT"` - `"USDG"` - `"EURC"` - `"CADC"` - `"CADT"` - `"XLM"` - `"UNI"` - `"BCH"` - `"LTC"` - `"AAVE"` - `"LINK"` - `"MATIC"` - `"PTS"` - `"AED"` - `"AFN"` - `"ALL"` - `"AMD"` - `"ANG"` - `"AOA"` - `"ARS"` - `"AUD"` - `"AWG"` - `"AZN"` - `"BAM"` - `"BBD"` - `"BDT"` - `"BGN"` - `"BHD"` - `"BIF"` - `"BMD"` - `"BND"` - `"BOB"` - `"BRL"` - `"BSD"` - `"BTN"` - `"BWP"` - `"BYR"` - `"BZD"` - `"CAD"` - `"CDF"` - `"CHF"` - `"CLP"` - `"CNY"` - `"COP"` - `"CRC"` - `"CUC"` - `"CUP"` - `"CVE"` - `"CZK"` - `"DJF"` - `"DKK"` - `"DOP"` - `"DZD"` - `"EGP"` - `"ERN"` - `"ETB"` - `"EUR"` - `"FJD"` - `"FKP"` - `"GBP"` - `"GEL"` - `"GGP"` - `"GHS"` - `"GIP"` - `"GMD"` - `"GNF"` - `"GTQ"` - `"GYD"` - `"HKD"` - `"HNL"` - `"HRK"` - `"HTG"` - `"HUF"` - `"IDR"` - `"ILS"` - `"IMP"` - `"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"` - `"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"` - `"SPL"` - `"SRD"` - `"SVC"` - `"SYP"` - `"STN"` - `"SZL"` - `"THB"` - `"TJS"` - `"TMT"` - `"TND"` - `"TOP"` - `"TRY"` - `"TTD"` - `"TVD"` - `"TWD"` - `"TZS"` - `"UAH"` - `"UGX"` - `"USD"` - `"UYU"` - `"UZS"` - `"VEF"` - `"VND"` - `"VUV"` - `"WST"` - `"XAF"` - `"XCD"` - `"XOF"` - `"XPF"` - `"YER"` - `"ZAR"` - `"ZMW"` - `"LOGICAL"` - `"CUSTOM"` - `description: string` Description of the line item - `op: "add"` Operation type - add a new line item - `"add"` - `product_id: string` ID of the product/catalog item - `type: "payin" | "payout"` The type of the line item - `"payin"` - `"payout"` - `user_id: string` External ID of the user associated with this line item - `UpdateLineItemOperation` Operation to update an existing line item amount - `id: string` ID of the line item to update - `amount: string` New amount in smallest currency unit - `op: "update"` Operation type - update an existing line item - `"update"` - `DeleteLineItemOperation` Operation to delete a line item from an invoice - `id: string` ID of the line item to delete - `op: "delete"` Operation type - delete an existing line item - `"delete"` - `version: number` The version of the invoice being updated. Must match the current version for the update to succeed. ### Returns - `InvoiceUpdateResponse` - `data: Data` Invoice object - `id: string` Unique identifier for the invoice - `created: string` ISO 8601 timestamp when the invoice was created - `status: "active"` The status of the invoice - `"active"` - `version: number` The current version of the invoice. Pass this value when updating to ensure thread safety. - `workspaceId: string` Workspace ID this invoice belongs to - `lineItems?: Array` List of line items associated with this invoice - `id: string` Unique identifier for the line item - `amount: string` Amount in smallest currency unit (represented as string for bigint) - `currencyCode: "ADA" | "BTC" | "DAI" | 176 more` Currency code (ISO 4217 or crypto) - `"ADA"` - `"BTC"` - `"DAI"` - `"ETH"` - `"SOL"` - `"USDC"` - `"USDT"` - `"USDG"` - `"EURC"` - `"CADC"` - `"CADT"` - `"XLM"` - `"UNI"` - `"BCH"` - `"LTC"` - `"AAVE"` - `"LINK"` - `"MATIC"` - `"PTS"` - `"AED"` - `"AFN"` - `"ALL"` - `"AMD"` - `"ANG"` - `"AOA"` - `"ARS"` - `"AUD"` - `"AWG"` - `"AZN"` - `"BAM"` - `"BBD"` - `"BDT"` - `"BGN"` - `"BHD"` - `"BIF"` - `"BMD"` - `"BND"` - `"BOB"` - `"BRL"` - `"BSD"` - `"BTN"` - `"BWP"` - `"BYR"` - `"BZD"` - `"CAD"` - `"CDF"` - `"CHF"` - `"CLP"` - `"CNY"` - `"COP"` - `"CRC"` - `"CUC"` - `"CUP"` - `"CVE"` - `"CZK"` - `"DJF"` - `"DKK"` - `"DOP"` - `"DZD"` - `"EGP"` - `"ERN"` - `"ETB"` - `"EUR"` - `"FJD"` - `"FKP"` - `"GBP"` - `"GEL"` - `"GGP"` - `"GHS"` - `"GIP"` - `"GMD"` - `"GNF"` - `"GTQ"` - `"GYD"` - `"HKD"` - `"HNL"` - `"HRK"` - `"HTG"` - `"HUF"` - `"IDR"` - `"ILS"` - `"IMP"` - `"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"` - `"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"` - `"SPL"` - `"SRD"` - `"SVC"` - `"SYP"` - `"STN"` - `"SZL"` - `"THB"` - `"TJS"` - `"TMT"` - `"TND"` - `"TOP"` - `"TRY"` - `"TTD"` - `"TVD"` - `"TWD"` - `"TZS"` - `"UAH"` - `"UGX"` - `"USD"` - `"UYU"` - `"UZS"` - `"VEF"` - `"VND"` - `"VUV"` - `"WST"` - `"XAF"` - `"XCD"` - `"XOF"` - `"XPF"` - `"YER"` - `"ZAR"` - `"ZMW"` - `"LOGICAL"` - `"CUSTOM"` - `description: string` Description of the line item - `product_id: string` ID of the product/catalog item - `type: "payin" | "payout"` The type of the line item - `"payin"` - `"payout"` - `user_id: string` External ID of the user associated with this line item - `modified?: string` ISO 8601 timestamp when the invoice was last modified ### Example ```typescript import Fragment from '@fragment-dev/ts-node'; const client = new Fragment(); const invoice = await client.invoices.update('inv_1234567890', { line_items_update: [ { amount: '1000', currency_code: 'USD', description: 'Professional services for January 2026', op: 'add', product_id: 'prod_1234567890', type: 'payout', user_id: 'user_ext_456', }, ], version: 1, }); console.log(invoice.data); ```