curl --request POST \
--url https://api.rootfi.dev/v3/accounting/invoices \
--header 'Content-Type: application/json' \
--header 'api_key: <api-key>' \
--data '{
"company_id": 1,
"data": [
{
"contact_id": "123456",
"document_number": "ROOTFI01",
"posted_date": "2021-09-28T15:00:00.000Z",
"due_date": "2021-09-28T15:00:00.000Z",
"memo": "Test Invoice",
"line_items": [
{
"account_id": "123456",
"quantity": 1,
"item_id": "123456",
"tax_id": "123456",
"unit_amount": 100,
"total_discount": 0,
"description": "Test Item"
}
]
}
]
}'
import { RootFiClient } from "rootfi-api";
const rootfi = new RootFiClient({ apiKey: "<api_key>" });
await rootfi.accounting.invoice.create({
company_id: 1,
data: [
{
contact_id: "123456",
document_number: "ROOTFI01",
posted_date: "2021-09-28T15:00:00.000Z",
due_date: "2021-09-28T15:00:00.000Z",
memo: "Test Invoice",
line_items: [
{
account_id: "123456",
quantity: 1,
item_id: "123456",
tax_id: "123456",
unit_amount: 100,
total_discount: 0,
description: "Test Item",
},
],
},
],
});
{
"data": {
"rootfi_id": 123,
"rootfi_deleted_at": null,
"rootfi_created_at": "2024-01-25T09:00:00Z",
"rootfi_updated_at": "2024-01-25T09:00:00Z",
"rootfi_company_id": 456,
"platform_id": "123456_1",
"platform_unique_id": "123456",
"currency_id": "123456",
"contact_id": "123456",
"total_discount": 100,
"sub_total": 1000,
"tax_amount": 100,
"total_amount": 1100,
"amount_due": 1100,
"document_number": "123456",
"posted_date": "2024-01-25T09:00:00Z",
"due_date": "2024-01-25T09:00:00Z",
"memo": "Example Memo",
"updated_at": "2024-01-25T09:00:00Z",
"status": "Example Status",
"currency_rate": 1,
"sales_order_ids": [
"123456"
],
"line_items": [
{
"rootfi_id": 157,
"platform_id": "123456",
"line_item_type": "INVOICES",
"line_item_type_id": "123456",
"tracking_category_ids": [
"123456"
],
"project_id": "123456",
"item_id": "123456",
"tax_id": "123456",
"account_id": "123456",
"description": "This is a description",
"quantity": 1,
"unit_amount": 100,
"total_amount": 100,
"sub_total": 100,
"tax_amount": 100,
"total_discount": 100,
"updated_at": "2024-01-22T05:07:31.000Z"
}
]
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"field": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"field": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"field": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"field": "<string>"
}
}Invoices
Create Invoice
Create a new invoice.
POST
/
accounting
/
invoices
curl --request POST \
--url https://api.rootfi.dev/v3/accounting/invoices \
--header 'Content-Type: application/json' \
--header 'api_key: <api-key>' \
--data '{
"company_id": 1,
"data": [
{
"contact_id": "123456",
"document_number": "ROOTFI01",
"posted_date": "2021-09-28T15:00:00.000Z",
"due_date": "2021-09-28T15:00:00.000Z",
"memo": "Test Invoice",
"line_items": [
{
"account_id": "123456",
"quantity": 1,
"item_id": "123456",
"tax_id": "123456",
"unit_amount": 100,
"total_discount": 0,
"description": "Test Item"
}
]
}
]
}'
import { RootFiClient } from "rootfi-api";
const rootfi = new RootFiClient({ apiKey: "<api_key>" });
await rootfi.accounting.invoice.create({
company_id: 1,
data: [
{
contact_id: "123456",
document_number: "ROOTFI01",
posted_date: "2021-09-28T15:00:00.000Z",
due_date: "2021-09-28T15:00:00.000Z",
memo: "Test Invoice",
line_items: [
{
account_id: "123456",
quantity: 1,
item_id: "123456",
tax_id: "123456",
unit_amount: 100,
total_discount: 0,
description: "Test Item",
},
],
},
],
});
{
"data": {
"rootfi_id": 123,
"rootfi_deleted_at": null,
"rootfi_created_at": "2024-01-25T09:00:00Z",
"rootfi_updated_at": "2024-01-25T09:00:00Z",
"rootfi_company_id": 456,
"platform_id": "123456_1",
"platform_unique_id": "123456",
"currency_id": "123456",
"contact_id": "123456",
"total_discount": 100,
"sub_total": 1000,
"tax_amount": 100,
"total_amount": 1100,
"amount_due": 1100,
"document_number": "123456",
"posted_date": "2024-01-25T09:00:00Z",
"due_date": "2024-01-25T09:00:00Z",
"memo": "Example Memo",
"updated_at": "2024-01-25T09:00:00Z",
"status": "Example Status",
"currency_rate": 1,
"sales_order_ids": [
"123456"
],
"line_items": [
{
"rootfi_id": 157,
"platform_id": "123456",
"line_item_type": "INVOICES",
"line_item_type_id": "123456",
"tracking_category_ids": [
"123456"
],
"project_id": "123456",
"item_id": "123456",
"tax_id": "123456",
"account_id": "123456",
"description": "This is a description",
"quantity": 1,
"unit_amount": 100,
"total_amount": 100,
"sub_total": 100,
"tax_amount": 100,
"total_discount": 100,
"updated_at": "2024-01-22T05:07:31.000Z"
}
]
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"field": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"field": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"field": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"field": "<string>"
}
}The Invoices Data Model is designed to standardise and
simplify the handling of invoice-related information across different accounting platforms.
curl --request POST \
--url https://api.rootfi.dev/v3/accounting/invoices \
--header 'Content-Type: application/json' \
--header 'api_key: <api-key>' \
--data '{
"company_id": 1,
"data": [
{
"contact_id": "123456",
"document_number": "ROOTFI01",
"posted_date": "2021-09-28T15:00:00.000Z",
"due_date": "2021-09-28T15:00:00.000Z",
"memo": "Test Invoice",
"line_items": [
{
"account_id": "123456",
"quantity": 1,
"item_id": "123456",
"tax_id": "123456",
"unit_amount": 100,
"total_discount": 0,
"description": "Test Item"
}
]
}
]
}'
import { RootFiClient } from "rootfi-api";
const rootfi = new RootFiClient({ apiKey: "<api_key>" });
await rootfi.accounting.invoice.create({
company_id: 1,
data: [
{
contact_id: "123456",
document_number: "ROOTFI01",
posted_date: "2021-09-28T15:00:00.000Z",
due_date: "2021-09-28T15:00:00.000Z",
memo: "Test Invoice",
line_items: [
{
account_id: "123456",
quantity: 1,
item_id: "123456",
tax_id: "123456",
unit_amount: 100,
total_discount: 0,
description: "Test Item",
},
],
},
],
});
Authorizations
Body
application/json
⌘I