# Invoices ## List `invoices.list() -> InvoiceListResponse` **get** `/invoices` Lists all invoices for the workspace ### Returns - `class InvoiceListResponse: …` List of invoices - `data: List[Data]` - `id: str` Unique identifier for the invoice - `created: datetime` ISO 8601 timestamp when the invoice was created - `status: Literal["active"]` The status of the invoice - `"active"` - `version: float` The current version of the invoice. Pass this value when updating to ensure thread safety. - `workspace_id: str` Workspace ID this invoice belongs to - `line_items: Optional[List[DataLineItem]]` List of line items associated with this invoice - `id: str` Unique identifier for the line item - `amount: str` Amount in smallest currency unit (represented as string for bigint) - `currency_code: Literal["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: str` Description of the line item - `product_id: str` ID of the product/catalog item - `type: Literal["payin", "payout"]` The type of the line item - `"payin"` - `"payout"` - `user_id: str` External ID of the user associated with this line item - `modified: Optional[datetime]` ISO 8601 timestamp when the invoice was last modified ### Example ```python from fragment import Fragment client = Fragment() invoices = client.invoices.list() print(invoices.data) ``` ## Create `invoices.create(InvoiceCreateParams**kwargs) -> InvoiceCreateResponse` **post** `/invoices` Creates a new invoice ### Parameters - `invoice_id: str` Unique identifier for the invoice. Make this the canonical ID from your system for the transaction. - `line_items: Iterable[LineItem]` List of line items to create with the invoice - `amount: str` Amount in smallest currency unit (e.g., cents) - `currency_code: Literal["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: str` Description of the line item - `product_id: str` ID of the product/catalog item - `type: Literal["payin", "payout"]` The type of the line item - `"payin"` - `"payout"` - `user_id: str` External ID of the user associated with this line item ### Returns - `class InvoiceCreateResponse: …` - `data: Data` Invoice object - `id: str` Unique identifier for the invoice - `created: datetime` ISO 8601 timestamp when the invoice was created - `status: Literal["active"]` The status of the invoice - `"active"` - `version: float` The current version of the invoice. Pass this value when updating to ensure thread safety. - `workspace_id: str` Workspace ID this invoice belongs to - `line_items: Optional[List[DataLineItem]]` List of line items associated with this invoice - `id: str` Unique identifier for the line item - `amount: str` Amount in smallest currency unit (represented as string for bigint) - `currency_code: Literal["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: str` Description of the line item - `product_id: str` ID of the product/catalog item - `type: Literal["payin", "payout"]` The type of the line item - `"payin"` - `"payout"` - `user_id: str` External ID of the user associated with this line item - `modified: Optional[datetime]` ISO 8601 timestamp when the invoice was last modified ### Example ```python from fragment import Fragment client = Fragment() invoice = client.invoices.create( invoice_id="invoice_2024_001", line_items=[{ "amount": "1000", "currency_code": "USD", "description": "Professional services for January 2026", "product_id": "prod_1234567890", "type": "payout", "user_id": "user_ext_456", }], ) print(invoice.data) ``` ## Retrieve `invoices.retrieve(strid) -> InvoiceRetrieveResponse` **get** `/invoices/{id}` Gets an invoice by ID with balance details ### Parameters - `id: str` Invoice ID ### Returns - `class InvoiceRetrieveResponse: …` - `data: Data` Invoice with balance details - `id: str` Unique identifier for the invoice - `balances: List[DataBalance]` Invoice-level balances by currency: payins, payouts, and net (payins - payouts) - `currency: str` Currency code - `net: DataBalanceNet` - `actual: str` Actual amount (represented as string) - `expected: str` Expected amount (represented as string) - `remaining: str` Remaining amount (expected - actual, represented as string) - `payins: DataBalancePayins` - `actual: str` Actual amount (represented as string) - `expected: str` Expected amount (represented as string) - `remaining: str` Remaining amount (expected - actual, represented as string) - `payouts: DataBalancePayouts` - `actual: str` Actual amount (represented as string) - `expected: str` Expected amount (represented as string) - `remaining: str` Remaining amount (expected - actual, represented as string) - `created: datetime` ISO 8601 timestamp when the invoice was created - `status: Literal["active"]` The status of the invoice - `"active"` - `users: List[DataUser]` Users/parties involved in the invoice - `id: str` User/party ID - `balances: List[DataUserBalance]` Per-currency balance breakdown for this user - `currency: str` Currency code - `net: DataUserBalanceNet` - `actual: str` Actual amount (represented as string) - `expected: str` Expected amount (represented as string) - `remaining: str` Remaining amount (expected - actual, represented as string) - `payins: DataUserBalancePayins` - `actual: str` Actual amount (represented as string) - `expected: str` Expected amount (represented as string) - `remaining: str` Remaining amount (expected - actual, represented as string) - `payouts: DataUserBalancePayouts` - `actual: str` Actual amount (represented as string) - `expected: str` Expected amount (represented as string) - `remaining: str` Remaining amount (expected - actual, represented as string) - `version: float` The current version of the invoice. Pass this value when updating to ensure thread safety. - `workspace_id: str` Workspace ID this invoice belongs to - `line_items: Optional[List[DataLineItem]]` List of line items associated with this invoice - `id: str` Unique identifier for the line item - `amount: str` Amount in smallest currency unit (represented as string for bigint) - `currency_code: Literal["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: str` Description of the line item - `product_id: str` ID of the product/catalog item - `type: Literal["payin", "payout"]` The type of the line item - `"payin"` - `"payout"` - `user_id: str` External ID of the user associated with this line item - `modified: Optional[datetime]` ISO 8601 timestamp when the invoice was last modified ### Example ```python from fragment import Fragment client = Fragment() invoice = client.invoices.retrieve( "inv_1234567890", ) print(invoice.data) ``` ## Update `invoices.update(strid, InvoiceUpdateParams**kwargs) -> InvoiceUpdateResponse` **post** `/invoices/{id}` Updates an invoice with line item operations ### Parameters - `id: str` Invoice ID - `line_items_update: Iterable[LineItemsUpdate]` List of line item operations to apply to the invoice - `class LineItemsUpdateAddLineItemOperation: …` Operation to add a new line item to an invoice - `amount: str` Amount in smallest currency unit (e.g., cents) - `currency_code: Literal["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: str` Description of the line item - `op: Literal["add"]` Operation type - add a new line item - `"add"` - `product_id: str` ID of the product/catalog item - `type: Literal["payin", "payout"]` The type of the line item - `"payin"` - `"payout"` - `user_id: str` External ID of the user associated with this line item - `class LineItemsUpdateUpdateLineItemOperation: …` Operation to update an existing line item amount - `id: str` ID of the line item to update - `amount: str` New amount in smallest currency unit - `op: Literal["update"]` Operation type - update an existing line item - `"update"` - `class LineItemsUpdateDeleteLineItemOperation: …` Operation to delete a line item from an invoice - `id: str` ID of the line item to delete - `op: Literal["delete"]` Operation type - delete an existing line item - `"delete"` - `version: float` The version of the invoice being updated. Must match the current version for the update to succeed. ### Returns - `class InvoiceUpdateResponse: …` - `data: Data` Invoice object - `id: str` Unique identifier for the invoice - `created: datetime` ISO 8601 timestamp when the invoice was created - `status: Literal["active"]` The status of the invoice - `"active"` - `version: float` The current version of the invoice. Pass this value when updating to ensure thread safety. - `workspace_id: str` Workspace ID this invoice belongs to - `line_items: Optional[List[DataLineItem]]` List of line items associated with this invoice - `id: str` Unique identifier for the line item - `amount: str` Amount in smallest currency unit (represented as string for bigint) - `currency_code: Literal["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: str` Description of the line item - `product_id: str` ID of the product/catalog item - `type: Literal["payin", "payout"]` The type of the line item - `"payin"` - `"payout"` - `user_id: str` External ID of the user associated with this line item - `modified: Optional[datetime]` ISO 8601 timestamp when the invoice was last modified ### Example ```python 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) ``` ## List History `invoices.list_history(strid) -> InvoiceListHistoryResponse` **get** `/invoices/{id}/history` Gets the version history of an invoice ### Parameters - `id: str` Invoice ID ### Returns - `class InvoiceListHistoryResponse: …` Version history of an invoice - `data: List[Data]` - `id: str` Unique identifier for the invoice - `created: datetime` ISO 8601 timestamp when the invoice was created - `status: Literal["active"]` The status of the invoice - `"active"` - `version: float` Version number of this invoice snapshot - `workspace_id: str` Workspace ID this invoice belongs to - `diff: Optional[List[DataDiff]]` Cumulative diff of changes applied to the invoice - `class DataDiffAddDiffEntry: …` - `item: DataDiffAddDiffEntryItem` Invoice line item object - `id: str` Unique identifier for the line item - `amount: str` Amount in smallest currency unit (represented as string for bigint) - `currency_code: Literal["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: str` Description of the line item - `product_id: str` ID of the product/catalog item - `type: Literal["payin", "payout"]` The type of the line item - `"payin"` - `"payout"` - `user_id: str` External ID of the user associated with this line item - `op: Literal["add"]` A line item was added - `"add"` - `class DataDiffUpdateDiffEntry: …` - `id: str` ID of the updated line item - `new_amount: str` New amount after the update - `old_amount: str` Amount before the update - `op: Literal["update"]` A line item was updated - `"update"` - `class DataDiffDeleteDiffEntry: …` - `item: DataDiffDeleteDiffEntryItem` Invoice line item object - `id: str` Unique identifier for the line item - `amount: str` Amount in smallest currency unit (represented as string for bigint) - `currency_code: Literal["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: str` Description of the line item - `product_id: str` ID of the product/catalog item - `type: Literal["payin", "payout"]` The type of the line item - `"payin"` - `"payout"` - `user_id: str` External ID of the user associated with this line item - `op: Literal["delete"]` A line item was deleted - `"delete"` - `line_items: Optional[List[DataLineItem]]` List of line items associated with this invoice - `id: str` Unique identifier for the line item - `amount: str` Amount in smallest currency unit (represented as string for bigint) - `currency_code: Literal["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: str` Description of the line item - `product_id: str` ID of the product/catalog item - `type: Literal["payin", "payout"]` The type of the line item - `"payin"` - `"payout"` - `user_id: str` External ID of the user associated with this line item - `modified: Optional[datetime]` ISO 8601 timestamp when the invoice was last modified ### Example ```python from fragment import Fragment client = Fragment() response = client.invoices.list_history( "inv_1234567890", ) print(response.data) ```