add responses into components

This commit is contained in:
David Bomba 2023-02-18 14:21:42 +11:00
parent e97b69d55c
commit 9f997e9bc4
10 changed files with 10430 additions and 12624 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,5 @@
description: 'Authentication error'
content:
application/json:
schema:
$ref: '#components/schemas/AuthenticationError'

View File

@ -0,0 +1,5 @@
description: 'Authorization error'
content:
application/json:
schema:
$ref: '#components/schemas/AuthorizationError'

View File

View File

@ -0,0 +1,5 @@
description: 'Validation error'
content:
application/json:
schema:
$ref: '#/components/schemas/ValidationError'

View File

@ -0,0 +1,5 @@
description: 'Unexpected Error'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'

View File

@ -1,25 +1,21 @@
tags: tags:
- - name: login
name: login
description: | description: |
Attempts to authenticate with the API using a email/password combination. Attempts to authenticate with the API using a email/password combination.
externalDocs: externalDocs:
description: 'Find out more' description: "Find out more"
url: 'https://invoiceninja.github.io' url: "https://invoiceninja.github.io"
- - name: clients
name: clients
description: | description: |
Endpoint definitions for interacting with clients. Endpoint definitions for interacting with clients.
- - name: products
name: products
description: | description: |
Endpoint definitions for interacting with products. Endpoint definitions for interacting with products.
- - name: invoices
name: invoices
description: | description: |
Endpoint definitions for interacting with invoices. Endpoint definitions for interacting with invoices.
externalDocs: externalDocs:
description: 'https://invoiceninja.github.io' description: "https://invoiceninja.github.io"
url: 'https://invoiceninja.github.io' url: "https://invoiceninja.github.io"
security: security:
- ApiKeyAuth: [] - ApiKeyAuth: []

File diff suppressed because it is too large Load Diff

View File

