Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- swagger: '2.0'
- info:
- version: ''
- title: Burger King Christmas Campaign API
- description: |-
- ## Code format
- The codes will be composed of `11` uppercase alpha numeric characters, `[A-Z0-9]`.
- ## Status codes
- ### 200
- OK.
- ### 400
- Bad request. You may be missing a required parameter or sending it in the wrong format.
- ### 401
- Not authorized. You forgot to include the `API Key` in the `Authorization` header, or the `API Key` is invalid.
- ### 404
- Not found. You may be trying to access an invalid resource (e.g. non-existent code).
- ### 500
- Internal server error. Something went wrong on our side.
- ## Errors
- Responses with bad status codes (`>= 400`) will include an error in the payload.
- Here are some example errors:
- ### Authorization error
- ```json
- {
- "code":401,
- "message":"You are not authorized"
- }
- ```
- ### Bad request
- ```json
- {
- "code": 400,
- "message": "Bad Request. Your request is incorrect or you missed some required fields for this request."
- }
- ```
- ### Resource not found
- ```json
- {
- "code": 404,
- "message": "Resource was not found"
- }
- ```
- #### Try to redeem a code before being activated from the app
- ```json
- {
- "code": 1,
- "message": "The code has not been activated yet. Please activate it inside the app before redeeming."
- }
- ```
- #### Try to redeem a code outside the campaign period (e.g. before Nov 27th)
- ```json
- {
- "code": 2,
- "message": "Can't redeem codes at this time."
- }
- ```
- #### Try to redeem a code which has already been redeemed
- ```json
- {
- "code": 3,
- "message": "The code has already been redeemed."
- }
- ```
- ### Generic error message (when the cause is unknown)
- ```json
- {
- "code":-1,
- "message":"Something went wrong"
- }
- ``` ## Code format
- The codes will be composed of `11` uppercase alpha numeric characters, `[A-Z0-9]`.
- ## Status codes
- ### 200
- OK.
- ### 400
- Bad request. You may be missing a required parameter or sending it in the wrong format.
- ### 401
- Not authorized. You forgot to include the `API Key` in the `Authorization` header, or the `API Key` is invalid.
- ### 404
- Not found. You may be trying to access an invalid resource (e.g. non-existent code).
- ### 500
- Internal server error. Something went wrong on our side.
- ## Errors
- Responses with bad status codes (`>= 400`) will include an error in the payload.
- Here are some example errors:
- ### Authorization error
- ```json
- {
- "code":401,
- "message":"You are not authorized"
- }
- ```
- ### Bad request
- ```json
- {
- "code": 400,
- "message": "Bad Request. Your request is incorrect or you missed some required fields for this request."
- }
- ```
- ### Resource not found
- ```json
- {
- "code": 404,
- "message": "Resource was not found"
- }
- ```
- #### Try to redeem a code before being activated from the app
- ```json
- {
- "code": 1,
- "message": "The code has not been activated yet. Please activate it inside the app before redeeming."
- }
- ```
- #### Try to redeem a code outside the campaign period (e.g. before Nov 27th)
- ```json
- {
- "code": 2,
- "message": "Can't redeem codes at this time."
- }
- ```
- #### Try to redeem a code which has already been redeemed
- ```json
- {
- "code": 3,
- "message": "The code has already been redeemed."
- }
- ```
- ### Generic error message (when the cause is unknown)
- ```json
- {
- "code":-1,
- "message":"Something went wrong"
- }
- ```
- host: 'localhost:8000'
- basePath: /api/v1
- schemes:
- - http
- - https
- consumes:
- - application/json
- produces:
- - application/json
- securityDefinitions:
- Authorization:
- name: Authorization
- type: apiKey
- in: header
- paths:
- '/pos/codes/{code}/printed':
- parameters:
- - name: code
- in: path
- required: true
- type: string
- put:
- operationId: MarkCodePrinted
- summary: Mark Code as Printed
- tags:
- - Pos
- description: Mark the code as printed.
- responses:
- '200':
- description: ''
- schema:
- $ref: '#/definitions/code-details'
- '400':
- $ref: '#/responses/trait:error:400'
- '401':
- $ref: '#/responses/trait:error:401'
- '404':
- $ref: '#/responses/trait:error:404'
- '500':
- $ref: '#/responses/trait:error:500'
- security:
- - Authorization: []
- x-stoplight:
- id: MarkCodePrinted
- beforeScript: null
- afterScript: null
- public: true
- mock:
- statusCode: 200
- dynamic: false
- enabled: false
- '/pos/codes/{code}':
- parameters:
- - name: code
- in: path
- required: true
- type: string
- get:
- operationId: Get Code
- summary: Get Code Details
- tags:
- - Pos
- description: Return the details for a specific code.
- responses:
- '200':
- description: ''
- schema:
- $ref: '#/definitions/code-details'
- '400':
- $ref: '#/responses/trait:error:400'
- '401':
- $ref: '#/responses/trait:error:401'
- '404':
- $ref: '#/responses/trait:error:404'
- '500':
- $ref: '#/responses/trait:error:500'
- security:
- - Authorization: []
- x-stoplight:
- id: Get Code
- beforeScript: null
- afterScript: null
- public: true
- mock:
- statusCode: 200
- dynamic: false
- enabled: false
- /pos/codes:
- post:
- operationId: GenerateCode
- summary: Generate Code
- tags:
- - Pos
- description: Generate a new code.
- parameters:
- - name: body
- in: body
- schema:
- type: object
- properties:
- restaurant_id:
- type: string
- description: 'The ID of the restaurant, e.g. 24188'
- prize_quantity:
- type: integer
- minimum: 0
- description: The number of products bought from restaurant.
- required:
- - restaurant_id
- responses:
- '200':
- description: ''
- schema:
- $ref: '#/definitions/code-details'
- '400':
- $ref: '#/responses/trait:error:400'
- '401':
- $ref: '#/responses/trait:error:401'
- '404':
- $ref: '#/responses/trait:error:404'
- '500':
- $ref: '#/responses/trait:error:500'
- security:
- - Authorization: []
- x-stoplight:
- id: GenerateCode
- beforeScript: null
- afterScript: null
- public: true
- mock:
- statusCode: 200
- dynamic: false
- enabled: false
- '/pos/codes/{code}/redeem':
- parameters:
- - name: code
- in: path
- required: true
- type: string
- put:
- operationId: RedeemCode
- summary: Redeem Code
- tags:
- - Pos
- description: Redeem a code.
- parameters:
- - name: body
- in: body
- schema:
- type: object
- properties:
- restaurant_id:
- type: string
- description: 'The restaurant ID, e.g. 24188'
- required:
- - restaurant_id
- responses:
- '200':
- description: ''
- schema:
- $ref: '#/definitions/code-details'
- '400':
- $ref: '#/responses/trait:error:400'
- '401':
- $ref: '#/responses/trait:error:401'
- '404':
- $ref: '#/responses/trait:error:404'
- '500':
- $ref: '#/responses/trait:error:500'
- security:
- - Authorization: []
- x-stoplight:
- id: RedeemCode
- beforeScript: null
- afterScript: null
- public: true
- mock:
- statusCode: 200
- dynamic: false
- enabled: false
- responses:
- 'trait:error:400':
- description: ''
- schema:
- $ref: '#/definitions/error-response'
- 'trait:error:401':
- description: ''
- schema:
- $ref: '#/definitions/error-response'
- 'trait:error:404':
- description: ''
- schema:
- $ref: '#/definitions/error-response'
- 'trait:error:500':
- description: ''
- schema:
- $ref: '#/definitions/error-response'
- definitions:
- code-details:
- title: Code Details
- type: object
- properties:
- code:
- type: string
- description: The code
- prize_name:
- type: string
- description: The name of the prize
- prize_image_url:
- type: string
- description: The image URL of the prize
- status:
- type: string
- description: |
- The status of the code.
- `available` - The code is available
- `generated` - The code was assigned to a restaurant, but not printed, yet
- `printed` - The code has been printed by the restaurant
- `activated` - The code has been activated by a user inside the App
- `redeemed` - The code has been redeemed by the user
- enum:
- - available
- - generated
- - printed
- - activated
- - redeemed
- redeem_date:
- type: string
- format: date-time
- description: The date when this code was redeemed. Will only be available if the `status` is `redeemed`.
- product_id_ncr:
- type: integer
- description: Prize ID for the NCR's systems
- product_id_toshiba:
- type: integer
- description: Prize ID for Toshiba's systems
- creation_date:
- type: string
- format: date-time
- description: The date when the code was generated and printed.
- restaurant_id_generated:
- type: string
- description: 'The restaurant id, where the client bought a BK product and the code was generated and printed.'
- restaurant_id_redeemed:
- type: string
- description: 'The restaurant id, where de gift was obtained from.'
- required:
- - code
- - prize_name
- - prize_image_url
- - status
- - product_id_ncr
- - product_id_toshiba
- - creation_date
- - restaurant_id_generated
- x-stoplight:
- id: code-details
- name: Code Details
- public: true
- error-response:
- title: Error Response
- type: object
- properties:
- code:
- type: integer
- message:
- type: string
- required:
- - code
- - message
- x-stoplight:
- id: error-response
- name: Error Response
- public: true
- x-stoplight:
- beforeScript: ''
- afterScript: ''
- version:
- groups:
- utilFuncs: []
- savedEntries: []
- tests: []
- traits: []
- docs:
- - items:
- - type: endpoints
- _id: MarkCodePrinted
- - type: endpoints
- _id: Get Code
- - type: endpoints
- _id: GenerateCode
- - type: endpoints
- _id: RedeemCode
- name: Pos
- - items:
- - type: schemas
- _id: code-details
- - type: schemas
- _id: error-response
- description: Models make up the core input and ouput structures in this API. They are used in endpoint request and response bodies.
- name: Models
- - items:
- - type: traits
- _id: error
- description: Traits describe common behaviors or structures in this API.
- name: Traits
- functions: {}
- textSections: {}
- mock:
- dynamic: false
- enabled: false
- x-tests: {}
Add Comment
Please, Sign In to add comment