List locations
Changed onGET /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.
Request
- Base URLhttps://demo.invoiceninja.com
- Authnone declared. Required headers: X-API-TOKEN, X-Requested-With
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Query parameters
Replaces the default response index from data to a user specific string
ie.
?index=new_index
response is wrapped
{
'new_index' : [
.....
]
}
The number of records to return for each request, default is 20
The page number to return for this request (when performing pagination), default is 1
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" ]
Filter by location name
?name=warehouse
Headers
The API token to be used for authentication
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
- info
for the
queryrequest parametersort, the type was generalized fromstringtoarray
- info
- info
the response optional property
//became read-only for the status
- info