locations

GET /api/v1/locations

Locations are additional addresses that are applicable to a client. This is useful when a client has multiple addresses for shipping, billing, etc.

When retrieving a list of locations you can chain query parameters to filter the dataset. For example:

/api/v1/locations?name=warehouse*

Sorting uses column|asc or column|desc. Use a single sort parameter for one column, or repeated sort[] parameters for multi-level ordering (first is primary):

/api/v1/locations?sort=id|desc
/api/v1/locations?sort[]=id|desc&sort[]=name|asc

For pagination, use per_page and page parameters:

/api/v1/locations?per_page=15&page=2

The default per_page value is 20.

get/api/v1/locations

Request

Query parameters

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=name|desc.

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

Location ordering is limited by the filter: name is the primary supported case; other column names must exist on the locations schema to take effect.

[
  "name|desc"
]
namestring

Filter by location name

?name=warehouse

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 locations

Example response

{
  "data": [
    {
      "id": "Kd5S2M",
      "name": "Warehouse A",
      "address1": "123 Business Street",
      "address2": "Suite 100",
      "city": "San Francisco",
      "state": "CA",
      "postal_code": "94107",
      "country_id": "840",
      "is_shipping_location": true,
      "user_id": "Opnel5aKBz",
      "assigned_user_id": "Opnel5aKBz",
      "client_id": "Opnel5aKBz",
      "vendor_id": "Opnel5aKBz",
      "created_at": 1623456789,
      "updated_at": 1623456999
    }
  ]
}

Changes