@ -7,72 +7,60 @@
Lists clients. Fine grained filtering is also available using query parameters. Lists clients. Fine grained filtering is also available using query parameters.
operationId: getClients operationId: getClients
parameters: parameters:
- - $ref: '#/components/parameters/X-API-TOKEN'
$ref: '#/components/parameters/X-API-TOKEN' - $ref: '#/components/parameters/X-Requested-With'
- - $ref: '#/components/parameters/client_include'
$ref: '#/components/parameters/X-Requested-With' - $ref: '#/components/parameters/index'
- - name: name
$ref: '#/components/parameters/client_include'
-
$ref: '#/components/parameters/index'
-
name: name
in: query in: query
description: Filter by client name description: Filter by client name
required: false required: false
schema: schema:
type: string type: string
example: bob example: bob
- - name: balance
name: balance
in: query in: query
description: Filter by client balance, format uses an operator and value separated by a colon. lt,lte, gt, gte, eq description: Filter by client balance, format uses an operator and value separated by a colon. lt,lte, gt, gte, eq
required: false required: false
schema: schema:
type: string type: string
example: lt:10 example: lt:10
- - name: between_balance
name: between_balance
in: query in: query
description: Filter between client balances, format uses two values separated by a colon description: Filter between client balances, format uses two values separated by a colon
required: false required: false
schema: schema:
type: string type: string
example: 10:100 example: 10:100
- - name: email
name: email
in: query in: query
description: Filter by client email description: Filter by client email
required: false required: false
schema: schema:
type: string type: string
example: bob@gmail.com example: bob@gmail.com
- - name: id_number
name: id_number
in: query in: query
description: Filter by client id_number description: Filter by client id_number
required: false required: false
schema: schema:
type: string type: string
example: a1039883 example: a1039883
- - name: number
name: number
in: query in: query
description: Filter by client number description: Filter by client number
required: false required: false
schema: schema:
type: string type: string
example: a1039883 example: a1039883
- - name: filter
name: filter
in: query in: query
description: Filters clients on columns - name, id_number, contact.first_name contact.last_name, contact.email, custom_value1-4 description: Filters clients on columns - name, id_number, contact.first_name contact.last_name, contact.email, custom_value1-4
required: false required: false
schema: schema:
type: string type: string
example: a1039883 example: a1039883
- - name: sort
name: sort
in: query in: query
description: Returns the list sorted by column in ascending or descending order. description: Returns the list sorted by column in ascending or descending order.
required: false required: false
@ -101,36 +89,21 @@
schema: schema:
$ref: '#components/schemas/AuthenticationError' $ref: '#components/schemas/AuthenticationError'
403: 403:
description: 'Authorization error' $ref: '#/components/responses/403'
content:
application/json:
schema:
$ref: '#components/schemas/AuthorizationError'
422: 422:
description: 'Validation error' $ref: '#/components/responses/422'
content:
application/json:
schema:
$ref: '#/components/schemas/ValidationError'
default: default:
description: 'Unexpected Error' $ref: '#/components/responses/default'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
post: post:
tags: tags:
- clients - clients
summary: 'Create client' summary: 'Create client'
description: 'Adds an client to a company' description: 'Adds a client to a company'
operationId: storeClient operationId: storeClient
parameters: parameters:
- - $ref: '#/components/parameters/X-API-TOKEN'
$ref: '#/components/parameters/X-API-TOKEN' - $ref: '#/components/parameters/X-Requested-With'
- - $ref: '#/components/parameters/client_include'
$ref: '#/components/parameters/X-Requested-With'
-
$ref: '#/components/parameters/client_include'
responses: responses:
200: 200:
description: 'Returns the saved client object' description: 'Returns the saved client object'
@ -152,23 +125,11 @@
schema: schema:
$ref: '#components/schemas/AuthenticationError' $ref: '#components/schemas/AuthenticationError'
403: 403:
description: 'Authorization error' $ref: '#/components/responses/403'
content:
application/json:
schema:
$ref: '#components/schemas/AuthorizationError'
422: 422:
description: 'Validation error' $ref: '#/components/responses/422'
content:
application/json:
schema:
$ref: '#/components/schemas/ValidationError'
default: default:
description: 'Unexpected Error' $ref: '#/components/responses/default'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'/api/v1/clients/{id}': '/api/v1/clients/{id}':
get: get:
tags: tags:
@ -177,74 +138,10 @@
description: 'Displays a client by id' description: 'Displays a client by id'
operationId: showClient operationId: showClient
parameters: parameters:
- - $ref: '#/components/parameters/X-API-TOKEN'
$ref: '#/components/parameters/X-API-TOKEN' - $ref: '#/components/parameters/X-Requested-With'
- - $ref: '#/components/parameters/client_include'
$ref: '#/components/parameters/X-Requested-With' - name: id
-
$ref: '#/components/parameters/client_include'
-
name: id
in: path
description: 'The Client Hashed ID'
required: true
schema:
type: string
format: string
example: D2J234DFA
responses:
200:
description: 'Returns the cl.ient 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/Client'
401:
description: 'Authentication error'
content:
application/json:
schema:
$ref: '#components/schemas/AuthenticationError'
403:
description: 'Authorization error'
content:
application/json:
schema:
$ref: '#components/schemas/AuthorizationError'
422:
description: 'Validation error'
content:
application/json:
schema:
$ref: '#/components/schemas/ValidationError'
default:
description: 'Unexpected Error'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
put:
tags:
- clients
summary: 'Update client'
description: 'Handles the updating of a client by id'
operationId: updateClient
parameters:
-
$ref: '#/components/parameters/X-API-TOKEN'
-
$ref: '#/components/parameters/X-Requested-With'
-
$ref: '#/components/parameters/client_include'
-
name: id
in: path in: path
description: 'The Client Hashed ID' description: 'The Client Hashed ID'
required: true required: true
@ -273,23 +170,55 @@
schema: schema:
$ref: '#components/schemas/AuthenticationError' $ref: '#components/schemas/AuthenticationError'
403: 403:
description: 'Authorization error' $ref: '#/components/responses/403'
content:
application/json:
schema:
$ref: '#components/schemas/AuthorizationError'
422: 422:
description: 'Validation error' $ref: '#/components/responses/422'
content:
application/json:
schema:
$ref: '#/components/schemas/ValidationError'
default: default:
description: 'Unexpected Error' $ref: '#/components/responses/default'
put:
tags:
- clients
summary: 'Update client'
description: 'Handles the updating of a client by id'
operationId: updateClient
parameters:
- $ref: '#/components/parameters/X-API-TOKEN'
- $ref: '#/components/parameters/X-Requested-With'
- $ref: '#/components/parameters/client_include'
- name: id
in: path
description: 'The Client Hashed ID'
required: true
schema:
type: string
format: string
example: D2J234DFA
responses:
200:
description: 'Returns the client 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: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/Error' $ref: '#/components/schemas/Client'
401:
description: 'Authentication error'
content:
application/json:
schema:
$ref: '#components/schemas/AuthenticationError'
403:
$ref: '#/components/responses/403'
422:
$ref: '#/components/responses/422'
default:
$ref: '#/components/responses/default'
delete: delete:
tags: tags:
- clients - clients
@ -297,14 +226,10 @@
description: 'Handles the deletion of a client by id' description: 'Handles the deletion of a client by id'
operationId: deleteClient operationId: deleteClient
parameters: parameters:
- - $ref: '#/components/parameters/X-API-TOKEN'
$ref: '#/components/parameters/X-API-TOKEN' - $ref: '#/components/parameters/X-Requested-With'
- - $ref: '#/components/parameters/client_include'
$ref: '#/components/parameters/X-Requested-With' - name: id
-
$ref: '#/components/parameters/client_include'
-
name: id
in: path in: path
description: 'The Client Hashed ID' description: 'The Client Hashed ID'
required: true required: true
@ -329,23 +254,11 @@
schema: schema:
$ref: '#components/schemas/AuthenticationError' $ref: '#components/schemas/AuthenticationError'
403: 403:
description: 'Authorization error' $ref: '#/components/responses/403'
content:
application/json:
schema:
$ref: '#components/schemas/AuthorizationError'
422: 422:
description: 'Validation error' $ref: '#/components/responses/422'
content:
application/json:
schema:
$ref: '#/components/schemas/ValidationError'
default: default:
description: 'Unexpected Error' $ref: '#/components/responses/default'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'/api/v1/clients/{id}/edit': '/api/v1/clients/{id}/edit':
get: get:
tags: tags:
@ -354,14 +267,10 @@
description: 'Displays a client by id' description: 'Displays a client by id'
operationId: editClient operationId: editClient
parameters: parameters:
- - $ref: '#/components/parameters/X-API-TOKEN'
$ref: '#/components/parameters/X-API-TOKEN' - $ref: '#/components/parameters/X-Requested-With'
- - $ref: '#/components/parameters/include'
$ref: '#/components/parameters/X-Requested-With' - name: id
-
$ref: '#/components/parameters/include'
-
name: id
in: path in: path
description: 'The Client Hashed ID' description: 'The Client Hashed ID'
required: true required: true
@ -390,23 +299,11 @@
schema: schema:
$ref: '#components/schemas/AuthenticationError' $ref: '#components/schemas/AuthenticationError'
403: 403:
description: 'Authorization error' $ref: '#/components/responses/403'
content:
application/json:
schema:
$ref: '#components/schemas/AuthorizationError'
422: 422:
description: 'Validation error' $ref: '#/components/responses/422'
content:
application/json:
schema:
$ref: '#/components/schemas/ValidationError'
default: default:
description: 'Unexpected Error' $ref: '#/components/responses/default'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/api/v1/clients/create: /api/v1/clients/create:
get: get:
tags: tags:
@ -415,12 +312,9 @@
description: 'Returns a blank object with default values' description: 'Returns a blank object with default values'
operationId: getClientsCreate operationId: getClientsCreate
parameters: parameters:
- - $ref: '#/components/parameters/X-API-TOKEN'
$ref: '#/components/parameters/X-API-TOKEN' - $ref: '#/components/parameters/X-Requested-With'
- - $ref: '#/components/parameters/client_include'
$ref: '#/components/parameters/X-Requested-With'
-
$ref: '#/components/parameters/client_include'
responses: responses:
200: 200:
description: 'A blank client object' description: 'A blank client object'
@ -442,37 +336,22 @@
schema: schema:
$ref: '#components/schemas/AuthenticationError' $ref: '#components/schemas/AuthenticationError'
403: 403:
description: 'Authorization error' $ref: '#/components/responses/403'
content:
application/json:
schema:
$ref: '#components/schemas/AuthorizationError'
422: 422:
description: 'Validation error' $ref: '#/components/responses/422'
content:
application/json:
schema:
$ref: '#/components/schemas/ValidationError'
default: default:
description: 'Unexpected Error' $ref: '#/components/responses/default'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/api/v1/clients/bulk: /api/v1/clients/bulk:
post: post:
tags: tags:
- clients - clients
summary: 'Bulk actions' summary: 'Bulk client actions'
description: '' description: 'Archive / Restore / Delete in bulk'
operationId: bulkClients operationId: bulkClients
parameters: parameters:
- - $ref: '#/components/parameters/X-API-TOKEN'
$ref: '#/components/parameters/X-API-TOKEN' - $ref: '#/components/parameters/X-Requested-With'
- - $ref: '#/components/parameters/index'
$ref: '#/components/parameters/X-Requested-With'
-
$ref: '#/components/parameters/index'
requestBody: requestBody:
description: 'User credentials' description: 'User credentials'
required: true required: true
@ -505,23 +384,11 @@
schema: schema:
$ref: '#components/schemas/AuthenticationError' $ref: '#components/schemas/AuthenticationError'
403: 403:
description: 'Authorization error' $ref: '#/components/responses/403'
content:
application/json:
schema:
$ref: '#components/schemas/AuthorizationError'
422: 422:
description: 'Validation error' $ref: '#/components/responses/422'
content:
application/json:
schema:
$ref: '#/components/schemas/ValidationError'
default: default:
description: 'Unexpected Error' $ref: '#/components/responses/default'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'/api/v1/clients/{id}/upload': '/api/v1/clients/{id}/upload':
put: put:
tags: tags:
@ -530,14 +397,10 @@
description: 'Handles the uploading of a document to a client, please note due to a quirk in REST you will need to use a _method parameter with value of POST' description: 'Handles the uploading of a document to a client, please note due to a quirk in REST you will need to use a _method parameter with value of POST'
operationId: uploadClient operationId: uploadClient
parameters: parameters:
- - $ref: '#/components/parameters/X-API-TOKEN'
$ref: '#/components/parameters/X-API-TOKEN' - $ref: '#/components/parameters/X-Requested-With'
- - $ref: '#/components/parameters/client_include'
$ref: '#/components/parameters/X-Requested-With' - name: id
-
$ref: '#/components/parameters/client_include'
-
name: id
in: path in: path
description: 'The Client Hashed ID' description: 'The Client Hashed ID'
required: true required: true
@ -581,23 +444,11 @@
schema: schema:
$ref: '#components/schemas/AuthenticationError' $ref: '#components/schemas/AuthenticationError'
403: 403:
description: 'Authorization error' $ref: '#/components/responses/403'
content:
application/json:
schema:
$ref: '#components/schemas/AuthorizationError'
422: 422:
description: 'Validation error' $ref: '#/components/responses/422'
content:
application/json:
schema:
$ref: '#/components/schemas/ValidationError'
default: default:
description: 'Unexpected Error' $ref: '#/components/responses/default'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'/api/v1/clients/{id}/purge': '/api/v1/clients/{id}/purge':
post: post:
tags: tags:
@ -606,14 +457,10 @@
description: 'Handles purging a client' description: 'Handles purging a client'
operationId: purgeClient operationId: purgeClient
parameters: parameters:
- - $ref: '#/components/parameters/X-API-TOKEN'
$ref: '#/components/parameters/X-API-TOKEN' - $ref: '#/components/parameters/X-Requested-With'
- - $ref: '#/components/parameters/client_include'
$ref: '#/components/parameters/X-Requested-With' - name: id
-
$ref: '#/components/parameters/client_include'
-
name: id
in: path in: path
description: 'The Client Hashed ID' description: 'The Client Hashed ID'
required: true required: true
@ -638,23 +485,11 @@
schema: schema:
$ref: '#components/schemas/AuthenticationError' $ref: '#components/schemas/AuthenticationError'
403: 403:
description: 'Authorization error' $ref: '#/components/responses/403'
content:
application/json:
schema:
$ref: '#components/schemas/AuthorizationError'
422: 422:
description: 'Validation error' $ref: '#/components/responses/422'
content:
application/json:
schema:
$ref: '#/components/schemas/ValidationError'
default: default:
description: 'Unexpected Error' $ref: '#/components/responses/default'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'/api/v1/clients/{id}/{mergeable_client_hashed_id}/merge': '/api/v1/clients/{id}/{mergeable_client_hashed_id}/merge':
post: post:
tags: tags:
@ -663,14 +498,10 @@
description: 'Handles merging 2 clients' description: 'Handles merging 2 clients'
operationId: mergeClient operationId: mergeClient
parameters: parameters:
- - $ref: '#/components/parameters/X-API-TOKEN'
$ref: '#/components/parameters/X-API-TOKEN' - $ref: '#/components/parameters/X-Requested-With'
- - $ref: '#/components/parameters/client_include'
$ref: '#/components/parameters/X-Requested-With' - name: id
-
$ref: '#/components/parameters/client_include'
-
name: id
in: path in: path
description: 'The Client Hashed ID' description: 'The Client Hashed ID'
required: true required: true
@ -678,8 +509,7 @@
type: string type: string
format: string format: string
example: D2J234DFA example: D2J234DFA
- - name: mergeable_client_hashed_id
name: mergeable_client_hashed_id
in: path in: path
description: 'The Mergeable Client Hashed ID' description: 'The Mergeable Client Hashed ID'
required: true required: true
@ -704,23 +534,11 @@
schema: schema:
$ref: '#components/schemas/AuthenticationError' $ref: '#components/schemas/AuthenticationError'
403: 403:
description: 'Authorization error' $ref: '#/components/responses/403'
content:
application/json:
schema:
$ref: '#components/schemas/AuthorizationError'
422: 422:
description: 'Validation error' $ref: '#/components/responses/422'
content:
application/json:
schema:
$ref: '#/components/schemas/ValidationError'
default: default:
description: 'Unexpected Error' $ref: '#/components/responses/default'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/api/v1/client_statement: /api/v1/client_statement:
post: post:
tags: tags:
@ -729,12 +547,9 @@
description: 'Return a PDF of the client statement' description: 'Return a PDF of the client statement'
operationId: clientStatement operationId: clientStatement
parameters: parameters:
- - $ref: '#/components/parameters/X-API-TOKEN'
$ref: '#/components/parameters/X-API-TOKEN' - $ref: '#/components/parameters/X-Requested-With'
- - $ref: '#/components/parameters/include'
$ref: '#/components/parameters/X-Requested-With'
-
$ref: '#/components/parameters/include'
requestBody: requestBody:
description: 'Statment Options' description: 'Statment Options'
required: true required: true
@ -773,26 +588,10 @@
schema: schema:
$ref: '#/components/schemas/Client' $ref: '#/components/schemas/Client'
401: 401:
description: 'Authentication error' $ref: '#/components/responses/401'
content:
application/json:
schema:
$ref: '#components/schemas/AuthenticationError'
403: 403:
description: 'Authorization error' $ref: '#/components/responses/403'
content:
application/json:
schema:
$ref: '#components/schemas/AuthorizationError'
422: 422:
description: 'Validation error' $ref: '#/components/responses/422'
content:
application/json:
schema:
$ref: '#/components/schemas/ValidationError'
default: default:
description: 'Unexpected Error' $ref: '#/components/responses/default'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'

