Creates a new invoice
Parameters
invoice_id: str
Unique identifier for the invoice. Make this the canonical ID from your system for the transaction.
Returns
Create
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){
"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"
}
}