Update
invoices.update(strid, InvoiceUpdateParams**kwargs) -> InvoiceUpdateResponse
POST/invoices/{id}
Updates an invoice with line item operations
Parameters
id: str
Invoice ID
version: float
The version of the invoice being updated. Must match the current version for the update to succeed.
Returns
Update
from fragment import Fragment
client = Fragment()
invoice = client.invoices.update(
id="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,
)
print(invoice.data){
"data": {
"id": "inv_1234567890",
"created": "2024-01-13T00:00:00Z",
"status": "active",
"version": 1,
"workspaceId": "ws_1234567890",
"lineItems": [
{
"id": "item_1234567890",
"amount": "1000",
"currencyCode": "USD",
"description": "Professional services for January 2026",
"product_id": "prod_1234567890",
"type": "payout",
"user_id": "user_ext_456"
}
],
"modified": "2024-01-13T00:00:00Z"
}
}Returns Examples
{
"data": {
"id": "inv_1234567890",
"created": "2024-01-13T00:00:00Z",
"status": "active",
"version": 1,
"workspaceId": "ws_1234567890",
"lineItems": [
{
"id": "item_1234567890",
"amount": "1000",
"currencyCode": "USD",
"description": "Professional services for January 2026",
"product_id": "prod_1234567890",
"type": "payout",
"user_id": "user_ext_456"
}
],
"modified": "2024-01-13T00:00:00Z"
}
}