Authorizations
Body
multipart/form-data
Response
The response is of type object
.
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>' \
--form file=@example-file
{
"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>"
}
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 company_id=123 \
--form 'document_type_id=<string>' \
--form document_type=BILLS \
--form 'base64_file=<string>' \
--form 'file_name=<string>' \
--form file=@example-file
{
"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>"
}
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 response is of type object
.