Created
October 16, 2018 00:37
-
-
Save KuroNoDev/aaf858323136f272bc76702ab78dd8dc to your computer and use it in GitHub Desktop.
mockInv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"swagger": "2.0", | |
"info": { | |
"version": "1.0.0", | |
"title": "Mock Inventory API", | |
"contact": {}, | |
"license": { | |
"name": "MIT" | |
} | |
}, | |
"host": "integrate-demo.torocloud.com", | |
"basePath": "/api/mock-inventory-api", | |
"tags": [], | |
"schemes": [ | |
"https" | |
], | |
"consumes": [], | |
"produces": [], | |
"paths": { | |
"/items": { | |
"get": { | |
"tags": [ | |
"Item" | |
], | |
"description": "### List Item\n\nThis service will list all the items in mock Inventory API", | |
"operationId": "io.toro.mock.inventory.endpoint.item.ListItem", | |
"produces": [ | |
"application/json" | |
], | |
"parameters": [], | |
"responses": { | |
"200": { | |
"description": "List of the Items", | |
"schema": { | |
"type": "array", | |
"items": { | |
"$ref": "#/definitions/io.toro.mock.inventory.model.item.Item" | |
} | |
} | |
}, | |
"default": { | |
"description": "API response", | |
"schema": { | |
"$ref": "#/definitions/io.toro.mock.inventory.model.APIResponse" | |
} | |
} | |
}, | |
"deprecated": false | |
}, | |
"post": { | |
"tags": [ | |
"Item" | |
], | |
"description": "### Create Item\n\nThis service will create Item for the mock Inventory API.", | |
"operationId": "io.toro.mock.inventory.endpoint.item.CreateItem", | |
"consumes": [ | |
"application/json" | |
], | |
"produces": [ | |
"application/json" | |
], | |
"parameters": [{ | |
"in": "body", | |
"name": "item", | |
"required": false, | |
"schema": { | |
"$ref": "#/definitions/io_toro_mock_inventory_endpoint_item_CreateItemBody" | |
} | |
}], | |
"responses": { | |
"default": { | |
"description": "API response", | |
"schema": { | |
"$ref": "#/definitions/io.toro.mock.inventory.model.APIResponse" | |
} | |
} | |
}, | |
"deprecated": false | |
} | |
}, | |
"/items/{itemId}": { | |
"get": { | |
"tags": [ | |
"Item" | |
], | |
"description": "### Get Item\n\nThis service will retrieve item in mock Inventory API", | |
"operationId": "io.toro.mock.inventory.endpoint.item.GetItem", | |
"produces": [ | |
"application/json" | |
], | |
"parameters": [{ | |
"name": "itemId", | |
"in": "path", | |
"required": true, | |
"type": "integer", | |
"format": "int32" | |
}], | |
"responses": { | |
"200": { | |
"description": "Details of the item", | |
"schema": { | |
"$ref": "#/definitions/io.toro.mock.inventory.model.item.Item" | |
} | |
}, | |
"default": { | |
"description": "API response", | |
"schema": { | |
"$ref": "#/definitions/io.toro.mock.inventory.model.APIResponse" | |
} | |
} | |
}, | |
"deprecated": false | |
}, | |
"delete": { | |
"tags": [ | |
"Item" | |
], | |
"description": "### Delete Item\n\nThis service will delete the item in mock Inventory API", | |
"operationId": "io.toro.mock.inventory.endpoint.item.DeleteItem", | |
"produces": [ | |
"application/json" | |
], | |
"parameters": [{ | |
"name": "itemId", | |
"in": "path", | |
"required": true, | |
"type": "integer", | |
"format": "int32" | |
}], | |
"responses": { | |
"default": { | |
"description": "API response", | |
"schema": { | |
"$ref": "#/definitions/io.toro.mock.inventory.model.APIResponse" | |
} | |
} | |
}, | |
"deprecated": false | |
}, | |
"patch": { | |
"tags": [ | |
"Item" | |
], | |
"description": "### Update Item\n\nThis service will update the item in mock Inventory API", | |
"operationId": "io.toro.mock.inventory.endpoint.item.UpdateItem", | |
"consumes": [ | |
"application/json" | |
], | |
"produces": [ | |
"application/json" | |
], | |
"parameters": [{ | |
"name": "itemId", | |
"in": "path", | |
"required": true, | |
"type": "integer", | |
"format": "int32" | |
}, | |
{ | |
"in": "body", | |
"name": "item", | |
"required": false, | |
"schema": { | |
"$ref": "#/definitions/io_toro_mock_inventory_endpoint_item_UpdateItemBody" | |
} | |
} | |
], | |
"responses": { | |
"default": { | |
"description": "API response", | |
"schema": { | |
"$ref": "#/definitions/io.toro.mock.inventory.model.APIResponse" | |
} | |
} | |
}, | |
"deprecated": false | |
} | |
}, | |
"/items/{itemId}/{type}": { | |
"patch": { | |
"tags": [ | |
"Item" | |
], | |
"description": "### Update Item Quantity\n\nThis service will update the quantity of the item in mock Inventory API", | |
"operationId": "io.toro.mock.inventory.endpoint.item.UpdateItemQuantity", | |
"consumes": [ | |
"application/json" | |
], | |
"produces": [ | |
"application/json" | |
], | |
"parameters": [{ | |
"name": "itemId", | |
"in": "path", | |
"description": "id of the item", | |
"required": true, | |
"type": "integer", | |
"format": "int32" | |
}, | |
{ | |
"name": "type", | |
"in": "path", | |
"description": "quantity type to adjust ( Quantity On-Hand or Quantity Available )", | |
"required": true, | |
"type": "string", | |
"enum": [ | |
"quantity-on-hand", | |
"quantity-available" | |
] | |
}, | |
{ | |
"in": "body", | |
"name": "item", | |
"required": false, | |
"schema": { | |
"$ref": "#/definitions/io_toro_mock_inventory_endpoint_item_UpdateItemQuantityBody" | |
} | |
} | |
], | |
"responses": { | |
"default": { | |
"description": "API response", | |
"schema": { | |
"$ref": "#/definitions/io.toro.mock.inventory.model.APIResponse" | |
} | |
} | |
}, | |
"deprecated": false | |
} | |
}, | |
"/webhook": { | |
"post": { | |
"tags": [ | |
"Configure" | |
], | |
"description": "### Configure Webhook\n\nThis service will configure the webhook of the mock Inventory API", | |
"operationId": "io.toro.mock.inventory.endpoint.ConfigureWebhook", | |
"consumes": [ | |
"application/json" | |
], | |
"produces": [ | |
"application/json", | |
"application/xml" | |
], | |
"parameters": [{ | |
"name": "url", | |
"in": "formData", | |
"required": false, | |
"type": "string", | |
"allowEmptyValue": true | |
}], | |
"responses": { | |
"default": { | |
"description": "API response", | |
"schema": { | |
"$ref": "#/definitions/io.toro.mock.inventory.model.APIResponse" | |
} | |
} | |
}, | |
"externalDocs": { | |
"url": "http://www.example.com" | |
}, | |
"deprecated": false | |
} | |
} | |
}, | |
"definitions": { | |
"io.toro.mock.inventory.model.APIResponse": { | |
"type": "object", | |
"properties": { | |
"result": { | |
"type": "string", | |
"enum": [ | |
"SUCCESS", | |
"ERROR" | |
] | |
}, | |
"message": { | |
"type": "string" | |
} | |
} | |
}, | |
"io.toro.mock.inventory.model.item.Item": { | |
"type": "object", | |
"properties": { | |
"itemId": { | |
"type": "string" | |
}, | |
"itemName": { | |
"type": "string" | |
}, | |
"dateCreated": { | |
"type": "string" | |
}, | |
"dateUpdated": { | |
"type": "string" | |
}, | |
"quantityOnHand": { | |
"type": "integer", | |
"format": "int32" | |
}, | |
"quantityAvailable": { | |
"type": "integer", | |
"format": "int32" | |
}, | |
"customField": { | |
"type": "object", | |
"properties": {} | |
} | |
} | |
}, | |
"io_toro_mock_inventory_endpoint_item_CreateItemBody": { | |
"type": "object", | |
"properties": { | |
"itemName": { | |
"type": "string" | |
}, | |
"quantityOnHand": { | |
"type": "integer", | |
"format": "int32" | |
}, | |
"quantityAvailable": { | |
"type": "integer", | |
"format": "int32" | |
}, | |
"customField": { | |
"type": "object", | |
"properties": {} | |
} | |
} | |
}, | |
"io_toro_mock_inventory_endpoint_item_UpdateItemBody": { | |
"type": "object", | |
"properties": { | |
"itemName": { | |
"type": "string" | |
}, | |
"quantityOnHand": { | |
"type": "integer", | |
"format": "int32" | |
}, | |
"quantityAvailable": { | |
"type": "integer", | |
"format": "int32" | |
}, | |
"customField": { | |
"type": "object", | |
"properties": {} | |
} | |
} | |
}, | |
"io_toro_mock_inventory_endpoint_item_UpdateItemQuantityBody": { | |
"type": "object", | |
"required": [ | |
"action", | |
"quantity" | |
], | |
"properties": { | |
"quantity": { | |
"type": "integer", | |
"format": "int32", | |
"description": "quantity (i.e. 15)" | |
}, | |
"action": { | |
"type": "string", | |
"description": "action (increase or decrease)", | |
"enum": [ | |
"increase", | |
"decrease" | |
] | |
} | |
} | |
} | |
}, | |
"externalDocs": { | |
"url": "https://docs.torocloud.com/integrate/tutorials/tutorials-case-studies/mock-inventory-api/" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment