Bezala API documentation

API base url: https://app.bezala.com
Accepted content type: application/json


Example GET request:

curl -H "Authorization: Bearer token" -H "Content-Type: application/json" -X GET https://app.bezala.com/api/accounts

Example POST request:

curl -H "Authorization: Bearer token" -H "Content-Type: application/json" -X POST -d '{"account": {"name": "Company Account", "code": "2222", "accountable_type": "AssetAccount"}}' https://app.bezala.com/api/accounts

Resources

Account_rules

Resource Description
GET /api/account_rules Get a list of company-specific account rules

Accounts

Resource Description
GET /api/accounts Get accounts list
POST /api/accounts Create account
PUT /api/accounts/:id/toggle_deactivated Activate or Deactivate account

Attachments

Resource Description
GET /api/attachments/:id/image Return attachment image
PUT /api/attachments/:id Rotate image
POST /api/attachments Upload new image
DELETE /api/attachments/:id Delete image
PUT /api/attachments Sort images

Authentication

Resource Description
POST /api/auth/token Authenticate user
POST /api/auth/google/token Authenticate user via Google access token
POST /api/auth/microsoft/token Authenticate user via Microsoft access token
POST /api/auth/okta/token Authenticate user via Okta access token

Batch_documents

Resource Description
GET /api/batch_documents Get batch documents list
GET /api/batch_documents/export Export summary into PDF
PUT /api/batch_documents/:id/set_external_id Set external ID for batch document

Bill_lines

Resource Description
GET /api/bill_lines Show the list of bill lines
POST /api/bills/:bill_id/lines Add new bill line
PUT /api/bills/:bill_id/lines/:id Edit existing bill line
DELETE /api/bills/:bill_id/lines/:id Delete existing bill line
PUT /api/bills/:bill_id/lines/bulk_update_no_receipt_needed Bulk edit the existing bill lines receipt_id: 0

Bills

Resource Description
GET /api/bills Show list of credit card bills
GET /api/bills/:id Show individual credit card bills
POST /api/bills/:id Update credit card bill
DELETE /api/bills Delete credit card bills
POST /api/bills/import Import credit card bills

Budgets

Resource Description
GET /api/budgets Show list of the budgets user- and company-specific
POST /api/budgets Create budget
PUT /api/budgets/:id Update budget
DELETE /api/budgets/:id Delete budget

Companies

Resource Description
GET /api/company Get information about current user's company
PUT /api/send_batch Send expenses to accounting

Cost_centers

Resource Description
GET /api/cost_centers Get cost centers list
POST /api/cost_centers Create cost center
PUT /api/cost_centers/:id Update cost center
PUT /api/cost_centers/:id/toggle_deactivated Activate or Deactivate cost center

Countries

Resource Description
GET /api/countries Get a list of all of the countries persisted in Bezala.

Credit_cards

Resource Description
GET /api/credit_cards Get credit cards list

Daily_allowances

Resource Description
GET /api/daily_allowances/:id Show daily allowance details
PUT /api/daily_allowances/:id/approve Approve daily allowance. If daily allowance params are present, updates the daily allowance before approval
POST /api/daily_allowances/:id/disapprove Disapprove daily allowance
GET /api/daily_allowances/:id/conditional_values Get values for the conditional fields of the daily allowance
GET /api/daily_allowances Get the list of daily allowances
POST /api/daily_allowances/calculate_cost Get the cost of the Daily Allowance

Expense_summaries

Resource Description
GET /api/expense_summary/export Export to PDF expense summary by state where summary name matches tag.

Export Daily Allowances

Resource Description
GET /api/export/daily_allowances Get a list of daily allowances

Export Receipts

Resource Description
GET /api/export/receipts Get a list of receipts

Export Rewards

Resource Description
GET /api/export/rewards Get a list of rewards

Export Trips

Resource Description
GET /api/export/trips Get a list of trips

Home

Resource Description
GET /api/home Get the data required for the first web app load
GET /api/expenses Get the non-accounted expenses grouped by state
GET /api/archive Get the accounted expenses

Real_time_ccb

Resource Description
POST /api/:provider/bill_lines Create a bill line

Reports

Resource Description
GET /api/reports Get reports list

Reward_types

Resource Description
GET /api/reward_types Get reward types list

Rewards

Resource Description
GET /api/rewards/:id Show reward details
PUT /api/rewards/:id/approve Approve reward. If reward params are present, updates the reward before approval
POST /api/rewards/:id/disapprove Disapprove reward
GET /api/rewards/:id/conditional_values Get values for the conditional fields of the reward
GET /api/rewards Get the list of rewards
POST /api/rewards Create reward

Skatteverket_declarations

Resource Description
GET /api/skatteverket_declarations Get Skatteverket reports list

Subscriptions

Resource Description
GET /api/subscriptions Get a list of company-specific user-specific subscriptions
GET /api/subscriptions/:id/receipts Get a list of the last 20 receipts of the subscription

Tags

Resource Description
GET /api/tags/latest Get 100 tags for the current user sorted from newest to oldest
GET /api/current_user_tags Get 100 tags for the current user sorted from newest to oldest, each tag prefixed with @

Transaction_rules

Resource Description
GET /api/transaction_rules Get a list of company-specific email rules
POST /api/transaction_rules Create email rule
PUT /api/transaction_rules/:id Update email rule
DELETE /api/transaction_rules/:id Delete email rule

Transactions

Resource Description
GET /api/transactions/:id Show transaction details
PUT /api/transactions/:id/approve Approve Receipt
POST /api/transactions/:id/disapprove Disapprove transaction
GET /api/transactions/:id/conditional_values Get values for the conditional fields of the transaction
GET /api/transactions Get the list of receipts
POST /api/transactions Create receipt
POST /api/transactions/:id/approvers Set transaction-specific approval cycle
PUT /api/transactions/:id/set_paid_at Mark receipt as paid or not paid

Trips

Resource Description
GET /api/trips/:id Show trip details
PUT /api/trips/:id/approve Approve trip. If trip params are present, updates the trip before approval
POST /api/trips/:id/disapprove Disapprove trip
GET /api/trips/:id/conditional_values Get values for the conditional fields of the trip
GET /api/trips Get the list of trips
POST /api/trips Create a new trip (aka mileage)
POST /api/trips/calculate_cost Get the cost of the trip

Users

Resource Description
GET /api/users Get users list
GET /api/users/extended_index Get users' details list
POST /api/users Add new user
PUT /api/users/:id Edit existing user
GET /api/users/:id Get user details by id
DELETE /api/users/:id Delete user from the current company by id
PUT /api/users/:id/change_company/:company_id Change current user's current company id
PUT /api/users/:id/switch_to_another_company Change current user's current company id to the 1st available one

Vendors

Resource Description
GET /api/vendors Get vendors list
GET /api/vendors/:id Get vendor
POST /api/vendors Create vendor
PUT /api/vendors/:id Update vendor
PUT /api/vendors/:id/toggle_deactivated Toggle deactivated field
DELETE /apivendors/:id/destroy Delete vendor

Waypoints

Resource Description
GET /api/my_waypoints Get waypoints of current user