products

GET /api/v1/products

Lists products within your company.

You can search and filter the result set using query parameters. These can be chained together allowing fine grained lists to be generated.

get/api/v1/products

Request

Query parameters

includestring
Example:first_load

Includes child relationships in the response, format is comma separated. Check each model for the list of associated includes

indexstring
Example:user

Replaces the default response index from data to a user specific string

ie.

  ?index=new_index

response is wrapped

  {
    'new_index' : [
      .....  
    ]
  }
per_pageinteger
Example:20

The number of records to return for each request, default is 20

pageinteger
Example:1

The page number to return for this request (when performing pagination), default is 1

sortstring[]

Order the list by choosing a column and direction. Each value uses the form column|asc or column|desc.

Single sort — for example sort=product_key|asc.

Multiple sorts — for example
sort[]=id|desc&sort[]=product_key|asc.

Only real columns on the products table are recognized (for example id, product_key, cost, price). Relationship sorts are not available here. Unsupported keys are ignored.

[
  "product_key|asc",
  "id|desc"
]
statusstring

Filter the entity based on their status. ie active / archived / deleted. Format is a comma separated string with any of the following options:

  • active
  • archived
  • deleted
GET /api/v1/invoices?status=archived,deleted
Returns only archived and deleted invoices
client_idstring

Filters the entity list by client_id. Suitable when you only want the entities of a specific client.

GET /api/v1/invoices?client_id=AxB7Hjk9
Returns only invoices for the specified client
created_atinteger

Filters the entity list by the created at timestamp. Parameter value can be a datetime string or unix timestamp

GET /api/v1/invoices?created_at=2022-01-10
Returns entities created on January 10th, 2022
updated_atinteger

Filters the entity list by the updated at timestamp. Parameter value can be a datetime string or unix timestamp

GET /api/v1/invoices?updated_at=2022-01-10
Returns entities last updated on January 10th, 2022
is_deletedboolean

Filters the entity list by entities that have been deleted.

GET /api/v1/invoices?is_deleted=true
Returns only soft-deleted entities
filter_deleted_clientsstring

Filters the entity list and only returns entities for clients that have not been deleted

GET /api/v1/invoices?filter_deleted_clients=true
Returns only invoices for active (non-deleted) clients
vendor_idstring

Filters the entity list by an associated vendor

GET /api/v1/purchases?vendor_id=AxB7Hjk9
Returns only purchases for the specified vendor
filterstring

Filter by product name

product_keystring

Filter by product key

Headers

X-API-TOKENstring required
Example:TOKEN

The API token to be used for authentication

X-Requested-Withstring required
Example:XMLHttpRequest

Used to send the XMLHttpRequest header

Response

A list of products

Example response

{
  "data": [
    {
      "id": "eP01N",
      "user_id": "n30m4",
      "assigned_user_id": "pR0j3",
      "project_id": "pR0j3",
      "vendor_id": "pR0j3",
      "custom_value1": "Custom value 1",
      "custom_value2": "Custom value 2",
      "custom_value3": "Custom value 3",
      "custom_value4": "Custom value 4",
      "product_key": "1234",
      "notes": "These are some notes about the product.",
      "cost": 10,
      "price": 20,
      "quantity": 5,
      "tax_name1": "Tax 1",
      "tax_rate1": 10,
      "tax_name2": "Tax 2",
      "tax_rate2": 5,
      "tax_name3": "Tax 3",
      "archived_at": 1647604800,
      "created_at": 1647604800,
      "updated_at": 1647691496,
      "tax_id": "1",
      "income_account_id": "42"
    }
  ],
  "meta": {
    "pagination": {
      "total": 1,
      "count": 1,
      "per_page": 1,
      "current_page": 1,
      "total_pages": 1
    }
  }
}

Changes