GET /api/bills
Show list of credit card bills

Returns list of credit card bills accessible by the current user. Additional filters can be passed for more exact result.

Examples

[
  {
    "id": 1,
    "date": "2021-06-03",
    "number": "2021-06-1224",
    "user_name": null,
    "state": "Processed",
    "asset_account_id": null,
    "asset_account_name": null,
    "totals": "72.00 EUR",
    "receipt_totals": "0.00 EUR (0/2)",
    "credit_cards": null,
    "user_id": null,
    "is_travel_account_bill": false,
    "card_number": null,
    "cardholder_name": null,
    "type": "credit_card",
    "scope": {
      "company_currency": "EUR"
    }
  },
  {
    "id": 2,
    "date": "2021-06-03",
    "number": "2021-06-7777",
    "user_name": "Jake Peralta",
    "state": "Processed",
    "asset_account_id": 12,
    "asset_account_name": "Yrityksen luottokortti",
    "totals": "72.00 EUR",
    "receipt_totals": "0.00 EUR (0/2)",
    "credit_card_id": 12,
    "credit_cards": [
      {
        "id": 12,
        "account_id": 12,
        "company_id": 1,
        "user_id": 1,
        "first": "44444",
        "last": "4444",
        "created_at": "2019-03-07T13:21:05.835Z",
        "updated_at": "2019-03-07T13:21:05.835Z"
      }
    ],
    "user_id": 1,
    "is_travel_account_bill": false,
    "card_number": "5555xxxxxxxx9999",
    "cardholder_name": "Jake Peralta",
    "type": "credit_card",
    "scope": {
      "company_currency": "EUR"
    }
  }
] 

Params

Param name Description
page
optional

Page number

Validations:

  • Must be a Integer

per_page
optional

Number of records per page. Can be set to 1000 for getting more bills in one page. Default: 50

Validations:

  • Must be a Integer

skip_pagination
optional

Pass true to skip pagination and receive all the credit card bills in one request, no pagination.

Validations:

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

updated_after
optional

Return only credit card bills updated on and after the supplied date. Date format: YYYYMMDD (example: 20210702)

Validations:

  • Must be a String

date_range
optional

Show all bills that have date within the date range. Date range format: “DD/MM/YYYY - DD/MM/YYYY” (example: 01/12/2021 - 12/12/2021)

Validations:

  • Must be a String

asset_account_id
optional

Pass asset account ID to show all bills that have the asset account assigned.

Validations:

  • Must be a Integer

credit_card_id
optional

Pass credit card ID to show all bills that have the credit card assigned.

Validations:

  • Must be a Integer

user_id
optional

Pass user_id to get bills of that user.

Validations:

  • Must be a Integer

type
optional

Pass type to filter bills by type.

Validations:

  • Must be a String

q
optional

Pass query to filter bills by total lines taxable amount or bill number.

Validations:

  • Must be a String

sort
optional

Return bills sorted by some of the bill’s field. Example: id, date, number, created_at, updated_at. Default: id.

Validations:

  • Must be a String

order
optional

Order bills ascending or descending based on sort param. Default: asc

Validations:

  • Must be one of: asc, desc.


GET /api/bills/:id
Show individual credit card bills

Shows individual credit card bill by its id. Bill lines are embedded into bill’s JSON as well as bill’s available receipts. To get the list of available receipt asset account or both asset account and credit card should be assigned to the bill.

Examples

[
  {
    "id": 1,
    "date": "2021-06-03",
    "number": "2021-06-1224",
    "user_name": null,
    "state": "processed",
    "asset_account_id": null,
    "credit_card_id": null,
    "credit_cards": null,
    "user_id": null,
    "lines": [
      {
        "id": 12,
        "date": "2021-06-03",
        "amount": "9.02",
        "amount_currency": "EUR",
        "name": "Some Payment *MONTHLY",
        "receipt_id": null,
        "bill_id": 1,
        "exchange_rate": null,
        "taxable_amount": "9.02",
        "taxable_amount_currency": "EUR"
      }
    ],
    "receipts": []
  },
] 

POST /api/bills/:id
Update credit card bill

Update credit card bill

Params

Param name Description
bill
required

Bill hashtable

Validations:

  • Must be a Hash

bill[credit_card_id]
optional

Validations:

  • Must be a Integer

bill[user_id]
optional

Only for travel account bills

Validations:

  • Must be a Integer


DELETE /api/bills
Delete credit card bills

Deletes credit card bills by provided IDs and all of their bill lines. Returns the number of deleted bills.

Params

Param name Description
ids
optional

IDs of bills to delete

Validations:

  • Must be an array of Integer


POST /api/bills/import
Import credit card bills

Import credit card bills from XML or CSV file in a specific format (.csv, .xml, .txt).

Params

Param name Description
file
optional

Either a FILE object or base64-encoded string

Validations:

  • Must be one of: File, String.