GET /api/company
Get information about current user's company

Get current user company data.

Time till last scheduled sending to accounting is in time_to_scheduled_batch_run field (“total” = seconds till the next scheduled operation).

For human-readable representation of this time see format_time_to_scheduled_batch_run field.


PUT /api/send_batch
Send expenses to accounting

Send expenses to accounting. If successful, batch will be sent in a few minutes.

Params

Param name Description
company
required

Batch sending params.

Validations:

  • Must be a Hash

company[id]
required

Company ID.

Validations:

  • Must be a Integer

company[expense_type]
optional

Expense type, determined by asset account. If not passed, expenses with all asset accounts will be sent. Pass "company" to send only expenses paid with company assets, pass "personal" to send only reimbursable expenses, pass "asset_account_id" to filter expenses by a specific asset account.

Validations:

  • Must be one of: company, personal, asset_account_id.

company[asset_account_id]
optional

Asset account ID to filter expenses by. Will be ignored unless expense_type parameter is set to "asset_account_id".

Validations:

  • Must be a Integer

company[expense_account_id]
optional

Expense account ID to filter expenses by.

Validations:

  • Must be a Integer

company[has_date_range]
optional

Whether batch should be limited by date range. If false, expenses from all time will be sent. If true, expenses within batch_start_date and batch_end_date range will be sent.

Validations:

  • Must be one of: true, false, 1, 0.

company[batch_start_date]
optional

Start date of the date range to filter expenses by. E.g., "2024-04-21". Required if has_date_range, otherwise ignored. Must be less or equal to batch_end_date.

Validations:

  • Must be a String

company[batch_end_date]
optional

End date of the date range to filter expenses by. E.g., "2024-04-28". Required if has_date_range, otherwise ignored. Must be greater or equal to batch_start_date.

Validations:

  • Must be a String