From d8bdb0c2fd60b831451b5f017249e63293d94fde Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sat, 18 Feb 2023 12:22:48 +1100 Subject: [PATCH] Product API Docs --- openapi/api-docs.yaml | 1022 ++++++++++++++++++----------------- openapi/paths.yaml | 410 +------------- openapi/paths/clients.yaml | 17 +- openapi/paths/products.yaml | 409 ++++++++++++++ 4 files changed, 945 insertions(+), 913 deletions(-) create mode 100644 openapi/paths/products.yaml diff --git a/openapi/api-docs.yaml b/openapi/api-docs.yaml index 610cdeb68639..70020b625e5c 100644 --- a/openapi/api-docs.yaml +++ b/openapi/api-docs.yaml @@ -6864,415 +6864,7 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - /api/v1/products: - get: - tags: - - products - summary: 'Gets a list of 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" - operationId: getProducts - parameters: - - - $ref: '#/components/parameters/X-API-TOKEN' - - - $ref: '#/components/parameters/X-Requested-With' - - - $ref: '#/components/parameters/include' - responses: - 200: - description: 'A list of products' - 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' - post: - tags: - - products - summary: 'Adds a Product' - description: 'Adds an Product to the system' - operationId: storeProduct - parameters: - - - $ref: '#/components/parameters/X-API-TOKEN' - - - $ref: '#/components/parameters/X-Requested-With' - - - $ref: '#/components/parameters/include' - responses: - 200: - description: 'Returns the saved 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/create: - get: - tags: - - products - summary: 'Gets a new blank Product object' - description: 'Returns a blank 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' - 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: 'Shows an Product' - description: 'Displays an Product by id' - operationId: showProduct - parameters: - - - $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 - responses: - 200: - description: 'Returns the 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' - put: - tags: - - products - summary: 'Updates an Product' - description: 'Handles the updating of an Product by id' - operationId: updateProduct - parameters: - - - $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 - responses: - 200: - description: 'Returns the 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' - delete: - tags: - - products - summary: 'Deletes a Product' - description: 'Handles the deletion of an Product by id' - operationId: deleteProduct - parameters: - - - $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 - 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' - 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}/edit': - get: - tags: - - products - summary: 'Shows an Product for editting' - description: 'Displays an Product by id' - operationId: editProduct - parameters: - - - $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 - responses: - 200: - description: 'Returns the 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/bulk: - post: - tags: - - products - summary: 'Performs bulk actions on an array of products' - description: '' - operationId: bulkProducts - parameters: - - - $ref: '#/components/parameters/X-API-TOKEN' - - - $ref: '#/components/parameters/X-Requested-With' - - - $ref: '#/components/parameters/index' - requestBody: - description: 'Hashed IDs' - required: true - content: - application/json: - schema: - type: array - items: - description: 'Array of hashed IDs to be bulk ''actioned' - type: integer - example: '[0,1,2,3]' - responses: - 200: - description: 'The Product response' - 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}/upload': - put: - tags: - - products - summary: 'Uploads a document to a product' - description: 'Handles the uploading of a document to a product' - operationId: uploadProduct - parameters: - - - $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 - responses: - 200: - description: 'Returns the 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/projects: get: tags: @@ -14296,6 +13888,415 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + /api/v1/products: + get: + tags: + - 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" + operationId: getProducts + parameters: + - + $ref: '#/components/parameters/X-API-TOKEN' + - + $ref: '#/components/parameters/X-Requested-With' + - + $ref: '#/components/parameters/include' + responses: + 200: + description: 'A list of products' + 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' + post: + tags: + - products + summary: 'Create Product' + description: 'Adds an Product to the system' + operationId: storeProduct + parameters: + - + $ref: '#/components/parameters/X-API-TOKEN' + - + $ref: '#/components/parameters/X-Requested-With' + - + $ref: '#/components/parameters/include' + responses: + 200: + description: 'Returns the saved 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/create: + get: + tags: + - products + summary: 'Create product' + description: 'Returns a blank 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' + 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 + parameters: + - + $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 + responses: + 200: + description: 'Returns the 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' + put: + tags: + - products + summary: 'Update product' + description: 'Handles the updating of an Product by id' + operationId: updateProduct + parameters: + - + $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 + responses: + 200: + description: 'Returns the 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' + delete: + tags: + - products + summary: 'Delete product' + description: 'Handles the deletion of an Product by id' + operationId: deleteProduct + parameters: + - + $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 + 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' + 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}/edit': + get: + tags: + - products + summary: 'Show product' + description: 'Displays an Product by id' + operationId: editProduct + parameters: + - + $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 + responses: + 200: + description: 'Returns the 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/bulk: + post: + tags: + - products + summary: 'Bulk product actions' + description: '' + operationId: bulkProducts + parameters: + - + $ref: '#/components/parameters/X-API-TOKEN' + - + $ref: '#/components/parameters/X-Requested-With' + - + $ref: '#/components/parameters/index' + requestBody: + description: 'Hashed IDs' + required: true + content: + application/json: + schema: + type: array + items: + description: 'Array of hashed IDs to be bulk ''actioned' + type: integer + example: '[0,1,2,3]' + responses: + 200: + description: 'The Product response' + 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}/upload': + put: + tags: + - products + summary: 'Add product document' + description: 'Handles the uploading of a document to a product' + operationId: uploadProduct + parameters: + - + $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 + responses: + 200: + description: 'Returns the 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/clients: get: tags: @@ -14825,7 +14826,7 @@ paths: tags: - clients summary: 'Add client document' - description: 'Handles the uploading of a document to a client' + 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 parameters: - @@ -14843,6 +14844,21 @@ paths: type: string format: string example: D2J234DFA + produces: + - application/json + requestBody: + required: true + content: + multipart/form-data: + schema: + type: object + properties: + _method: + type: string + example: POST + documents: + type: array + format: binary responses: 200: description: 'Returns the client object' @@ -19139,99 +19155,6 @@ components: type: string example: JSON type: object - Activity: - properties: - id: - description: 'The id field of the activity' - type: string - example: Opnel5aKBz - activity_type_id: - description: 'The activity type id' - type: string - example: Opnel5aKBz - client_id: - description: 'The client hashed id' - type: string - example: Opnel5aKBz - company_id: - description: 'The company hashed id' - type: string - example: Opnel5aKBz - user_id: - description: 'The user hashed id' - type: string - example: Opnel5aKBz - invoice_id: - description: 'The invoice hashed id' - type: string - example: Opnel5aKBz - payment_id: - description: 'The payment hashed id' - type: string - example: Opnel5aKBz - credit_id: - description: 'The credit hashed id' - type: string - example: Opnel5aKBz - updated_at: - description: 'Unixtimestamp the last time the record was updated' - type: integer - example: '343421434' - expense_id: - description: 'The expense hashed id' - type: string - example: Opnel5aKBz - is_system: - description: 'Defines is the activity was performed by the system' - type: boolean - example: true - contact_id: - description: 'The contact hashed id' - type: string - example: Opnel5aKBz - task_id: - description: 'The task hashed id' - type: string - example: Opnel5aKBz - notes: - description: 'Activity Notes' - type: string - example: Opnel5aKBz - token_id: - description: 'The hashed ID of the token who performed the action' - type: string - example: Opnel5aKBz - ip: - description: 'The IP Address of the user who performed the action' - type: string - example: 192.168.1.252 - user: - $ref: '#/components/schemas/User' - client: - $ref: '#/components/schemas/Client' - contact: - $ref: '#/components/schemas/ClientContact' - recurring_invoice: - $ref: '#/components/schemas/RecurringInvoice' - invoice: - $ref: '#/components/schemas/Invoice' - credit: - $ref: '#/components/schemas/Credit' - quote: - $ref: '#/components/schemas/Quote' - payment: - $ref: '#/components/schemas/Payment' - expense: - $ref: '#/components/schemas/Expense' - task: - $ref: '#/components/schemas/Task' - purchase_order: - $ref: '#/components/schemas/PurchaseOrder' - vendor: - $ref: '#/components/schemas/Vendor' - vendor_contact: - $ref: '#/components/schemas/VendorContact' - type: object BankTransaction: properties: id: @@ -19334,6 +19257,99 @@ components: type: string example: USD type: object + Activity: + properties: + id: + description: 'The id field of the activity' + type: string + example: Opnel5aKBz + activity_type_id: + description: 'The activity type id' + type: string + example: Opnel5aKBz + client_id: + description: 'The client hashed id' + type: string + example: Opnel5aKBz + company_id: + description: 'The company hashed id' + type: string + example: Opnel5aKBz + user_id: + description: 'The user hashed id' + type: string + example: Opnel5aKBz + invoice_id: + description: 'The invoice hashed id' + type: string + example: Opnel5aKBz + payment_id: + description: 'The payment hashed id' + type: string + example: Opnel5aKBz + credit_id: + description: 'The credit hashed id' + type: string + example: Opnel5aKBz + updated_at: + description: 'Unixtimestamp the last time the record was updated' + type: integer + example: '343421434' + expense_id: + description: 'The expense hashed id' + type: string + example: Opnel5aKBz + is_system: + description: 'Defines is the activity was performed by the system' + type: boolean + example: true + contact_id: + description: 'The contact hashed id' + type: string + example: Opnel5aKBz + task_id: + description: 'The task hashed id' + type: string + example: Opnel5aKBz + notes: + description: 'Activity Notes' + type: string + example: Opnel5aKBz + token_id: + description: 'The hashed ID of the token who performed the action' + type: string + example: Opnel5aKBz + ip: + description: 'The IP Address of the user who performed the action' + type: string + example: 192.168.1.252 + user: + $ref: '#/components/schemas/User' + client: + $ref: '#/components/schemas/Client' + contact: + $ref: '#/components/schemas/ClientContact' + recurring_invoice: + $ref: '#/components/schemas/RecurringInvoice' + invoice: + $ref: '#/components/schemas/Invoice' + credit: + $ref: '#/components/schemas/Credit' + quote: + $ref: '#/components/schemas/Quote' + payment: + $ref: '#/components/schemas/Payment' + expense: + $ref: '#/components/schemas/Expense' + task: + $ref: '#/components/schemas/Task' + purchase_order: + $ref: '#/components/schemas/PurchaseOrder' + vendor: + $ref: '#/components/schemas/Vendor' + vendor_contact: + $ref: '#/components/schemas/VendorContact' + type: object BTRules: properties: data_key: diff --git a/openapi/paths.yaml b/openapi/paths.yaml index dde3fb5d2f2f..382a4cf1cdee 100644 --- a/openapi/paths.yaml +++ b/openapi/paths.yaml @@ -6840,415 +6840,7 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - /api/v1/products: - get: - tags: - - products - summary: 'Gets a list of 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" - operationId: getProducts - parameters: - - - $ref: '#/components/parameters/X-API-TOKEN' - - - $ref: '#/components/parameters/X-Requested-With' - - - $ref: '#/components/parameters/include' - responses: - 200: - description: 'A list of products' - 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' - post: - tags: - - products - summary: 'Adds a Product' - description: 'Adds an Product to the system' - operationId: storeProduct - parameters: - - - $ref: '#/components/parameters/X-API-TOKEN' - - - $ref: '#/components/parameters/X-Requested-With' - - - $ref: '#/components/parameters/include' - responses: - 200: - description: 'Returns the saved 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/create: - get: - tags: - - products - summary: 'Gets a new blank Product object' - description: 'Returns a blank 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' - 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: 'Shows an Product' - description: 'Displays an Product by id' - operationId: showProduct - parameters: - - - $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 - responses: - 200: - description: 'Returns the 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' - put: - tags: - - products - summary: 'Updates an Product' - description: 'Handles the updating of an Product by id' - operationId: updateProduct - parameters: - - - $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 - responses: - 200: - description: 'Returns the 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' - delete: - tags: - - products - summary: 'Deletes a Product' - description: 'Handles the deletion of an Product by id' - operationId: deleteProduct - parameters: - - - $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 - 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' - 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}/edit': - get: - tags: - - products - summary: 'Shows an Product for editting' - description: 'Displays an Product by id' - operationId: editProduct - parameters: - - - $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 - responses: - 200: - description: 'Returns the 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/bulk: - post: - tags: - - products - summary: 'Performs bulk actions on an array of products' - description: '' - operationId: bulkProducts - parameters: - - - $ref: '#/components/parameters/X-API-TOKEN' - - - $ref: '#/components/parameters/X-Requested-With' - - - $ref: '#/components/parameters/index' - requestBody: - description: 'Hashed IDs' - required: true - content: - application/json: - schema: - type: array - items: - description: 'Array of hashed IDs to be bulk ''actioned' - type: integer - example: '[0,1,2,3]' - responses: - 200: - description: 'The Product response' - 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}/upload': - put: - tags: - - products - summary: 'Uploads a document to a product' - description: 'Handles the uploading of a document to a product' - operationId: uploadProduct - parameters: - - - $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 - responses: - 200: - description: 'Returns the 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/projects: get: tags: diff --git a/openapi/paths/clients.yaml b/openapi/paths/clients.yaml index 5249c95f18e9..41f50989853f 100644 --- a/openapi/paths/clients.yaml +++ b/openapi/paths/clients.yaml @@ -527,7 +527,7 @@ tags: - clients summary: 'Add client document' - description: 'Handles the uploading of a document to a client' + 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 parameters: - @@ -545,6 +545,21 @@ type: string format: string example: D2J234DFA + produces: + - application/json + requestBody: + required: true + content: + multipart/form-data: + schema: + type: object + properties: + _method: + type: string + example: POST + documents: + type: array + format: binary responses: 200: description: 'Returns the client object' diff --git a/openapi/paths/products.yaml b/openapi/paths/products.yaml new file mode 100644 index 000000000000..853c285b91c6 --- /dev/null +++ b/openapi/paths/products.yaml @@ -0,0 +1,409 @@ + /api/v1/products: + get: + tags: + - 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" + operationId: getProducts + parameters: + - + $ref: '#/components/parameters/X-API-TOKEN' + - + $ref: '#/components/parameters/X-Requested-With' + - + $ref: '#/components/parameters/include' + responses: + 200: + description: 'A list of products' + 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' + post: + tags: + - products + summary: 'Create Product' + description: 'Adds an Product to the system' + operationId: storeProduct + parameters: + - + $ref: '#/components/parameters/X-API-TOKEN' + - + $ref: '#/components/parameters/X-Requested-With' + - + $ref: '#/components/parameters/include' + responses: + 200: + description: 'Returns the saved 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/create: + get: + tags: + - products + summary: 'Create product' + description: 'Returns a blank 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' + 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 + parameters: + - + $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 + responses: + 200: + description: 'Returns the 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' + put: + tags: + - products + summary: 'Update product' + description: 'Handles the updating of an Product by id' + operationId: updateProduct + parameters: + - + $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 + responses: + 200: + description: 'Returns the 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' + delete: + tags: + - products + summary: 'Delete product' + description: 'Handles the deletion of an Product by id' + operationId: deleteProduct + parameters: + - + $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 + 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' + 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}/edit': + get: + tags: + - products + summary: 'Show product' + description: 'Displays an Product by id' + operationId: editProduct + parameters: + - + $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 + responses: + 200: + description: 'Returns the 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/bulk: + post: + tags: + - products + summary: 'Bulk product actions' + description: '' + operationId: bulkProducts + parameters: + - + $ref: '#/components/parameters/X-API-TOKEN' + - + $ref: '#/components/parameters/X-Requested-With' + - + $ref: '#/components/parameters/index' + requestBody: + description: 'Hashed IDs' + required: true + content: + application/json: + schema: + type: array + items: + description: 'Array of hashed IDs to be bulk ''actioned' + type: integer + example: '[0,1,2,3]' + responses: + 200: + description: 'The Product response' + 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}/upload': + put: + tags: + - products + summary: 'Add product document' + description: 'Handles the uploading of a document to a product' + operationId: uploadProduct + parameters: + - + $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 + responses: + 200: + description: 'Returns the 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' \ No newline at end of file