Last active
April 11, 2019 15:58
-
-
Save rohenaz/637b562c8093ab0a9735afc373934d5a to your computer and use it in GitHub Desktop.
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
openapi: 3.0.1 | |
info: | |
title: Delivery Dudes Vendor API | |
description: 'The vendor API provides information about Delivery Dudes vendor accounts, including order history. The endpoints documented here allow vendors to track their performance with Delivery Dudes.' | |
contact: | |
email: [email protected] | |
version: 0.0.1 | |
servers: | |
- url: https://api.deliverydudes.com | |
- url: https://api.devliverydudes.biz | |
tags: | |
- name: Orders | |
description: Get recent order data | |
- name: Authentication | |
- name: Account Info | |
description: View and modify vendor account information. | |
paths: | |
/v3/cart_items: | |
get: | |
tags: | |
- Orders | |
summary: Get cart items for orders | |
parameters: | |
- in: query | |
name: fields | |
schema: | |
type: string | |
description: Comma separated list of fields you want returned. If empty, returns all field. | |
- in: query | |
name: orderID | |
schema: | |
type: integer | |
responses: | |
200: | |
description: successful operation | |
content: | |
application/json: | |
schema: | |
$ref: '#/components/schemas/OrderItems' | |
401: | |
description: Invalid username supplied | |
content: {} | |
404: | |
description: User not found | |
content: {} | |
/v3/orders: | |
get: | |
tags: | |
- Orders | |
summary: Get recent orders | |
operationId: getOrders | |
parameters: | |
- in: query | |
name: fields | |
description: Comma separated list of fields you want returned. If empty, returns all fields. | |
schema: | |
type: string | |
- in: query | |
name: status | |
description: Query by status (or many, comma separated) | |
schema: | |
type: integer | |
- name: created_on_geq | |
in: query | |
schema: | |
type: string | |
description: Orders create on or after date. ex. '2019-04-01' | |
responses: | |
200: | |
description: OK | |
content: | |
application/json: | |
schema: | |
$ref: '#/components/schemas/Orders' | |
401: | |
description: Unauthorized | |
content: {} | |
/login/vendor_user: | |
get: | |
tags: | |
- Authentication | |
summary: Logs user into the system | |
operationId: loginUser | |
parameters: | |
- name: username | |
in: query | |
description: The user name for login | |
required: true | |
schema: | |
type: string | |
- name: password | |
in: query | |
description: The password for login in clear text | |
required: true | |
schema: | |
type: string | |
responses: | |
201: | |
description: successful login | |
content: | |
application/json: | |
schema: | |
type: string | |
401: | |
description: Unauthorized | |
content: {} | |
/logout: | |
get: | |
tags: | |
- Authentication | |
summary: Logs out current logged in user session | |
operationId: logoutUser | |
responses: | |
200: | |
description: successful operation | |
content: {} | |
/vendor_user/{userid}: | |
get: | |
tags: | |
- Account Info | |
summary: Get user by user id | |
description: Check against vendor app, it could be /my_account | |
operationId: getUserByName | |
parameters: | |
- name: userid | |
in: path | |
description: 'The name that needs to be fetched. Use user1 for testing. ' | |
required: true | |
schema: | |
type: string | |
responses: | |
200: | |
description: successful operation | |
content: | |
application/json: | |
schema: | |
$ref: '#/components/schemas/User' | |
401: | |
description: Invalid username supplied | |
content: {} | |
404: | |
description: User not found | |
content: {} | |
put: | |
tags: | |
- Account Info | |
summary: Updated user | |
description: This can only be done by the logged in user. | |
operationId: updateUser | |
parameters: | |
- name: userid | |
in: path | |
description: name that need to be updated | |
required: true | |
schema: | |
type: string | |
requestBody: | |
description: Updated user object | |
content: | |
'*/*': | |
schema: | |
$ref: '#/components/schemas/User' | |
required: true | |
responses: | |
400: | |
description: Invalid user supplied | |
content: {} | |
404: | |
description: User not found | |
content: {} | |
components: | |
schemas: | |
Order: | |
type: object | |
properties: | |
id: | |
type: integer | |
format: int64 | |
vendor_ids: | |
type: array | |
items: | |
type: integer | |
to_be_delivered_time: | |
type: string | |
format: date-time | |
status: | |
type: string | |
description: Order Status | |
enum: | |
- cancelled | |
- placed | |
- picked | |
- delivered | |
total: | |
type: integer | |
description: divide by 100 to get float/USD value | |
total_items: | |
type: integer | |
OrderItems: | |
type: array | |
items: | |
$ref: '#/components/schemas/OrderItem' | |
OrderItem: | |
type: object | |
properties: | |
product_description: | |
type: string | |
product_id: | |
type: integer | |
product_name: | |
type: string | |
product_price: | |
type: integer | |
quantity: | |
type: integer | |
Orders: | |
type: array | |
items: | |
$ref: '#/components/schemas/Order' | |
User: | |
type: object | |
properties: | |
id: | |
type: integer | |
username: | |
type: string | |
firstName: | |
type: string | |
lastName: | |
type: string | |
email: | |
type: string | |
phone: | |
type: string | |
userStatus: | |
type: integer | |
description: User Status | |
format: int32 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment