General
Server Side SDKs
Core API
- Companies
- Invite Links
- Sync
- Passthrough
- Real Time
- Webhooks
Unified API
- Accounting
- Accounts
- Bank Accounts
- Bank Transactions
- Bills
- Bill Payments
- Bill Credit Notes
- Contacts
- Company Info
- Currencies
- Documents
- Expenses
- Invoice Credit Notes
- Invoices
- Invoice Payments
- Items
- Journal Entries
- Purchase Orders
- Sales Orders
- Goods Receipt Notes
- Projects
- Tax Rates
- Tracking Categories
- Balance Sheet
- Cash Flow Statements
- Income Statements
- Payments
- Ecommerce
- CRM
Documents
Create Document
Create a new Document.
POST
/
accounting
/
documents
Copy
curl --request POST \
--url https://api.rootfi.dev/v3/accounting/documents \
--header 'Content-Type: multipart/form-data' \
--header 'api_key: <api-key>' \
--form company_id=123 \
--form 'document_type_id=<string>' \
--form document_type=BILLS \
--form 'base64_file=<string>' \
--form 'file_name=<string>'
Copy
{
"data": {
"rootfi_id": 157,
"rootfi_deleted_at": "2023-11-07T05:31:56Z",
"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",
"platform_unique_id": "<string>",
"raw_data": {},
"data_hash": "<string>",
"file_name": "<string>",
"file_type": "<string>",
"file_size": "<string>",
"document_type_id": "<string>",
"document_type": "<string>",
"document_uploaded": true,
"updated_at": "<string>"
},
"sync_id": "<string>"
}
The Documents Data Model simplifies the handling of document documents across various accounting platforms, providing a standardised approach to accessing and managing document-related information.
To Upload a file using Node JS SDK, you can use the following code:
Copy
import { RootFiClient } from "rootfi-api";
const rootfi = new RootFiClient({ apiKey: "*****" });
await rootfi.accounting.documents.create(fs.createReadStream("./helpers/test_img.png"), {
companyId: 12,
documentType: "BILLS",
documentTypeId: "3770712000000689685",
});
Authorizations
Body
multipart/form-data
Response
200
application/json
The response is of type object
.
Copy
curl --request POST \
--url https://api.rootfi.dev/v3/accounting/documents \
--header 'Content-Type: multipart/form-data' \
--header 'api_key: <api-key>' \
--form company_id=123 \
--form 'document_type_id=<string>' \
--form document_type=BILLS \
--form 'base64_file=<string>' \
--form 'file_name=<string>'
Copy
{
"data": {
"rootfi_id": 157,
"rootfi_deleted_at": "2023-11-07T05:31:56Z",
"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",
"platform_unique_id": "<string>",
"raw_data": {},
"data_hash": "<string>",
"file_name": "<string>",
"file_type": "<string>",
"file_size": "<string>",
"document_type_id": "<string>",
"document_type": "<string>",
"document_uploaded": true,
"updated_at": "<string>"
},
"sync_id": "<string>"
}
Assistant
Responses are generated using AI and may contain mistakes.