POST
/
accounting
/
documents

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:

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

api_key
string
headerrequired

Body

multipart/form-data
file
file
company_id
integer

The company ID of the document

document_type_id
string | null

The document type ID of the document

document_type
enum<string>

The document type of the document

Available options:
BILLS,
INVOICES,
BILL_CREDIT_NOTES,
INVOICE_CREDIT_NOTES,
EXPENSES,
PURCHASE_ORDERS,
SALES_ORDERS
base64_file
string | null

The base64 file of the document

file_name
string | null

The file name of the document

Response

200 - application/json
data
object

The data of the created document

sync_id
string | null

The sync id of the request