curl --request POST \
--url https://api.rootfi.dev/v3/accounting/documents \
--header 'Content-Type: multipart/form-data' \
--header 'api_key: <api-key>' \
--form file='@example-file' \
--form company_id=123 \
--form 'document_type_id=<string>' \
--form document_type=BILLS \
--form 'base64_file=<string>' \
--form 'file_name=<string>'{
"data": {
"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>",
"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>"
}Create a new Document.
curl --request POST \
--url https://api.rootfi.dev/v3/accounting/documents \
--header 'Content-Type: multipart/form-data' \
--header 'api_key: <api-key>' \
--form file='@example-file' \
--form company_id=123 \
--form 'document_type_id=<string>' \
--form document_type=BILLS \
--form 'base64_file=<string>' \
--form 'file_name=<string>'{
"data": {
"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>",
"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>"
}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",
});
The company ID of the document
The document type ID of the document
The document type of the document
BILLS, INVOICES, BILL_CREDIT_NOTES, INVOICE_CREDIT_NOTES, EXPENSES, PURCHASE_ORDERS, SALES_ORDERS The base64 file of the document
The file name of the document