2ndKitchen Coupons API

The Coupons API from 2ndKitchen — 1 operation(s) for coupons.

OpenAPI Specification

2ndkitchen-coupons-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: 2ndKitchen - Service Authentication Coupons API
  version: '1.0'
servers:
- url: https://auth-staging.2ndkitchen.com
  description: staging
tags:
- name: Coupons
paths:
  /coupons/calc:
    post:
      description: Calculates coupon discount
      tags:
      - Coupons
      requestBody:
        required: true
        content:
          application/json:
            schema:
              required:
              - data
              type: object
              properties:
                id:
                  deprecated: true
                  description: Coupon id
                  type: integer
                code:
                  description: Coupon code
                  type: string
                data:
                  required:
                  - business_id
                  - price
                  description: Coupon use information
                  type: object
                  properties:
                    business_id:
                      description: Associated business id
                      type: integer
                    price:
                      description: order price
                      type: number
                    delivery_slot:
                      description: Order delivery time
                      type: string
                      format: date-time
                      example: '2021-10-14 22:38:30.266962'
      responses:
        '200':
          description: Returns the discount amount and other coupon data
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: ok
                  data:
                    type: object
                    properties:
                      id:
                        description: Coupon id
                        type: integer
                      code:
                        description: Coupon code
                        type: string
                      coupon_type:
                        type: integer
                        enum:
                        - 0
                        - 1
                        - 2
                        - 3
                        - 4
                        - 5
                        - 6
                        description: "Coupon Type:\n * `0` - DEFAULT\n * `1` - CREDIT\n * `2` - VOUCHER\n * `3` - REFERRAL\n * `4` - LOYALTY\n * `5` - FIRST_TIME\n * `6` - STAFF\n"
                      discount:
                        description: Discount amount
                        type: number
                      token:
                        description: Coupon Token (for $0 vouchers)
                        type: string
                      type:
                        type: number
                        enum:
                        - 0
                        - 1
                        description: "Discount Type:\n * `0` - FIXED\n * `1` - PERCENT\n"