Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- swagger: '2.0'
- info:
- description: This is a simple API
- version: 1.0.0
- title: Simple Inventory API
- # put the contact info for your development or API team
- contact:
- email: you@your-company.com
- license:
- name: Apache 2.0
- url: http://www.apache.org/licenses/LICENSE-2.0.html
- # tags are used for organizing operations
- tags:
- - name: admins
- description: Secured Admin-only calls
- - name: developers
- description: Operations available to regular developers
- - name: users
- description: opertation avilable for the users
- paths:
- /address:
- get:
- tags:
- - users
- summary: searches address
- operationId: searchInventory
- description: |
- By passing in the user id, you can search for
- available address added by user
- produces:
- - application/json
- parameters:
- - in: query
- name: userid
- description: pass an userid for fetching all his address
- required: true
- type: string
- responses:
- 200:
- description: search results matching criteria
- schema:
- type: array
- items:
- $ref: '#/definitions/Address'
- 400:
- description: bad input parameter
- post:
- tags:
- - users
- summary: adds an address item
- operationId: addAddress
- description: Adds an Address to the system
- consumes:
- - application/json
- produces:
- - application/json
- parameters:
- - in: body
- name: inventoryItem
- description: Inventory item to add
- schema:
- $ref: '#/definitions/Address'
- responses:
- 201:
- description: item created
- 400:
- description: invalid input, object invalid
- 409:
- description: an existing item already exists
- definitions:
- Address:
- type: object
- required:
- - house_no
- - street_name
- - address_line1
- - address_line2
- - address_line3
- - landmark
- - pincode
- - label
- - modified_at
- - created_at
- properties:
- house_no:
- type: string
- example: 1-21/f
- street_name:
- type: string
- example: Gandhi Nagar
- address_line1:
- type: string
- example: near hps school
- address_line2:
- type: string
- example: gouri apartments
- address_line3:
- type: string
- example: ""
- landmark:
- type: string
- example: HP Petrol Bunk
- label:
- type: string
- example: GrandMom House
- pincode:
- type: integer
- example: 500084
- address_id:
- type: string
- example: user_add1
- created_at:
- type: string
- example: "2017-07-21T17:32:28Z"
- modified_at:
- type: string
- example: "2017-07-21T17:32:28Z"
- Order:
- type: object
- required:
- - id
- - user_profile_id
- - cart_id
- - address_id
- - created_at
- - modified_at
- - comments
- - total
- properties:
- id:
- type: string
- example: abc123
- user_profile_id:
- type: string
- example: abc123
- cart_id:
- type: string
- example: crt123
- address_line2:
- type: string
- example: gouri apartments
- created_at:
- type: string
- example: "2017-07-21T17:32:28Z"
- modified_at:
- type: string
- example: "2017-07-21T17:32:28Z"
- comments:
- type: string
- example: Ordered for the |
- family event
- total:
- type: number
- example: 29.23
- OrderItem:
- type: object
- required:
- - id
- - product_id
- - quantity
- - status
- - delivery_date
- - created_at
- - modified_at
- - unit_price
- - total_price # total unit price * item_price
- - tax
- - order_id # parent order id
- - subscription_id # if any is available
- properties:
- id:
- type : string
- example : abc123
- product_id:
- type: string
- example: abc123
- created_at:
- type: string
- example: "2017-07-21T17:32:28Z"
- modified_at:
- type: string
- example: "2017-07-21T17:32:28Z"
- quantity:
- type: integer
- example: 2
- unit_price:
- type: number
- example: 12.3
- total_price:
- type: number
- example: 24.6
- order_id:
- type: string
- example: ord123
- tax:
- type: number
- example: 0.6
- delivery_date:
- type: string
- example: "2022-02-14"
- statue:
- type: string
- example: delivered
- subscription_id:
- type: string
- example: sub123
- # Added by API Auto Mocking Plugin
- User:
- type: object
- required:
- - id
- properties:
- id:
- type: string
- example: "42"
- UserProfile:
- type: object
- required:
- - id
- - user_id
- - phone_number
- - last_used_address_id
- properties:
- id:
- type: string
- example: "42"
- last_used_address_id:
- type: string
- example: "lad42"
- name:
- type: string
- example: user
- user_id:
- type: string
- example: "42"
- phone_number:
- type: integer
- example: 916666666666
- email:
- type: string
- example: user@gmail.com
- addresses:
- type: "array"
- items:
- $ref: '#/definitions/Address'
- Cart:
- type: object
- required:
- - id
- - status
- - total
- properties:
- id:
- type: string
- example: "42"
- status:
- type: string
- enum: [STILL_SHOPPING, CONVERTING_TO_ORDER, CONVERTED_TO_ORDER, DISCARDED]
- example: STILL_SHOPPING
- created_at:
- type: string
- example: "2017-07-21T17:32:28Z"
- modified_at:
- type: string
- example: "2017-07-21T17:32:28Z"
- comments:
- type: string
- example: "Just a comment"
- total:
- type: string
- example: "32.21"
- CartItem:
- type: object
- required:
- - id
- - cart_id
- - product_id
- - start_date
- - end_date
- - item_type
- - quantity
- - alternate_day
- properties:
- id:
- type: string
- example: "42"
- cart_id:
- type: string
- example: "42"
- product_id:
- type: string
- example: "42"
- start_date:
- type: string
- example: 2022-06-15
- end_date:
- type: string
- example: 2022-06-15
- item_type:
- type: string
- enum: ["subscription", "single_order"]
- quantity:
- type: string
- example: 4
- alternate_day:
- type: boolean
- example: false
- created_at:
- type: string
- example: "2017-07-21T17:32:28Z"
- modified_at:
- type: string
- example: "2017-07-21T17:32:28Z"
- InventoryOverride:
- type: object
- required:
- - product_id
- - date
- - available_quantity
- properties:
- product_id:
- type: string
- example: "42"
- date:
- type: string
- example: 2022-02-14
- available_quantity:
- type: integer
- example: 42
- created_at:
- type: string
- example: "2017-07-21T17:32:28Z"
- modified_at:
- type: string
- example: "2017-07-21T17:32:28Z"
- Subscription:
- type: object
- required:
- - subscription_id
- - user_profile_id
- - product_id
- - start_date
- - end_date
- - alternate_day
- - created_at
- - address_id
- - quantity
- properties:
- subscription_id:
- type: string
- user_profile_id:
- type: string
- example: https://s3.com/link-to-image
- product_id:
- type: string
- example: Milk 1 litre
- start_date:
- type: string
- example: 2022-02-14
- end_date:
- type: string
- example: 2022-02-14
- alternate_day:
- type: boolean
- example: 0
- created_at:
- type: string
- example: 2022-02-14
- address_id:
- type: string
- example: 342A
- quantity:
- type: number
- example: 40
- Product:
- type: object
- required:
- - product_id
- - image_url
- - title
- - short_description
- - description
- - default_capacity
- - discounted_price
- - price
- - subscription_enabled
- - active
- - created_at
- - modified_at
- properties:
- product_id:
- type: string
- image_url:
- type: string
- example: https://s3.com/link-to-image
- title:
- type: string
- example: Milk 1 litre
- short_description:
- type: string
- example: 1 litre glass bottle of milk
- description:
- type: string
- example: xyz abc asdf
- default_capacity:
- type: number
- example: 200
- discounted_price:
- type: number
- example: 40
- price:
- type: number
- example: 50
- subscription_enabled:
- type: boolean
- example: 0
- active:
- type: boolean
- example: 0
- created_at:
- type: string
- example: 2022-02-14
- modified_at:
- type: string
- example: 2022-02-14
- host: virtserver.swaggerhub.com
- basePath: /tmilq/Milq/1.0.0
- schemes:
- - https
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement