invoiceninja/openapi/paths/locations.yaml

340 lines
11 KiB
YAML

/api/v1/locations:
get:
tags:
- locations
summary: 'List locations'
description: |
When retrieving a list of locations you can chain query parameters to filter the dataset. For example:
```
/api/v1/locations?name=warehouse*
```
You can also sort the results:
```
/api/v1/locations?sort=name|desc
```
For pagination, use per_page and page parameters:
```
/api/v1/locations?per_page=15&page=2
```
The default per_page value is 20.
operationId: getLocations
parameters:
- $ref: '#/components/parameters/X-API-TOKEN'
- $ref: '#/components/parameters/X-Requested-With'
- $ref: '#/components/parameters/index'
- name: name
in: query
description: |
Filter by location name
```html
?name=warehouse
```
required: false
schema:
type: string
example: warehouse
- name: sort
in: query
description: |
Returns the list sorted by column in ascending or descending order.
```html
?sort=name|desc
```
required: false
schema:
type: string
example: name|desc
responses:
200:
description: 'A list of locations'
headers:
X-MINIMUM-CLIENT-VERSION:
$ref: '#/components/headers/X-MINIMUM-CLIENT-VERSION'
X-RateLimit-Remaining:
$ref: '#/components/headers/X-RateLimit-Remaining'
X-RateLimit-Limit:
$ref: '#/components/headers/X-RateLimit-Limit'
content:
application/json:
schema:
$ref: '#/components/schemas/Location'
401:
$ref: '#/components/responses/401'
403:
$ref: '#/components/responses/403'
422:
$ref: '#/components/responses/422'
429:
$ref: '#/components/responses/429'
default:
$ref: '#/components/responses/default'
post:
tags:
- locations
summary: 'Create location'
description: 'Adds a location to a company'
operationId: storeLocation
parameters:
- $ref: '#/components/parameters/X-API-TOKEN'
- $ref: '#/components/parameters/X-Requested-With'
- $ref: '#/components/parameters/index'
requestBody:
description: Location object that needs to be added to the company
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/LocationRequest'
responses:
200:
description: 'Returns the saved location object'
headers:
X-MINIMUM-CLIENT-VERSION:
$ref: '#/components/headers/X-MINIMUM-CLIENT-VERSION'
X-RateLimit-Remaining:
$ref: '#/components/headers/X-RateLimit-Remaining'
X-RateLimit-Limit:
$ref: '#/components/headers/X-RateLimit-Limit'
content:
application/json:
schema:
$ref: '#/components/schemas/Location'
401:
$ref: '#/components/responses/401'
403:
$ref: '#/components/responses/403'
422:
$ref: '#/components/responses/422'
429:
$ref: '#/components/responses/429'
default:
$ref: '#/components/responses/default'
'/api/v1/locations/{id}':
get:
tags:
- locations
summary: 'Show location'
description: 'Displays a location by id'
operationId: showLocation
parameters:
- $ref: '#/components/parameters/X-API-TOKEN'
- $ref: '#/components/parameters/X-Requested-With'
- $ref: '#/components/parameters/index'
- name: id
in: path
description: 'The Location Hashed ID'
required: true
schema:
type: string
format: string
example: D2J234DFA
responses:
200:
description: 'Returns the location object'
headers:
X-MINIMUM-CLIENT-VERSION:
$ref: '#/components/headers/X-MINIMUM-CLIENT-VERSION'
X-RateLimit-Remaining:
$ref: '#/components/headers/X-RateLimit-Remaining'
X-RateLimit-Limit:
$ref: '#/components/headers/X-RateLimit-Limit'
content:
application/json:
schema:
$ref: '#/components/schemas/Location'
401:
$ref: '#/components/responses/401'
403:
$ref: '#/components/responses/403'
422:
$ref: '#/components/responses/422'
429:
$ref: '#/components/responses/429'
default:
$ref: '#/components/responses/default'
put:
tags:
- locations
summary: 'Update location'
description: 'Handles the updating of a location by id'
operationId: updateLocation
parameters:
- $ref: '#/components/parameters/X-API-TOKEN'
- $ref: '#/components/parameters/X-Requested-With'
- $ref: '#/components/parameters/index'
- name: id
in: path
description: 'The Location Hashed ID'
required: true
schema:
type: string
format: string
example: D2J234DFA
requestBody:
description: Location object that needs to be updated
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/LocationRequest'
responses:
200:
description: 'Returns the location object'
headers:
X-MINIMUM-CLIENT-VERSION:
$ref: '#/components/headers/X-MINIMUM-CLIENT-VERSION'
X-RateLimit-Remaining:
$ref: '#/components/headers/X-RateLimit-Remaining'
X-RateLimit-Limit:
$ref: '#/components/headers/X-RateLimit-Limit'
content:
application/json:
schema:
$ref: '#/components/schemas/Location'
401:
$ref: '#/components/responses/401'
403:
$ref: '#/components/responses/403'
422:
$ref: '#/components/responses/422'
429:
$ref: '#/components/responses/429'
default:
$ref: '#/components/responses/default'
delete:
tags:
- locations
summary: 'Delete location'
description: 'Handles the deletion of a location by id'
operationId: deleteLocation
parameters:
- $ref: '#/components/parameters/X-API-TOKEN'
- $ref: '#/components/parameters/X-Requested-With'
- name: id
in: path
description: 'The Location Hashed ID'
required: true
schema:
type: string
format: string
example: D2J234DFA
responses:
200:
description: 'Returns a HTTP status'
headers:
X-MINIMUM-CLIENT-VERSION:
$ref: '#/components/headers/X-MINIMUM-CLIENT-VERSION'
X-RateLimit-Remaining:
$ref: '#/components/headers/X-RateLimit-Remaining'
X-RateLimit-Limit:
$ref: '#/components/headers/X-RateLimit-Limit'
401:
$ref: '#/components/responses/401'
403:
$ref: '#/components/responses/403'
422:
$ref: '#/components/responses/422'
429:
$ref: '#/components/responses/429'
default:
$ref: '#/components/responses/default'
/api/v1/locations/create:
get:
tags:
- locations
summary: 'Blank Location'
description: 'Returns a blank object with default values'
operationId: getLocationsCreate
parameters:
- $ref: '#/components/parameters/X-API-TOKEN'
- $ref: '#/components/parameters/X-Requested-With'
- $ref: '#/components/parameters/index'
responses:
200:
description: 'A blank location object'
headers:
X-MINIMUM-CLIENT-VERSION:
$ref: '#/components/headers/X-MINIMUM-CLIENT-VERSION'
X-RateLimit-Remaining:
$ref: '#/components/headers/X-RateLimit-Remaining'
X-RateLimit-Limit:
$ref: '#/components/headers/X-RateLimit-Limit'
content:
application/json:
schema:
$ref: '#/components/schemas/Location'
401:
$ref: '#/components/responses/401'
403:
$ref: '#/components/responses/403'
422:
$ref: '#/components/responses/422'
429:
$ref: '#/components/responses/429'
default:
$ref: '#/components/responses/default'
/api/v1/locations/bulk:
post:
tags:
- locations
summary: 'Bulk location actions'
description: |
Bulk actions allow to make changes to multiple locations in a single request. The following actions are supported:
- archive
- restore
- delete
All of these actions require an array of location ids to perform the requested action on ie.
"ids":['id1','id2']
operationId: bulkLocations
parameters:
- $ref: '#/components/parameters/X-API-TOKEN'
- $ref: '#/components/parameters/X-Requested-With'
- $ref: '#/components/parameters/index'
requestBody:
description: 'Bulk action array'
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/GenericBulkAction'
responses:
200:
description: 'The Location list Response of the updated locations that were bulk updated'
headers:
X-MINIMUM-CLIENT-VERSION:
$ref: '#/components/headers/X-MINIMUM-CLIENT-VERSION'
X-RateLimit-Remaining:
$ref: '#/components/headers/X-RateLimit-Remaining'
X-RateLimit-Limit:
$ref: '#/components/headers/X-RateLimit-Limit'
content:
application/json:
schema:
$ref: '#/components/schemas/Location'
401:
$ref: '#/components/responses/401'
403:
$ref: '#/components/responses/403'
422:
$ref: '#/components/responses/422'
429:
$ref: '#/components/responses/429'
default:
$ref: '#/components/responses/default'