View File

@ -2,139 +2,104 @@
get: get:
tags: tags:
- products - products
summary: 'List products' summary: "List products"
description: "Lists products, search and filters allow fine grained lists to be generated.\n\n Query parameters can be added to performed more fine grained filtering of the products, these are handled by the ProductFilters class which defines the methods available" 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
operationId: getProducts operationId: getProducts
parameters: parameters:
- - $ref: "#/components/parameters/X-API-TOKEN"
$ref: '#/components/parameters/X-API-TOKEN' - $ref: "#/components/parameters/X-Requested-With"
- - $ref: "#/components/parameters/include"
$ref: '#/components/parameters/X-Requested-With'
-
$ref: '#/components/parameters/include'
responses: responses:
200: 200:
description: 'A list of products' description: "A list of products"
headers: headers:
X-MINIMUM-CLIENT-VERSION: X-MINIMUM-CLIENT-VERSION:
$ref: '#/components/headers/X-MINIMUM-CLIENT-VERSION' $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION"
X-RateLimit-Remaining: X-RateLimit-Remaining:
$ref: '#/components/headers/X-RateLimit-Remaining' $ref: "#/components/headers/X-RateLimit-Remaining"
X-RateLimit-Limit: X-RateLimit-Limit:
$ref: '#/components/headers/X-RateLimit-Limit' $ref: "#/components/headers/X-RateLimit-Limit"
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/Product' $ref: "#/components/schemas/Product"
401:
description: "Authentication error"
content:
application/json:
schema:
$ref: "#components/schemas/AuthenticationError"
403:
description: "Authorization error"
content:
application/json:
schema:
$ref: "#components/schemas/AuthorizationError"
422: 422:
description: 'Validation error' description: "Validation error"
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/ValidationError' $ref: "#/components/schemas/ValidationError"
default: default:
description: 'Unexpected Error' description: "Unexpected Error"
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/Error' $ref: "#/components/schemas/Error"
post: post:
tags: tags:
- products - products
summary: 'Create Product' summary: "Create Product"
description: 'Adds an Product to the system' description: "Adds a product to a company"
operationId: storeProduct operationId: storeProduct
parameters: parameters:
- - $ref: "#/components/parameters/X-API-TOKEN"
$ref: '#/components/parameters/X-API-TOKEN' - $ref: "#/components/parameters/X-Requested-With"
- - $ref: "#/components/parameters/include"
$ref: '#/components/parameters/X-Requested-With'
-
$ref: '#/components/parameters/include'
responses: responses:
200: 200:
description: 'Returns the saved Product object' description: "Returns the saved product object"
headers: headers:
X-MINIMUM-CLIENT-VERSION: X-MINIMUM-CLIENT-VERSION:
$ref: '#/components/headers/X-MINIMUM-CLIENT-VERSION' $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION"
X-RateLimit-Remaining: X-RateLimit-Remaining:
$ref: '#/components/headers/X-RateLimit-Remaining' $ref: "#/components/headers/X-RateLimit-Remaining"
X-RateLimit-Limit: X-RateLimit-Limit:
$ref: '#/components/headers/X-RateLimit-Limit' $ref: "#/components/headers/X-RateLimit-Limit"
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/Product' $ref: "#/components/schemas/Product"
422: 422:
description: 'Validation error' description: "Validation error"
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/ValidationError' $ref: "#/components/schemas/ValidationError"
default: default:
description: 'Unexpected Error' description: "Unexpected Error"
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/Error' $ref: "#/components/schemas/Error"
/api/v1/products/create: "/api/v1/products/{id}":
get: get:
tags: tags:
- products - products
summary: 'Create product' summary: "Show product"
description: 'Returns a blank object with default values' description: "Displays a product by id"
operationId: getProductsCreate
parameters:
-
$ref: '#/components/parameters/X-API-TOKEN'
-
$ref: '#/components/parameters/X-Requested-With'
-
$ref: '#/components/parameters/include'
responses:
200:
description: 'A blank Product 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/Product'
422:
description: 'Validation error'
content:
application/json:
schema:
$ref: '#/components/schemas/ValidationError'
default:
description: 'Unexpected Error'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'/api/v1/products/{id}':
get:
tags:
- products
summary: 'Show product'
description: 'Displays an Product by id'
operationId: showProduct operationId: showProduct
parameters: parameters:
- - $ref: "#/components/parameters/X-API-TOKEN"
$ref: '#/components/parameters/X-API-TOKEN' - $ref: "#/components/parameters/X-Requested-With"
- - $ref: "#/components/parameters/include"
$ref: '#/components/parameters/X-Requested-With' - name: id
-
$ref: '#/components/parameters/include'
-
name: id
in: path in: path
description: 'The Product Hashed ID' description: "The Product Hashed ID"
required: true required: true
schema: schema:
type: string type: string
@ -142,47 +107,55 @@
example: D2J234DFA example: D2J234DFA
responses: responses:
200: 200:
description: 'Returns the Product object' description: "Returns the product object"
headers: headers:
X-MINIMUM-CLIENT-VERSION: X-MINIMUM-CLIENT-VERSION:
$ref: '#/components/headers/X-MINIMUM-CLIENT-VERSION' $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION"
X-RateLimit-Remaining: X-RateLimit-Remaining:
$ref: '#/components/headers/X-RateLimit-Remaining' $ref: "#/components/headers/X-RateLimit-Remaining"
X-RateLimit-Limit: X-RateLimit-Limit:
$ref: '#/components/headers/X-RateLimit-Limit' $ref: "#/components/headers/X-RateLimit-Limit"
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/Product' $ref: "#/components/schemas/Product"
401:
description: "Authentication error"
content:
application/json:
schema:
$ref: "#components/schemas/AuthenticationError"
403:
description: "Authorization error"
content:
application/json:
schema:
$ref: "#components/schemas/AuthorizationError"
422: 422:
description: 'Validation error' description: "Validation error"
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/ValidationError' $ref: "#/components/schemas/ValidationError"
default: default:
description: 'Unexpected Error' description: "Unexpected Error"
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/Error' $ref: "#/components/schemas/Error"
put: put:
tags: tags:
- products - products
summary: 'Update product' summary: "Update product"
description: 'Handles the updating of an Product by id' description: "Handles the updating of a product by id"
operationId: updateProduct operationId: updateProduct
parameters: parameters:
- - $ref: "#/components/parameters/X-API-TOKEN"
$ref: '#/components/parameters/X-API-TOKEN' - $ref: "#/components/parameters/X-Requested-With"
- - $ref: "#/components/parameters/include"
$ref: '#/components/parameters/X-Requested-With' - name: id
-
$ref: '#/components/parameters/include'
-
name: id
in: path in: path
description: 'The Product Hashed ID' description: "The Product Hashed ID"
required: true required: true
schema: schema:
type: string type: string
@ -190,47 +163,55 @@
example: D2J234DFA example: D2J234DFA
responses: responses:
200: 200:
description: 'Returns the Product object' description: "Returns the Product object"
headers: headers:
X-MINIMUM-CLIENT-VERSION: X-MINIMUM-CLIENT-VERSION:
$ref: '#/components/headers/X-MINIMUM-CLIENT-VERSION' $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION"
X-RateLimit-Remaining: X-RateLimit-Remaining:
$ref: '#/components/headers/X-RateLimit-Remaining' $ref: "#/components/headers/X-RateLimit-Remaining"
X-RateLimit-Limit: X-RateLimit-Limit:
$ref: '#/components/headers/X-RateLimit-Limit' $ref: "#/components/headers/X-RateLimit-Limit"
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/Product' $ref: "#/components/schemas/Product"
401:
description: "Authentication error"
content:
application/json:
schema:
$ref: "#components/schemas/AuthenticationError"
403:
description: "Authorization error"
content:
application/json:
schema:
$ref: "#components/schemas/AuthorizationError"
422: 422:
description: 'Validation error' description: "Validation error"
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/ValidationError' $ref: "#/components/schemas/ValidationError"
default: default:
description: 'Unexpected Error' description: "Unexpected Error"
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/Error' $ref: "#/components/schemas/Error"
delete: delete:
tags: tags:
- products - products
summary: 'Delete product' summary: "Delete product"
description: 'Handles the deletion of an Product by id' description: "Handles the deletion of a product by id"
operationId: deleteProduct operationId: deleteProduct
parameters: parameters:
- - $ref: "#/components/parameters/X-API-TOKEN"
$ref: '#/components/parameters/X-API-TOKEN' - $ref: "#/components/parameters/X-Requested-With"
- - $ref: "#/components/parameters/include"
$ref: '#/components/parameters/X-Requested-With' - name: id
-
$ref: '#/components/parameters/include'
-
name: id
in: path in: path
description: 'The Product Hashed ID' description: "The Product Hashed ID"
required: true required: true
schema: schema:
type: string type: string
@ -238,44 +219,52 @@
example: D2J234DFA example: D2J234DFA
responses: responses:
200: 200:
description: 'Returns a HTTP status' description: "Returns a HTTP status"
headers: headers:
X-MINIMUM-CLIENT-VERSION: X-MINIMUM-CLIENT-VERSION:
$ref: '#/components/headers/X-MINIMUM-CLIENT-VERSION' $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION"
X-RateLimit-Remaining: X-RateLimit-Remaining:
$ref: '#/components/headers/X-RateLimit-Remaining' $ref: "#/components/headers/X-RateLimit-Remaining"
X-RateLimit-Limit: X-RateLimit-Limit:
$ref: '#/components/headers/X-RateLimit-Limit' $ref: "#/components/headers/X-RateLimit-Limit"
401:
description: "Authentication error"
content:
application/json:
schema:
$ref: "#components/schemas/AuthenticationError"
403:
description: "Authorization error"
content:
application/json:
schema:
$ref: "#components/schemas/AuthorizationError"
422: 422:
description: 'Validation error' description: "Validation error"
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/ValidationError' $ref: "#/components/schemas/ValidationError"
default: default:
description: 'Unexpected Error' description: "Unexpected Error"
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/Error' $ref: "#/components/schemas/Error"
'/api/v1/products/{id}/edit': "/api/v1/products/{id}/edit":
get: get:
tags: tags:
- products - products
summary: 'Edit product' summary: "Edit product"
description: 'Displays an Product by id' description: "Displays an Product by id"
operationId: editProduct operationId: editProduct
parameters: parameters:
- - $ref: "#/components/parameters/X-API-TOKEN"
$ref: '#/components/parameters/X-API-TOKEN' - $ref: "#/components/parameters/X-Requested-With"
- - $ref: "#/components/parameters/include"
$ref: '#/components/parameters/X-Requested-With' - name: id
-
$ref: '#/components/parameters/include'
-
name: id
in: path in: path
description: 'The Product Hashed ID' description: "The Product Hashed ID"
required: true required: true
schema: schema:
type: string type: string
@ -283,127 +272,221 @@
example: D2J234DFA example: D2J234DFA
responses: responses:
200: 200:
description: 'Returns the Product object' description: "Returns the Product object"
headers: headers:
X-MINIMUM-CLIENT-VERSION: X-MINIMUM-CLIENT-VERSION:
$ref: '#/components/headers/X-MINIMUM-CLIENT-VERSION' $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION"
X-RateLimit-Remaining: X-RateLimit-Remaining:
$ref: '#/components/headers/X-RateLimit-Remaining' $ref: "#/components/headers/X-RateLimit-Remaining"
X-RateLimit-Limit: X-RateLimit-Limit:
$ref: '#/components/headers/X-RateLimit-Limit' $ref: "#/components/headers/X-RateLimit-Limit"
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/Product' $ref: "#/components/schemas/Product"
401:
description: "Authentication error"
content:
application/json:
schema:
$ref: "#components/schemas/AuthenticationError"
403:
description: "Authorization error"
content:
application/json:
schema:
$ref: "#components/schemas/AuthorizationError"
422: 422:
description: 'Validation error' description: "Validation error"
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/ValidationError' $ref: "#/components/schemas/ValidationError"
default: default:
description: 'Unexpected Error' description: "Unexpected Error"
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/Error' $ref: "#/components/schemas/Error"
"/api/v1/products/create":
get:
tags:
- products
summary: "Blank product"
description: "Returns a blank product object with default values"
operationId: getProductsCreate
parameters:
- $ref: "#/components/parameters/X-API-TOKEN"
- $ref: "#/components/parameters/X-Requested-With"
- $ref: "#/components/parameters/include"
responses:
200:
description: "A blank Product 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/Product"
401:
description: "Authentication error"
content:
application/json:
schema:
$ref: "#components/schemas/AuthenticationError"
403:
description: "Authorization error"
content:
application/json:
schema:
$ref: "#components/schemas/AuthorizationError"
422:
description: "Validation error"
content:
application/json:
schema:
$ref: "#/components/schemas/ValidationError"
default:
description: "Unexpected Error"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/api/v1/products/bulk: /api/v1/products/bulk:
post: post:
tags: tags:
- products - products
summary: 'Bulk product actions' summary: "Bulk product actions"
description: '' description: "Archive / Restore / Delete in bulk"
operationId: bulkProducts operationId: bulkProducts
parameters: parameters:
- - $ref: "#/components/parameters/X-API-TOKEN"
$ref: '#/components/parameters/X-API-TOKEN' - $ref: "#/components/parameters/X-Requested-With"
- - $ref: "#/components/parameters/index"
$ref: '#/components/parameters/X-Requested-With'
-
$ref: '#/components/parameters/index'
requestBody: requestBody:
description: 'Hashed IDs' description: "Hashed IDs"
required: true required: true
content: content:
application/json: application/json:
schema: schema:
type: array type: array
items: items:
description: 'Array of hashed IDs to be bulk ''actioned' description: "Array of hashed IDs to be bulk 'actioned"
type: integer type: integer
example: '[0,1,2,3]' example: "[0,1,2,3]"
responses: responses:
200: 200:
description: 'The Product response' description: "The Product response"
headers: headers:
X-MINIMUM-CLIENT-VERSION: X-MINIMUM-CLIENT-VERSION:
$ref: '#/components/headers/X-MINIMUM-CLIENT-VERSION' $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION"
X-RateLimit-Remaining: X-RateLimit-Remaining:
$ref: '#/components/headers/X-RateLimit-Remaining' $ref: "#/components/headers/X-RateLimit-Remaining"
X-RateLimit-Limit: X-RateLimit-Limit:
$ref: '#/components/headers/X-RateLimit-Limit' $ref: "#/components/headers/X-RateLimit-Limit"
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/Product' $ref: "#/components/schemas/Product"
401:
description: "Authentication error"
content:
application/json:
schema:
$ref: "#components/schemas/AuthenticationError"
403:
description: "Authorization error"
content:
application/json:
schema:
$ref: "#components/schemas/AuthorizationError"
422: 422:
description: 'Validation error' description: "Validation error"
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/ValidationError' $ref: "#/components/schemas/ValidationError"
default: default:
description: 'Unexpected Error' description: "Unexpected Error"
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/Error' $ref: "#/components/schemas/Error"
'/api/v1/products/{id}/upload':
"/api/v1/products/{id}/upload":
put: put:
tags: tags:
- products - products
summary: 'Add product document' summary: "Add product document"
description: 'Handles the uploading of a document to a product' description: "Handles the uploading of a document to a product"
operationId: uploadProduct operationId: uploadProduct
parameters: parameters:
- - $ref: "#/components/parameters/X-API-TOKEN"
$ref: '#/components/parameters/X-API-TOKEN' - $ref: "#/components/parameters/X-Requested-With"
- - $ref: "#/components/parameters/client_include"
$ref: '#/components/parameters/X-Requested-With' - name: id
-
$ref: '#/components/parameters/include'
-
name: id
in: path in: path
description: 'The Product Hashed ID' description: "The Product Hashed ID"
required: true required: true
schema: schema:
type: string type: string
format: string format: string
example: D2J234DFA example: D2J234DFA
responses: produces:
- application/json
requestBody:
required: true
content:
multipart/form-data:
schema:
type: object
properties:
_method:
type: string
example: POST
documents:
type: array
format: binary
200: 200:
description: 'Returns the Product object' description: "Returns the Product object"
headers: headers:
X-MINIMUM-CLIENT-VERSION: X-MINIMUM-CLIENT-VERSION:
$ref: '#/components/headers/X-MINIMUM-CLIENT-VERSION' $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION"
X-RateLimit-Remaining: X-RateLimit-Remaining:
$ref: '#/components/headers/X-RateLimit-Remaining' $ref: "#/components/headers/X-RateLimit-Remaining"
X-RateLimit-Limit: X-RateLimit-Limit:
$ref: '#/components/headers/X-RateLimit-Limit' $ref: "#/components/headers/X-RateLimit-Limit"
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/Product' $ref: "#/components/schemas/Product"
401:
description: "Authentication error"
content:
application/json:
schema:
$ref: "#components/schemas/AuthenticationError"
403:
description: "Authorization error"
content:
application/json:
schema:
$ref: "#components/schemas/AuthorizationError"
422: 422:
description: 'Validation error' description: "Validation error"
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/ValidationError' $ref: "#/components/schemas/ValidationError"
default: default:
description: 'Unexpected Error' description: "Unexpected Error"
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/Error' $ref: "#/components/schemas/Error"