Skip to main content
POST
/
accounting
/
expenses
Create Expense
curl --request POST \
  --url https://api.rootfi.dev/v3/accounting/expenses \
  --header 'Content-Type: application/json' \
  --header 'api_key: <api-key>' \
  --data '
{
  "company_id": 123,
  "data": [
    {
      "platform_id": "<string>",
      "contact_id": "<string>",
      "account_id": "<string>",
      "document_number": "<string>",
      "posted_date": "<string>",
      "payment_mode": "<string>",
      "currency_id": "<string>",
      "currency_rate": 123,
      "total_discount": 123,
      "memo": "<string>",
      "line_items": [
        {
          "tracking_category_ids": [
            "<string>"
          ],
          "project_id": "<string>",
          "item_id": "<string>",
          "tax_id": "<string>",
          "account_id": "<string>",
          "description": "<string>",
          "quantity": 123,
          "unit_amount": 123,
          "total_discount": 123
        }
      ]
    }
  ],
  "run_async": true
}
'
{
  "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>",
    "contact_id": "<string>",
    "account_id": "<string>",
    "document_number": "<string>",
    "posted_date": "<string>",
    "payment_mode": "<string>",
    "currency_id": "<string>",
    "currency_rate": 123,
    "total_amount": 123,
    "sub_total": 123,
    "tax_amount": 123,
    "total_discount": 123,
    "memo": "<string>",
    "updated_at": "<string>",
    "line_items": [
      {
        "rootfi_id": 123,
        "platform_id": "<string>",
        "line_item_type": "BILLS",
        "line_item_type_id": "<string>",
        "tracking_category_ids": [
          "<string>"
        ],
        "project_id": "<string>",
        "item_id": "<string>",
        "item": {
          "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>",
          "name": "<string>",
          "description": "<string>",
          "status": "ACTIVE",
          "type": "INVENTORY",
          "code": "<string>",
          "quantity_on_hand": 123,
          "is_bill_item": true,
          "bill_item": {
            "tax_id": "<string>",
            "account_id": "<string>",
            "unit_price": 123,
            "description": "<string>"
          },
          "is_invoice_item": true,
          "invoice_item": {
            "tax_id": "<string>",
            "account_id": "<string>",
            "unit_price": 123,
            "description": "<string>"
          },
          "updated_at": "<string>"
        },
        "tax_id": "<string>",
        "tax": {
          "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>",
          "name": "<string>",
          "code": "<string>",
          "tax_type": "<string>",
          "effective_tax_rate": 123,
          "total_tax_rate": 123,
          "components": [
            {
              "name": "<string>",
              "rate": 123,
              "tax_agency": "<string>",
              "is_compound": true
            }
          ],
          "updated_at": "<string>"
        },
        "account_id": "<string>",
        "account": {
          "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>",
          "name": "<string>",
          "description": "<string>",
          "nominal_code": "<string>",
          "current_balance": 123,
          "updated_at": "<string>",
          "status": "<string>",
          "category": "ASSET",
          "sub_category": "<string>",
          "currency_id": "<string>",
          "parent_account_id": "<string>",
          "parent_account": {
            "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>",
            "name": "<string>",
            "description": "<string>",
            "nominal_code": "<string>",
            "current_balance": 123,
            "updated_at": "<string>",
            "status": "<string>",
            "category": "ASSET",
            "sub_category": "<string>",
            "currency_id": "<string>",
            "parent_account_id": "<string>"
          },
          "currency": {
            "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>",
            "name": "<string>",
            "code": "<string>",
            "symbol": "<string>",
            "is_base_currency": true,
            "exchange_rate": 123,
            "updated_at": "<string>"
          }
        },
        "description": "<string>",
        "quantity": 123,
        "unit_amount": 123,
        "total_amount": 123,
        "sub_total": 123,
        "tax_amount": 123,
        "total_discount": 123,
        "updated_at": "2023-11-07T05:31:56Z"
      }
    ],
    "contact": {
      "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>",
      "name": "<string>",
      "contact_name": "<string>",
      "contact_type": "CUSTOMER",
      "currency_id": "<string>",
      "tax_number": "<string>",
      "registration_number": "<string>",
      "status": "ACTIVE",
      "updated_at": "<string>",
      "external_links": [
        {
          "rootfi_id": 123,
          "platform_id": "<string>",
          "link": "<string>",
          "type": "EMAIL"
        }
      ],
      "phone_numbers": [
        {
          "rootfi_id": 123,
          "platform_id": "<string>",
          "number": "<string>",
          "type": "MOBILE"
        }
      ],
      "addresses": [
        {
          "rootfi_id": 123,
          "platform_id": "<string>",
          "street": "<string>",
          "locality": "<string>",
          "city": "<string>",
          "state": "<string>",
          "pincode": "<string>",
          "country": "<string>"
        }
      ]
    },
    "currency": {
      "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>",
      "name": "<string>",
      "code": "<string>",
      "symbol": "<string>",
      "is_base_currency": true,
      "exchange_rate": 123,
      "updated_at": "<string>"
    },
    "account": {
      "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>",
      "name": "<string>",
      "description": "<string>",
      "nominal_code": "<string>",
      "current_balance": 123,
      "updated_at": "<string>",
      "status": "<string>",
      "category": "ASSET",
      "sub_category": "<string>",
      "currency_id": "<string>",
      "parent_account_id": "<string>",
      "parent_account": {
        "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>",
        "name": "<string>",
        "description": "<string>",
        "nominal_code": "<string>",
        "current_balance": 123,
        "updated_at": "<string>",
        "status": "<string>",
        "category": "ASSET",
        "sub_category": "<string>",
        "currency_id": "<string>",
        "parent_account_id": "<string>"
      },
      "currency": {
        "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>",
        "name": "<string>",
        "code": "<string>",
        "symbol": "<string>",
        "is_base_currency": true,
        "exchange_rate": 123,
        "updated_at": "<string>"
      }
    },
    "documents": [
      {
        "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>"
}
Expenses are Payment made by a business at the time of purchase (ex. a credit card payment)

Authorizations

api_key
string
header
required

Body

application/json
company_id
integer
required

The ID of the company in the accounting platform

data
accountingUpdateExpenseFields · object[]
required

The data of the Expense to create

run_async
boolean | null

Run the request asynchronously

Response

data
accountingExpenseObject · object

The data of the created Expense

sync_id
string | null

The sync id of the request