Skip to content

Instantly share code, notes, and snippets.

@mrfrostikcz
Last active November 29, 2018 17:48
Show Gist options
  • Save mrfrostikcz/12fd1391f57d31982078dacd5fe39adb to your computer and use it in GitHub Desktop.
Save mrfrostikcz/12fd1391f57d31982078dacd5fe39adb to your computer and use it in GitHub Desktop.
Factcool supplier API
swagger: '2.0'
info:
version: '1.0'
title: "Factcool supplier API"
description: Universal API designed for Factcool suppliers.
host: yourshop.com
basePath: /v1
schemes:
- http
consumes:
- application/json
produces:
- application/json
securityDefinitions:
APIKeyHeader:
type: apiKey
in: header
name: X-Auth-Token
paths:
/availability:
x-summary: Stock availability
get:
summary: Get stock status
parameters:
- in: query
name: barcodes
type: string
required: true
description: List of barcodes separated by comma. For example ?barcodes=1,2,3
x-example: 5256805519574
responses:
200:
description: Successful Response
schema:
type: array
items:
$ref: '#/definitions/Availability'
/orders:
x-summary: Order operations
post:
summary: Create new order
parameters:
- in: body
name: order
description: Order to create.
schema:
$ref: '#/definitions/Order'
responses:
200:
description: Successful Response
400:
description: Error Response
schema:
$ref: '#/definitions/ErrorMessage'
definitions:
Availability:
title: Availability
type: object
properties:
barcode:
type: string
example: 5256805519574
quantity:
type: integer
example: 10
required:
- barcode
- quantity
Order:
title: Order
type: object
properties:
id:
type: string
example: CZ123456
description: Your identificator which will be included as a barcode on a package (for us to pair orders)
items:
type: array
minItems: 1
items:
$ref: '#/definitions/OrderItem'
created:
type: string
example: "2018-01-01T00:00:00.456Z"
OrderItem:
title: Order item
type: object
properties:
barcode:
type: string
example: 5256805519574
requestedQuantity:
type: integer
example: 10
availableQuantity:
type: integer
example: 15
description: For unavailable you can use zero value
required:
- barcode
- requestedQuantity
- availableQuantity
ErrorMessage:
title: Error message
type: object
properties:
message:
type: string
example: An error has occurred
required:
- message
dry-run: null
hookfiles: null
language: php
sandbox: false
server: npm start
server-wait: 3
init: false
custom: {}
names: false
only: []
reporter: []
output: []
header: []
sorted: false
user: null
inline-errors: false
details: false
method: []
color: true
level: info
timestamp: false
silent: false
path: []
hooks-worker-timeout: 5000
hooks-worker-connect-timeout: 1500
hooks-worker-connect-retry: 500
hooks-worker-after-connect-wait: 100
hooks-worker-term-timeout: 5000
hooks-worker-term-retry: 500
hooks-worker-handler-host: 127.0.0.1
hooks-worker-handler-port: 61321
config: ./dredd.yml
blueprint: api.yaml
endpoint: 'http://127.0.0.1:8000'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment