curl --request POST \
--url https://api.rootfi.dev/v4/payments/invoices \
--header 'Content-Type: application/json' \
--header 'api_key: <api-key>' \
--data '
{
"company_id": 123,
"contact_id": "<string>",
"currency_id": "<string>",
"line_items": [
{
"description": "<string>",
"quantity": 123,
"unit_amount": 123,
"item_id": "<string>",
"tax_amount": 123,
"discount_amount": 123
}
],
"document_number": "<string>",
"posted_date": "<string>",
"due_date": "<string>",
"status": "DRAFT",
"memo": "<string>",
"subscription_id": "<string>"
}
'{
"rootfi_id": 157,
"rootfi_created_at": "2024-01-22T05:07:31.465Z",
"rootfi_updated_at": "2024-01-22T05:07:31.000Z",
"rootfi_company_id": 1089,
"platform_id": "123456",
"rootfi_deleted_at": "2023-11-07T05:31:56Z",
"platform_unique_id": "<string>",
"raw_data": {},
"data_hash": "<string>",
"contact_id": "<string>",
"currency_id": "<string>",
"document_number": "<string>",
"posted_date": "<string>",
"due_date": "<string>",
"status": "DRAFT",
"sub_total": 123,
"tax_amount": 123,
"total_discount": 123,
"shipping_amount": 123,
"total_amount": 123,
"amount_paid": 123,
"amount_refunded": 123,
"amount_credited": 123,
"amount_due": 123,
"memo": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"orders": [
{
"rootfi_id": 157,
"rootfi_created_at": "2024-01-22T05:07:31.465Z",
"rootfi_updated_at": "2024-01-22T05:07:31.000Z",
"rootfi_company_id": 1089,
"platform_id": "123456",
"rootfi_deleted_at": "2023-11-07T05:31:56Z",
"platform_unique_id": "<string>",
"raw_data": {},
"data_hash": "<string>",
"contact_id": "<string>",
"currency_id": "<string>",
"status": "PENDING",
"payment_status": "DRAFT",
"total_amount": 123,
"total_discount": 123,
"total_tax": 123,
"created_at": "<string>",
"updated_at": "<string>",
"invoice_id": "<string>",
"invoice_ids": [
"<string>"
],
"line_items": [
{
"rootfi_id": 123,
"item_id": "<string>",
"description": "<string>",
"quantity": 123,
"unit_amount": 123,
"tax_amount": 123,
"discount_amount": 123,
"total_amount": 123
}
],
"transactions": [
{
"rootfi_id": 123,
"platform_id": "<string>",
"type": "PAYMENT",
"amount": 123,
"currency_id": "<string>",
"status": "DRAFT",
"payment_method_type": "CARD",
"gateway": "<string>",
"description": "<string>",
"created_at": "<string>"
}
]
}
],
"subscription_id": "<string>",
"payment_link": "<string>",
"payment_link_expires_at": "<string>",
"line_items": [
{
"rootfi_id": 123,
"item_id": "<string>",
"description": "<string>",
"quantity": 123,
"unit_amount": 123,
"tax_amount": 123,
"discount_amount": 123,
"total_amount": 123
}
],
"transactions": [
{
"rootfi_id": 123,
"platform_id": "<string>",
"type": "PAYMENT",
"amount": 123,
"currency_id": "<string>",
"status": "DRAFT",
"payment_method_type": "CARD",
"gateway": "<string>",
"description": "<string>",
"created_at": "<string>"
}
]
}Create a new invoice in the payment platform.
curl --request POST \
--url https://api.rootfi.dev/v4/payments/invoices \
--header 'Content-Type: application/json' \
--header 'api_key: <api-key>' \
--data '
{
"company_id": 123,
"contact_id": "<string>",
"currency_id": "<string>",
"line_items": [
{
"description": "<string>",
"quantity": 123,
"unit_amount": 123,
"item_id": "<string>",
"tax_amount": 123,
"discount_amount": 123
}
],
"document_number": "<string>",
"posted_date": "<string>",
"due_date": "<string>",
"status": "DRAFT",
"memo": "<string>",
"subscription_id": "<string>"
}
'{
"rootfi_id": 157,
"rootfi_created_at": "2024-01-22T05:07:31.465Z",
"rootfi_updated_at": "2024-01-22T05:07:31.000Z",
"rootfi_company_id": 1089,
"platform_id": "123456",
"rootfi_deleted_at": "2023-11-07T05:31:56Z",
"platform_unique_id": "<string>",
"raw_data": {},
"data_hash": "<string>",
"contact_id": "<string>",
"currency_id": "<string>",
"document_number": "<string>",
"posted_date": "<string>",
"due_date": "<string>",
"status": "DRAFT",
"sub_total": 123,
"tax_amount": 123,
"total_discount": 123,
"shipping_amount": 123,
"total_amount": 123,
"amount_paid": 123,
"amount_refunded": 123,
"amount_credited": 123,
"amount_due": 123,
"memo": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"orders": [
{
"rootfi_id": 157,
"rootfi_created_at": "2024-01-22T05:07:31.465Z",
"rootfi_updated_at": "2024-01-22T05:07:31.000Z",
"rootfi_company_id": 1089,
"platform_id": "123456",
"rootfi_deleted_at": "2023-11-07T05:31:56Z",
"platform_unique_id": "<string>",
"raw_data": {},
"data_hash": "<string>",
"contact_id": "<string>",
"currency_id": "<string>",
"status": "PENDING",
"payment_status": "DRAFT",
"total_amount": 123,
"total_discount": 123,
"total_tax": 123,
"created_at": "<string>",
"updated_at": "<string>",
"invoice_id": "<string>",
"invoice_ids": [
"<string>"
],
"line_items": [
{
"rootfi_id": 123,
"item_id": "<string>",
"description": "<string>",
"quantity": 123,
"unit_amount": 123,
"tax_amount": 123,
"discount_amount": 123,
"total_amount": 123
}
],
"transactions": [
{
"rootfi_id": 123,
"platform_id": "<string>",
"type": "PAYMENT",
"amount": 123,
"currency_id": "<string>",
"status": "DRAFT",
"payment_method_type": "CARD",
"gateway": "<string>",
"description": "<string>",
"created_at": "<string>"
}
]
}
],
"subscription_id": "<string>",
"payment_link": "<string>",
"payment_link_expires_at": "<string>",
"line_items": [
{
"rootfi_id": 123,
"item_id": "<string>",
"description": "<string>",
"quantity": 123,
"unit_amount": 123,
"tax_amount": 123,
"discount_amount": 123,
"total_amount": 123
}
],
"transactions": [
{
"rootfi_id": 123,
"platform_id": "<string>",
"type": "PAYMENT",
"amount": 123,
"currency_id": "<string>",
"status": "DRAFT",
"payment_method_type": "CARD",
"gateway": "<string>",
"description": "<string>",
"created_at": "<string>"
}
]
}| Field | Type | Required | Description |
|---|---|---|---|
| contact_id | string | Yes | Reference to the Contact who will be billed |
| currency_id | string | Yes | ISO 4217 currency code (e.g., USD, EUR) |
| document_number | string | No | Human-readable invoice number (auto-generated if not provided) |
| posted_date | string | No | Date when invoice is issued (ISO 8601). Defaults to current date |
| due_date | string | No | Payment due date (ISO 8601) |
| status | string | No | Invoice status (draft, open). Defaults to draft |
| line_items | array | Yes | Array of line item objects |
| memo | string | No | Additional notes for the invoice |
| subscription_id | string | No | Link to subscription (for recurring invoices) |
| Field | Type | Required | Description |
|---|---|---|---|
| item_id | string | No | Reference to an Item/Product |
| description | string | Yes | Description of the product or service |
| quantity | integer | Yes | Number of units |
| unit_amount | number | Yes | Price per unit |
| tax_amount | number | No | Tax for this line item |
| discount_amount | number | No | Discount applied |
The Commenda company ID.
Reference to the Contact.
ISO 4217 currency code.
Show child attributes
DRAFT, SUBMITTED, PARTIALLY_PAID, PAID, OVERDUE, VOID, UNKNOWN Invoice created successfully
The unique ID we assign for that data's information
157
The date at which RootFi first synced this data
"2024-01-22T05:07:31.465Z"
The latest date at which RootFi updated this data
"2024-01-22T05:07:31.000Z"
The ID of the company in the accounting platform
1089
An unique custom RootFi ID made from platform's unique_id.
"123456"
The date at which the data was deleted in the accounting platform
The ID of the data in the accounting platform.
A JSON containing fields that you can directly get from the accounting platform.
The hash of the data
Reference to the Contact who is billed.
ISO 4217 currency code for all amounts on this invoice (e.g., USD, EUR, GBP).
Human-readable invoice number (e.g., INV-2025-001).
The ISO 8601 date when this invoice was issued.
The ISO 8601 date by which payment is due.
Current payment status of the invoice (DRAFT, SUBMITTED, PARTIALLY_PAID, PAID, OVERDUE, VOID, UNKNOWN).
DRAFT, SUBMITTED, PARTIALLY_PAID, PAID, OVERDUE, VOID, UNKNOWN Total amount before tax, discounts, and shipping.
Total tax charged on this invoice.
Total discount amount applied.
Shipping and handling charges.
Final total amount due (sub_total + tax - discount + shipping).
Total amount paid by the contact.
Total amount refunded to the contact.
Total credit notes applied to this invoice.
Remaining balance due (total_amount - amount_paid + amount_refunded + amount_credited).
Additional notes or description for this invoice.
Original creation timestamp from platform (ISO 8601).
Last update timestamp from platform (ISO 8601).
Associated Orders (for consolidated invoices). Expandable attribute.
Show child attributes
Reference to the Subscription (for recurring invoices).
URL where contact can pay this invoice online.
Expiration date for the payment link (ISO 8601).
Individual items/services billed on this invoice.
Show child attributes
Complete history of payments, refunds, and credits for this invoice.
Show child attributes