1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-21 08:51:34 +02:00
invoiceninja/openapi/paths/products.yaml

425 lines
14 KiB
YAML
Raw Normal View History

2023-02-18 02:22:48 +01:00
/api/v1/products:
get:
tags:
- products
2023-02-18 04:21:42 +01:00
summary: "List products"
description: |
Lists products, search and filters allow fine grained lists to be generated.
Query parameters can be added to perform fine grained filtering of the products list, these are handled by the ProductFilters class
which defines the methods available
2023-02-18 02:22:48 +01:00
operationId: getProducts
parameters:
2023-02-18 04:21:42 +01:00
- $ref: "#/components/parameters/X-API-TOKEN"
- $ref: "#/components/parameters/X-Requested-With"
- $ref: "#/components/parameters/include"
2023-02-18 09:58:40 +01:00
- $ref: "#/components/parameters/status"
- $ref: "#/components/parameters/client_id"
- $ref: "#/components/parameters/created_at"
- $ref: "#/components/parameters/updated_at"
- $ref: "#/components/parameters/is_deleted"
- $ref: "#/components/parameters/filter_deleted_clients"
- $ref: "#/components/parameters/vendor_id"
2023-02-18 05:20:21 +01:00
- name: filter
in: query
description: Filter by product name
required: false
schema:
type: string
example: bob
- name: product_key
in: query
description: Filter by product key
required: false
schema:
type: string
example: bob
- name: sort
in: query
description: Returns the list sorted by column in ascending or descending order.
required: false
schema:
type: string
example: id|desc product_key|desc
2023-02-18 02:22:48 +01:00
responses:
200:
2023-02-18 04:21:42 +01:00
description: "A list of products"
2023-02-18 02:22:48 +01:00
headers:
X-MINIMUM-CLIENT-VERSION:
2023-02-18 04:21:42 +01:00
$ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION"
2023-02-18 02:22:48 +01:00
X-RateLimit-Remaining:
2023-02-18 04:21:42 +01:00
$ref: "#/components/headers/X-RateLimit-Remaining"
2023-02-18 02:22:48 +01:00
X-RateLimit-Limit:
2023-02-18 04:21:42 +01:00
$ref: "#/components/headers/X-RateLimit-Limit"
2023-02-18 02:22:48 +01:00
content:
application/json:
schema:
2023-02-18 04:21:42 +01:00
$ref: "#/components/schemas/Product"
401:
2023-02-18 05:08:56 +01:00
$ref: '#/components/responses/401'
2023-02-18 04:21:42 +01:00
403:
2023-02-18 05:08:56 +01:00
$ref: '#/components/responses/403'
2023-02-18 02:22:48 +01:00
422:
2023-02-18 05:08:56 +01:00
$ref: '#/components/responses/422'
2023-04-29 15:10:45 +02:00
429:
$ref: '#/components/responses/429'
5XX:
description: 'Server error'
2023-02-18 02:22:48 +01:00
default:
2023-02-18 05:08:56 +01:00
$ref: '#/components/responses/default'
2023-02-18 02:22:48 +01:00
post:
tags:
- products
2023-02-18 04:21:42 +01:00
summary: "Create Product"
description: "Adds a product to a company"
2023-02-18 02:22:48 +01:00
operationId: storeProduct
parameters:
2023-02-18 04:21:42 +01:00
- $ref: "#/components/parameters/X-API-TOKEN"
- $ref: "#/components/parameters/X-Requested-With"
- $ref: "#/components/parameters/include"
2023-02-18 02:22:48 +01:00
responses:
200:
2023-02-18 04:21:42 +01:00
description: "Returns the saved product object"
2023-02-18 02:22:48 +01:00
headers:
X-MINIMUM-CLIENT-VERSION:
2023-02-18 04:21:42 +01:00
$ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION"
2023-02-18 02:22:48 +01:00
X-RateLimit-Remaining:
2023-02-18 04:21:42 +01:00
$ref: "#/components/headers/X-RateLimit-Remaining"
2023-02-18 02:22:48 +01:00
X-RateLimit-Limit:
2023-02-18 04:21:42 +01:00
$ref: "#/components/headers/X-RateLimit-Limit"
2023-02-18 02:22:48 +01:00
content:
application/json:
schema:
2023-02-18 04:21:42 +01:00
$ref: "#/components/schemas/Product"
2023-02-18 05:08:56 +01:00
401:
$ref: '#/components/responses/401'
403:
$ref: '#/components/responses/403'
2023-02-18 02:22:48 +01:00
422:
2023-02-18 05:08:56 +01:00
$ref: '#/components/responses/422'
2023-04-29 15:10:45 +02:00
429:
$ref: '#/components/responses/429'
5XX:
description: 'Server error'
2023-02-18 02:22:48 +01:00
default:
2023-02-18 05:08:56 +01:00
$ref: '#/components/responses/default'
2023-02-18 04:21:42 +01:00
"/api/v1/products/{id}":
2023-02-18 02:22:48 +01:00
get:
tags:
- products
2023-02-18 04:21:42 +01:00
summary: "Show product"
description: "Displays a product by id"
operationId: showProduct
2023-02-18 02:22:48 +01:00
parameters:
2023-02-18 04:21:42 +01:00
- $ref: "#/components/parameters/X-API-TOKEN"
- $ref: "#/components/parameters/X-Requested-With"
- $ref: "#/components/parameters/include"
- name: id
in: path
description: "The Product Hashed ID"
required: true
schema:
type: string
format: string
example: D2J234DFA
2023-02-18 02:22:48 +01:00
responses:
200:
2023-02-18 04:21:42 +01:00
description: "Returns the product object"
2023-02-18 02:22:48 +01:00
headers:
X-MINIMUM-CLIENT-VERSION:
2023-02-18 04:21:42 +01:00
$ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION"
2023-02-18 02:22:48 +01:00
X-RateLimit-Remaining:
2023-02-18 04:21:42 +01:00
$ref: "#/components/headers/X-RateLimit-Remaining"
2023-02-18 02:22:48 +01:00
X-RateLimit-Limit:
2023-02-18 04:21:42 +01:00
$ref: "#/components/headers/X-RateLimit-Limit"
content:
application/json:
schema:
$ref: "#/components/schemas/Product"
401:
2023-02-18 05:08:56 +01:00
$ref: '#/components/responses/401'
2023-02-18 04:21:42 +01:00
403:
2023-02-18 05:08:56 +01:00
$ref: '#/components/responses/403'
2023-02-18 02:22:48 +01:00
422:
2023-02-18 05:08:56 +01:00
$ref: '#/components/responses/422'
2023-04-29 15:10:45 +02:00
429:
$ref: '#/components/responses/429'
5XX:
description: 'Server error'
2023-02-18 02:22:48 +01:00
default:
2023-02-18 05:08:56 +01:00
$ref: '#/components/responses/default'
2023-02-18 04:21:42 +01:00
put:
2023-02-18 02:22:48 +01:00
tags:
- products
2023-02-18 04:21:42 +01:00
summary: "Update product"
description: "Handles the updating of a product by id"
operationId: updateProduct
2023-02-18 02:22:48 +01:00
parameters:
2023-02-18 04:21:42 +01:00
- $ref: "#/components/parameters/X-API-TOKEN"
- $ref: "#/components/parameters/X-Requested-With"
- $ref: "#/components/parameters/include"
- name: id
2023-02-18 02:22:48 +01:00
in: path
2023-02-18 04:21:42 +01:00
description: "The Product Hashed ID"
2023-02-18 02:22:48 +01:00
required: true
schema:
type: string
format: string
example: D2J234DFA
responses:
200:
2023-02-18 04:21:42 +01:00
description: "Returns the Product object"
2023-02-18 02:22:48 +01:00
headers:
X-MINIMUM-CLIENT-VERSION:
2023-02-18 04:21:42 +01:00
$ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION"
2023-02-18 02:22:48 +01:00
X-RateLimit-Remaining:
2023-02-18 04:21:42 +01:00
$ref: "#/components/headers/X-RateLimit-Remaining"
2023-02-18 02:22:48 +01:00
X-RateLimit-Limit:
2023-02-18 04:21:42 +01:00
$ref: "#/components/headers/X-RateLimit-Limit"
content:
application/json:
schema:
$ref: "#/components/schemas/Product"
401:
2023-02-18 05:08:56 +01:00
$ref: '#/components/responses/401'
2023-02-18 04:21:42 +01:00
403:
2023-02-18 05:08:56 +01:00
$ref: '#/components/responses/403'
2023-02-18 02:22:48 +01:00
422:
2023-02-18 05:08:56 +01:00
$ref: '#/components/responses/422'
2023-04-29 15:10:45 +02:00
429:
$ref: '#/components/responses/429'
5XX:
description: 'Server error'
2023-02-18 02:22:48 +01:00
default:
2023-02-18 05:08:56 +01:00
$ref: '#/components/responses/default'
2023-02-18 04:21:42 +01:00
delete:
2023-02-18 02:22:48 +01:00
tags:
- products
2023-02-18 04:21:42 +01:00
summary: "Delete product"
description: "Handles the deletion of a product by id"
operationId: deleteProduct
2023-02-18 02:22:48 +01:00
parameters:
2023-02-18 04:21:42 +01:00
- $ref: "#/components/parameters/X-API-TOKEN"
- $ref: "#/components/parameters/X-Requested-With"
- $ref: "#/components/parameters/include"
- name: id
2023-02-18 02:22:48 +01:00
in: path
2023-02-18 04:21:42 +01:00
description: "The Product Hashed ID"
2023-02-18 02:22:48 +01:00
required: true
schema:
type: string
format: string
example: D2J234DFA
responses:
200:
2023-02-18 04:21:42 +01:00
description: "Returns a HTTP status"
2023-02-18 02:22:48 +01:00
headers:
X-MINIMUM-CLIENT-VERSION:
2023-02-18 04:21:42 +01:00
$ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION"
2023-02-18 02:22:48 +01:00
X-RateLimit-Remaining:
2023-02-18 04:21:42 +01:00
$ref: "#/components/headers/X-RateLimit-Remaining"
2023-02-18 02:22:48 +01:00
X-RateLimit-Limit:
2023-02-18 04:21:42 +01:00
$ref: "#/components/headers/X-RateLimit-Limit"
401:
2023-02-18 05:08:56 +01:00
$ref: '#/components/responses/401'
2023-02-18 04:21:42 +01:00
403:
2023-02-18 05:08:56 +01:00
$ref: '#/components/responses/403'
2023-02-18 02:22:48 +01:00
422:
2023-02-18 05:08:56 +01:00
$ref: '#/components/responses/422'
2023-04-29 15:10:45 +02:00
429:
$ref: '#/components/responses/429'
5XX:
description: 'Server error'
2023-02-18 02:22:48 +01:00
default:
2023-02-18 05:08:56 +01:00
$ref: '#/components/responses/default'
2023-02-18 04:21:42 +01:00
"/api/v1/products/{id}/edit":
get:
2023-02-18 02:22:48 +01:00
tags:
- products
2023-02-18 04:21:42 +01:00
summary: "Edit product"
description: "Displays an Product by id"
operationId: editProduct
2023-02-18 02:22:48 +01:00
parameters:
2023-02-18 04:21:42 +01:00
- $ref: "#/components/parameters/X-API-TOKEN"
- $ref: "#/components/parameters/X-Requested-With"
- $ref: "#/components/parameters/include"
- name: id
2023-02-18 02:22:48 +01:00
in: path
2023-02-18 04:21:42 +01:00
description: "The Product Hashed ID"
2023-02-18 02:22:48 +01:00
required: true
schema:
type: string
format: string
example: D2J234DFA
responses:
200:
2023-02-18 04:21:42 +01:00
description: "Returns the Product object"
2023-02-18 02:22:48 +01:00
headers:
X-MINIMUM-CLIENT-VERSION:
2023-02-18 04:21:42 +01:00
$ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION"
2023-02-18 02:22:48 +01:00
X-RateLimit-Remaining:
2023-02-18 04:21:42 +01:00
$ref: "#/components/headers/X-RateLimit-Remaining"
2023-02-18 02:22:48 +01:00
X-RateLimit-Limit:
2023-02-18 04:21:42 +01:00
$ref: "#/components/headers/X-RateLimit-Limit"
content:
application/json:
schema:
$ref: "#/components/schemas/Product"
401:
2023-02-18 05:08:56 +01:00
$ref: '#/components/responses/401'
2023-02-18 04:21:42 +01:00
403:
2023-02-18 05:08:56 +01:00
$ref: '#/components/responses/403'
2023-02-18 02:22:48 +01:00
422:
2023-02-18 05:08:56 +01:00
$ref: '#/components/responses/422'
2023-04-29 15:10:45 +02:00
429:
$ref: '#/components/responses/429'
5XX:
description: 'Server error'
2023-02-18 02:22:48 +01:00
default:
2023-02-18 05:08:56 +01:00
$ref: '#/components/responses/default'
2023-02-18 04:21:42 +01:00
"/api/v1/products/create":
2023-02-18 02:22:48 +01:00
get:
tags:
- products
2023-02-18 04:21:42 +01:00
summary: "Blank product"
description: "Returns a blank product object with default values"
operationId: getProductsCreate
2023-02-18 02:22:48 +01:00
parameters:
2023-02-18 04:21:42 +01:00
- $ref: "#/components/parameters/X-API-TOKEN"
- $ref: "#/components/parameters/X-Requested-With"
- $ref: "#/components/parameters/include"
2023-02-18 02:22:48 +01:00
responses:
200:
2023-02-18 04:21:42 +01:00
description: "A blank Product object"
2023-02-18 02:22:48 +01:00
headers:
X-MINIMUM-CLIENT-VERSION:
2023-02-18 04:21:42 +01:00
$ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION"
2023-02-18 02:22:48 +01:00
X-RateLimit-Remaining:
2023-02-18 04:21:42 +01:00
$ref: "#/components/headers/X-RateLimit-Remaining"
2023-02-18 02:22:48 +01:00
X-RateLimit-Limit:
2023-02-18 04:21:42 +01:00
$ref: "#/components/headers/X-RateLimit-Limit"
content:
application/json:
schema:
$ref: "#/components/schemas/Product"
401:
2023-02-18 05:08:56 +01:00
$ref: '#/components/responses/401'
2023-02-18 04:21:42 +01:00
403:
2023-02-18 05:08:56 +01:00
$ref: '#/components/responses/403'
2023-02-18 02:22:48 +01:00
422:
2023-02-18 05:08:56 +01:00
$ref: '#/components/responses/422'
2023-04-29 15:10:45 +02:00
429:
$ref: '#/components/responses/429'
5XX:
description: 'Server error'
2023-02-18 02:22:48 +01:00
default:
2023-02-18 05:08:56 +01:00
$ref: '#/components/responses/default'
2023-02-18 04:21:42 +01:00
2023-02-18 02:22:48 +01:00
/api/v1/products/bulk:
post:
tags:
- products
2023-02-18 04:21:42 +01:00
summary: "Bulk product actions"
description: "Archive / Restore / Delete in bulk"
2023-02-18 02:22:48 +01:00
operationId: bulkProducts
parameters:
2023-02-18 04:21:42 +01:00
- $ref: "#/components/parameters/X-API-TOKEN"
- $ref: "#/components/parameters/X-Requested-With"
- $ref: "#/components/parameters/index"
2023-02-18 02:22:48 +01:00
requestBody:
2023-02-18 04:21:42 +01:00
description: "Hashed IDs"
2023-02-18 02:22:48 +01:00
required: true
content:
application/json:
schema:
type: array
items:
2023-02-18 04:21:42 +01:00
description: "Array of hashed IDs to be bulk 'actioned"
2023-02-18 02:22:48 +01:00
type: integer
2023-02-18 04:21:42 +01:00
example: "[0,1,2,3]"
2023-02-18 02:22:48 +01:00
responses:
200:
2023-02-18 04:21:42 +01:00
description: "The Product response"
2023-02-18 02:22:48 +01:00
headers:
X-MINIMUM-CLIENT-VERSION:
2023-02-18 04:21:42 +01:00
$ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION"
2023-02-18 02:22:48 +01:00
X-RateLimit-Remaining:
2023-02-18 04:21:42 +01:00
$ref: "#/components/headers/X-RateLimit-Remaining"
2023-02-18 02:22:48 +01:00
X-RateLimit-Limit:
2023-02-18 04:21:42 +01:00
$ref: "#/components/headers/X-RateLimit-Limit"
content:
application/json:
schema:
$ref: "#/components/schemas/Product"
401:
2023-02-18 05:08:56 +01:00
$ref: '#/components/responses/401'
2023-02-18 04:21:42 +01:00
403:
2023-02-18 05:08:56 +01:00
$ref: '#/components/responses/403'
2023-02-18 02:22:48 +01:00
422:
2023-02-18 05:08:56 +01:00
$ref: '#/components/responses/422'
2023-04-29 15:10:45 +02:00
429:
$ref: '#/components/responses/429'
5XX:
description: 'Server error'
2023-02-18 02:22:48 +01:00
default:
2023-02-18 05:08:56 +01:00
$ref: '#/components/responses/default'
2023-02-18 04:21:42 +01:00
"/api/v1/products/{id}/upload":
2023-02-18 02:22:48 +01:00
put:
tags:
- products
2023-02-18 04:21:42 +01:00
summary: "Add product document"
description: "Handles the uploading of a document to a product"
2023-02-18 02:22:48 +01:00
operationId: uploadProduct
parameters:
2023-02-18 04:21:42 +01:00
- $ref: "#/components/parameters/X-API-TOKEN"
- $ref: "#/components/parameters/X-Requested-With"
- $ref: "#/components/parameters/client_include"
- name: id
2023-02-18 02:22:48 +01:00
in: path
2023-02-18 04:21:42 +01:00
description: "The Product Hashed ID"
2023-02-18 02:22:48 +01:00
required: true
schema:
type: string
format: string
example: D2J234DFA
2023-02-18 04:21:42 +01:00
requestBody:
required: true
content:
multipart/form-data:
schema:
type: object
properties:
_method:
type: string
example: POST
documents:
type: array
2023-03-23 07:37:27 +01:00
items:
format: binary
2023-02-18 05:28:38 +01:00
responses:
2023-02-18 02:22:48 +01:00
200:
2023-02-18 04:21:42 +01:00
description: "Returns the Product object"
2023-02-18 02:22:48 +01:00
headers:
X-MINIMUM-CLIENT-VERSION:
2023-02-18 04:21:42 +01:00
$ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION"
2023-02-18 02:22:48 +01:00
X-RateLimit-Remaining:
2023-02-18 04:21:42 +01:00
$ref: "#/components/headers/X-RateLimit-Remaining"
2023-02-18 02:22:48 +01:00
X-RateLimit-Limit:
2023-02-18 04:21:42 +01:00
$ref: "#/components/headers/X-RateLimit-Limit"
content:
application/json:
schema:
$ref: "#/components/schemas/Product"
401:
2023-02-18 05:08:56 +01:00
$ref: '#/components/responses/401'
2023-02-18 04:21:42 +01:00
403:
2023-02-18 05:08:56 +01:00
$ref: '#/components/responses/403'
2023-02-18 02:22:48 +01:00
422:
2023-02-18 05:08:56 +01:00
$ref: '#/components/responses/422'
2023-04-29 15:10:45 +02:00
429:
$ref: '#/components/responses/429'
5XX:
description: 'Server error'
2023-02-18 02:22:48 +01:00
default:
2023-02-18 05:08:56 +01:00
$ref: '#/components/responses/default'