openapi: 3.0.2
info:
  title: Morbius API
  description: Morbius serverless API
  version: 1.1.18
servers:
  - url: http://localhost:3000/{basePath}
    variables:
      basePath:
        default: v1
    description: Localhost
  - url: https://api.billerbee.com/{basePath}
    variables:
      basePath:
        default: v1
security:
  - MyCognito: []
tags:
  - name: APISpec
    description: Open API Specification
  - name: Session
    description: Sale session
  - name: Cart
    description: Cart for buyer
  - name: Tenant
    description: Tenant
  - name: FacebookWebHook
    description: Facebook Web Hook
  - name: Stripe
    description: Stripe
  - name: Page
    description: Page managed by tenant
paths:
  /apispec:
    get:
      tags:
        - APISpec
      security: []
      responses:
        '200':
          description: OK
      x-amazon-apigateway-integration:
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:ap-southeast-1:lambda:path/2015-03-31/functions/arn:aws:lambda:ap-southeast-1:300902935450:function:morbius-node-server-function/invocations
        responses:
          default:
            statusCode: '200'
        passthroughBehavior: when_no_match
        contentHandling: CONVERT_TO_TEXT
        type: aws_proxy
  /settings:
    get:
      security: []
      responses:
        '200':
          description: OK
      x-amazon-apigateway-integration:
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:ap-southeast-1:lambda:path/2015-03-31/functions/arn:aws:lambda:ap-southeast-1:300902935450:function:morbius-node-server-function/invocations
        responses:
          default:
            statusCode: '200'
        passthroughBehavior: when_no_match
        contentHandling: CONVERT_TO_TEXT
        type: aws_proxy
  /currencyPaymentMethods:
    get:
      tags:
        - General
      security: []
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                type: object
      x-amazon-apigateway-integration:
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:ap-southeast-1:lambda:path/2015-03-31/functions/arn:aws:lambda:ap-southeast-1:300902935450:function:morbius-node-server-function/invocations
        responses:
          default:
            statusCode: '200'
        passthroughBehavior: when_no_match
        contentHandling: CONVERT_TO_TEXT
        type: aws_proxy
  /webhook/facebook:
    get:
      tags:
        - FacebookWebHook
      security: []
      parameters:
        - in: query
          name: hub.challenge
          schema:
            type: string
        - in: query
          name: hub.verify_token
          schema:
            type: string
        - in: query
          name: hub.mode
          schema:
            type: string
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                type: object
      x-amazon-apigateway-integration:
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:ap-southeast-1:lambda:path/2015-03-31/functions/arn:aws:lambda:ap-southeast-1:300902935450:function:morbius-node-server-function/invocations
        responses:
          default:
            statusCode: '200'
        passthroughBehavior: when_no_match
        contentHandling: CONVERT_TO_TEXT
        type: aws_proxy
    post:
      tags:
        - FacebookWebHook
      security: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                type: object
      x-amazon-apigateway-integration:
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:ap-southeast-1:lambda:path/2015-03-31/functions/arn:aws:lambda:ap-southeast-1:300902935450:function:morbius-node-server-function/invocations
        responses:
          default:
            statusCode: '200'
        passthroughBehavior: when_no_match
        contentHandling: CONVERT_TO_TEXT
        type: aws_proxy
  /webhook/tenantPages:
    put:
      tags:
        - Page
      description: Create Page credentials
      security: []
      requestBody:
        $ref: '#/components/requestBodies/createPage'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: string
      x-amazon-apigateway-integration:
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:ap-southeast-1:lambda:path/2015-03-31/functions/arn:aws:lambda:ap-southeast-1:300902935450:function:morbius-node-server-function/invocations
        responses:
          default:
            statusCode: '200'
        passthroughBehavior: when_no_match
        contentHandling: CONVERT_TO_TEXT
        type: aws_proxy
  /session:
    put:
      tags:
        - Session
      description: Create sale session
      requestBody:
        $ref: '#/components/requestBodies/createSession'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: string
      x-amazon-apigateway-integration:
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:ap-southeast-1:lambda:path/2015-03-31/functions/arn:aws:lambda:ap-southeast-1:300902935450:function:morbius-node-server-function/invocations
        responses:
          default:
            statusCode: '200'
        passthroughBehavior: when_no_match
        contentHandling: CONVERT_TO_TEXT
        type: aws_proxy
    get:
      tags:
        - Session
      description: Get sales session
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/sessions'
      x-amazon-apigateway-integration:
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:ap-southeast-1:lambda:path/2015-03-31/functions/arn:aws:lambda:ap-southeast-1:300902935450:function:morbius-node-server-function/invocations
        responses:
          default:
            statusCode: '200'
        passthroughBehavior: when_no_match
        contentHandling: CONVERT_TO_TEXT
        type: aws_proxy
  /session/byPageId/{pageId}:
    get:
      tags:
        - Session
      description: Get sessions by pageId
      parameters:
        - $ref: '#/components/parameters/pathPageId'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/sessions'
      x-amazon-apigateway-integration:
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:ap-southeast-1:lambda:path/2015-03-31/functions/arn:aws:lambda:ap-southeast-1:300902935450:function:morbius-node-server-function/invocations
        responses:
          default:
            statusCode: '200'
        passthroughBehavior: when_no_match
        contentHandling: CONVERT_TO_TEXT
        type: aws_proxy
  /session/{sessionId}:
    get:
      tags:
        - Session
      security: []
      description: Get sale session by Id
      parameters:
        - $ref: '#/components/parameters/pathSessionId'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/sessionById'
      x-amazon-apigateway-integration:
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:ap-southeast-1:lambda:path/2015-03-31/functions/arn:aws:lambda:ap-southeast-1:300902935450:function:morbius-node-server-function/invocations
        responses:
          default:
            statusCode: '200'
        passthroughBehavior: when_no_match
        contentHandling: CONVERT_TO_TEXT
        type: aws_proxy
    patch:
      tags:
        - Session
      description: Update sale session by Id
      requestBody:
        $ref: '#/components/requestBodies/updateSession'
      parameters:
        - $ref: '#/components/parameters/pathSessionId'
      responses:
        '200':
          description: OK
          content:
            text/plain:
              schema:
                type: string
      x-amazon-apigateway-integration:
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:ap-southeast-1:lambda:path/2015-03-31/functions/arn:aws:lambda:ap-southeast-1:300902935450:function:morbius-node-server-function/invocations
        responses:
          default:
            statusCode: '200'
        passthroughBehavior: when_no_match
        contentHandling: CONVERT_TO_TEXT
        type: aws_proxy
    delete:
      tags:
        - Session
      description: Delete sale session by Id
      parameters:
        - $ref: '#/components/parameters/pathSessionId'
      deprecated: true
      responses:
        '200':
          description: OK
          content:
            text/plain:
              schema:
                type: string
      x-amazon-apigateway-integration:
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:ap-southeast-1:lambda:path/2015-03-31/functions/arn:aws:lambda:ap-southeast-1:300902935450:function:morbius-node-server-function/invocations
        responses:
          default:
            statusCode: '200'
        passthroughBehavior: when_no_match
        contentHandling: CONVERT_TO_TEXT
        type: aws_proxy
  /session/{sessionId}/items:
    post:
      tags:
        - Session
      description: Get carts
      requestBody:
        $ref: '#/components/requestBodies/updateSessionItems'
      parameters:
        - $ref: '#/components/parameters/pathSessionId'
      responses:
        '200':
          description: Cart details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/sessionItems'
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found
        '500':
          description: Internal server error
      x-amazon-apigateway-integration:
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:ap-southeast-1:lambda:path/2015-03-31/functions/arn:aws:lambda:ap-southeast-1:300902935450:function:morbius-node-server-function/invocations
        responses:
          default:
            statusCode: '200'
        passthroughBehavior: when_no_match
        contentHandling: CONVERT_TO_TEXT
        type: aws_proxy
  /session/{sessionId}/shippingFees:
    post:
      tags:
        - Session
      description: Get carts
      requestBody:
        $ref: '#/components/requestBodies/updateSessionShippingFees'
      parameters:
        - $ref: '#/components/parameters/pathSessionId'
      responses:
        '200':
          description: Cart details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/sessionShippingFees'
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found
        '500':
          description: Internal server error
      x-amazon-apigateway-integration:
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:ap-southeast-1:lambda:path/2015-03-31/functions/arn:aws:lambda:ap-southeast-1:300902935450:function:morbius-node-server-function/invocations
        responses:
          default:
            statusCode: '200'
        passthroughBehavior: when_no_match
        contentHandling: CONVERT_TO_TEXT
        type: aws_proxy
  /session/{sessionId}/carts:
    get:
      tags:
        - Session
      description: Get carts
      parameters:
        - $ref: '#/components/parameters/pathSessionId'
        - $ref: '#/components/parameters/queryPage'
        - $ref: '#/components/parameters/querySize'
        - $ref: '#/components/parameters/queryFilters'
        - $ref: '#/components/parameters/queryOrders'
      responses:
        '200':
          description: Cart details
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/cartsDetail'
                  total:
                    type: number
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found
        '500':
          description: Internal server error
      x-amazon-apigateway-integration:
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:ap-southeast-1:lambda:path/2015-03-31/functions/arn:aws:lambda:ap-southeast-1:300902935450:function:morbius-node-server-function/invocations
        responses:
          default:
            statusCode: '200'
        passthroughBehavior: when_no_match
        contentHandling: CONVERT_TO_TEXT
        type: aws_proxy
  /session/{sessionId}/carts/updateDelivery:
    post:
      tags:
        - Session
      description: Update carts delivery
      parameters:
        - $ref: '#/components/parameters/pathSessionId'
      requestBody:
        $ref: '#/components/requestBodies/updateCartsDelivery'
      responses:
        '200':
          description: OK
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found
        '500':
          description: Internal server error
      x-amazon-apigateway-integration:
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:ap-southeast-1:lambda:path/2015-03-31/functions/arn:aws:lambda:ap-southeast-1:300902935450:function:morbius-node-server-function/invocations
        responses:
          default:
            statusCode: '200'
        passthroughBehavior: when_no_match
        contentHandling: CONVERT_TO_TEXT
        type: aws_proxy
  /session/{sessionId}/activate:
    post:
      tags:
        - Session
      description: Activate a carts
      parameters:
        - $ref: '#/components/parameters/pathSessionId'
      responses:
        '200':
          description: Message
          content:
            text/plain:
              schema:
                type: string
        '400':
          description: Bad request
        '404':
          description: Not found
        '500':
          description: Internal server error
      x-amazon-apigateway-integration:
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:ap-southeast-1:lambda:path/2015-03-31/functions/arn:aws:lambda:ap-southeast-1:300902935450:function:morbius-node-server-function/invocations
        responses:
          default:
            statusCode: '200'
        passthroughBehavior: when_no_match
        contentHandling: CONVERT_TO_TEXT
        type: aws_proxy
  /session/{sessionId}/deactivate:
    post:
      tags:
        - Session
      description: Deactivate a carts
      parameters:
        - $ref: '#/components/parameters/pathSessionId'
      responses:
        '200':
          description: Message
          content:
            text/plain:
              schema:
                type: string
        '400':
          description: Bad request
        '404':
          description: Not found
        '500':
          description: Internal server error
      x-amazon-apigateway-integration:
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:ap-southeast-1:lambda:path/2015-03-31/functions/arn:aws:lambda:ap-southeast-1:300902935450:function:morbius-node-server-function/invocations
        responses:
          default:
            statusCode: '200'
        passthroughBehavior: when_no_match
        contentHandling: CONVERT_TO_TEXT
        type: aws_proxy
  /cart/{cartId}:
    get:
      tags:
        - Cart
      security: []
      description: Get cart
      parameters:
        - $ref: '#/components/parameters/pathCartId'
      responses:
        '200':
          description: Cart details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/cartDetail'
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found
        '500':
          description: Internal server error
      x-amazon-apigateway-integration:
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:ap-southeast-1:lambda:path/2015-03-31/functions/arn:aws:lambda:ap-southeast-1:300902935450:function:morbius-node-server-function/invocations
        responses:
          default:
            statusCode: '200'
        passthroughBehavior: when_no_match
        contentHandling: CONVERT_TO_TEXT
        type: aws_proxy
    patch:
      tags:
        - Cart
      security: []
      description: Update cart
      parameters:
        - $ref: '#/components/parameters/pathCartId'
      requestBody:
        $ref: '#/components/requestBodies/updateCart'
      responses:
        '200':
          description: OK
          content:
            text/plain:
              schema:
                type: string
      x-amazon-apigateway-integration:
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:ap-southeast-1:lambda:path/2015-03-31/functions/arn:aws:lambda:ap-southeast-1:300902935450:function:morbius-node-server-function/invocations
        responses:
          default:
            statusCode: '200'
        passthroughBehavior: when_no_match
        contentHandling: CONVERT_TO_TEXT
        type: aws_proxy
  /cart/{cartId}/item:
    put:
      tags:
        - Cart
      security: []
      description: 'the json body is { itemId: quantity }'
      parameters:
        - $ref: '#/components/parameters/pathCartId'
      requestBody:
        $ref: '#/components/requestBodies/putCartItems'
      responses:
        '200':
          description: OK
      x-amazon-apigateway-integration:
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:ap-southeast-1:lambda:path/2015-03-31/functions/arn:aws:lambda:ap-southeast-1:300902935450:function:morbius-node-server-function/invocations
        responses:
          default:
            statusCode: '200'
        passthroughBehavior: when_no_match
        contentHandling: CONVERT_TO_TEXT
        type: aws_proxy
  /cart/{cartId}/isPaid:
    get:
      tags:
        - Cart
      security: []
      description: get cart payment status
      parameters:
        - $ref: '#/components/parameters/pathCartId'
      responses:
        '200':
          description: OK
        '404':
          description: Cart not found
      x-amazon-apigateway-integration:
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:ap-southeast-1:lambda:path/2015-03-31/functions/arn:aws:lambda:ap-southeast-1:300902935450:function:morbius-node-server-function/invocations
        responses:
          default:
            statusCode: '200'
        passthroughBehavior: when_no_match
        contentHandling: CONVERT_TO_TEXT
        type: aws_proxy
  /cart/{cartId}/checkout:
    post:
      tags:
        - Cart
      security: []
      description: create payment intent before checkout
      parameters:
        - $ref: '#/components/parameters/pathCartId'
      responses:
        '200':
          description: OK
      x-amazon-apigateway-integration:
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:ap-southeast-1:lambda:path/2015-03-31/functions/arn:aws:lambda:ap-southeast-1:300902935450:function:morbius-node-server-function/invocations
        responses:
          default:
            statusCode: '200'
        passthroughBehavior: when_no_match
        contentHandling: CONVERT_TO_TEXT
        type: aws_proxy
  /session/{sessionId}/cart/{cartId}/getClientSecret:
    get:
      tags:
        - Session
      security: []
      deprecated: true
      description: create payment intent and return client secret for linkedStripeAccount
      parameters:
        - $ref: '#/components/parameters/pathSessionId'
        - $ref: '#/components/parameters/pathCartId'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/clientSecretResponse'
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found
        '500':
          description: Internal server error
      x-amazon-apigateway-integration:
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:ap-southeast-1:lambda:path/2015-03-31/functions/arn:aws:lambda:ap-southeast-1:300902935450:function:morbius-node-server-function/invocations
        responses:
          default:
            statusCode: '200'
        passthroughBehavior: when_no_match
        contentHandling: CONVERT_TO_TEXT
        type: aws_proxy
  /tenant:
    put:
      tags:
        - Tenant
      description: Create tenant
      security: []
      requestBody:
        $ref: '#/components/requestBodies/putTenant'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/tenant'
      x-amazon-apigateway-integration:
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:ap-southeast-1:lambda:path/2015-03-31/functions/arn:aws:lambda:ap-southeast-1:300902935450:function:morbius-node-server-function/invocations
        responses:
          default:
            statusCode: '200'
        passthroughBehavior: when_no_match
        contentHandling: CONVERT_TO_TEXT
        type: aws_proxy
  /tenant/me:
    get:
      tags:
        - Tenant
      description: Get self
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/tenant'
      x-amazon-apigateway-integration:
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:ap-southeast-1:lambda:path/2015-03-31/functions/arn:aws:lambda:ap-southeast-1:300902935450:function:morbius-node-server-function/invocations
        responses:
          default:
            statusCode: '200'
        passthroughBehavior: when_no_match
        contentHandling: CONVERT_TO_TEXT
        type: aws_proxy
    patch:
      tags:
        - Tenant
      description: Update self
      requestBody:
        $ref: '#/components/requestBodies/updateTenant'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/tenant'
      x-amazon-apigateway-integration:
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:ap-southeast-1:lambda:path/2015-03-31/functions/arn:aws:lambda:ap-southeast-1:300902935450:function:morbius-node-server-function/invocations
        responses:
          default:
            statusCode: '200'
        passthroughBehavior: when_no_match
        contentHandling: CONVERT_TO_TEXT
        type: aws_proxy
    delete:
      tags:
        - Tenant
      description: Permanently delete tenant data
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema: {}
      x-amazon-apigateway-integration:
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:ap-southeast-1:lambda:path/2015-03-31/functions/arn:aws:lambda:ap-southeast-1:300902935450:function:morbius-node-server-function/invocations
        responses:
          default:
            statusCode: '200'
        passthroughBehavior: when_no_match
        contentHandling: CONVERT_TO_TEXT
        type: aws_proxy
  /tenant/{tenantId}:
    get:
      tags:
        - Tenant
      description: Get tenant by id
      deprecated: true
      parameters:
        - $ref: '#/components/parameters/pathTenantId'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/tenant'
      x-amazon-apigateway-integration:
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:ap-southeast-1:lambda:path/2015-03-31/functions/arn:aws:lambda:ap-southeast-1:300902935450:function:morbius-node-server-function/invocations
        responses:
          default:
            statusCode: '200'
        passthroughBehavior: when_no_match
        contentHandling: CONVERT_TO_TEXT
        type: aws_proxy
  /tenant/linkStripeAccount:
    get:
      tags:
        - Tenant
      description: Get link stripe URL
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/linkStripeAccount'
      x-amazon-apigateway-integration:
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:ap-southeast-1:lambda:path/2015-03-31/functions/arn:aws:lambda:ap-southeast-1:300902935450:function:morbius-node-server-function/invocations
        responses:
          default:
            statusCode: '200'
        passthroughBehavior: when_no_match
        contentHandling: CONVERT_TO_TEXT
        type: aws_proxy
  /tenant/payment:
    get:
      tags:
        - Tenant
      description: Get tenant payment
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/tenantPayment'
      x-amazon-apigateway-integration:
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:ap-southeast-1:lambda:path/2015-03-31/functions/arn:aws:lambda:ap-southeast-1:300902935450:function:morbius-node-server-function/invocations
        responses:
          default:
            statusCode: '200'
        passthroughBehavior: when_no_match
        contentHandling: CONVERT_TO_TEXT
        type: aws_proxy
  /stripe/success:
    get:
      tags:
        - Stripe
      security: []
      description: Callback URL from Stripe successful payment from Tenant
      parameters:
        - $ref: '#/components/parameters/querySessionId'
        - $ref: '#/components/parameters/queryTenantId'
      responses:
        '200':
          description: OK
      x-amazon-apigateway-integration:
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:ap-southeast-1:lambda:path/2015-03-31/functions/arn:aws:lambda:ap-southeast-1:300902935450:function:morbius-node-server-function/invocations
        responses:
          default:
            statusCode: '200'
        passthroughBehavior: when_no_match
        contentHandling: CONVERT_TO_TEXT
        type: aws_proxy
  /stripe/webhook:
    post:
      tags:
        - Stripe
      security: []
      description: Webhook for stripe events
      requestBody:
        $ref: '#/components/requestBodies/stripeWebhook'
      responses:
        '200':
          description: OK
      x-amazon-apigateway-integration:
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:ap-southeast-1:lambda:path/2015-03-31/functions/arn:aws:lambda:ap-southeast-1:300902935450:function:morbius-node-server-function/invocations
        responses:
          default:
            statusCode: '200'
        passthroughBehavior: when_no_match
        contentHandling: CONVERT_TO_TEXT
        type: aws_proxy
  /aws/presignUrl/{fileName}:
    get:
      tags:
        - aws
      description: Get S3 presigned URL to upload file
      parameters:
        - $ref: '#/components/parameters/pathFileName'
      responses:
        '200':
          description: Get S3 presigned URL
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found
        '500':
          description: Internal server error
      x-amazon-apigateway-integration:
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:ap-southeast-1:lambda:path/2015-03-31/functions/arn:aws:lambda:ap-southeast-1:300902935450:function:morbius-node-server-function/invocations
        responses:
          default:
            statusCode: '200'
        passthroughBehavior: when_no_match
        contentHandling: CONVERT_TO_TEXT
        type: aws_proxy
  /aws/email/send/{email}:
    post:
      tags:
        - aws
      description: send Email to user
      parameters:
        - $ref: '#/components/parameters/sendEmail'
      requestBody:
        content:
          text/html:
            schema:
              type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: string
      x-amazon-apigateway-integration:
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:ap-southeast-1:lambda:path/2015-03-31/functions/arn:aws:lambda:ap-southeast-1:300902935450:function:morbius-node-server-function/invocations
        responses:
          default:
            statusCode: '200'
        passthroughBehavior: when_no_match
        contentHandling: CONVERT_TO_TEXT
        type: aws_proxy
  /page:
    get:
      tags:
        - Page
      description: Get Pages
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/pages'
      x-amazon-apigateway-integration:
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:ap-southeast-1:lambda:path/2015-03-31/functions/arn:aws:lambda:ap-southeast-1:300902935450:function:morbius-node-server-function/invocations
        responses:
          default:
            statusCode: '200'
        passthroughBehavior: when_no_match
        contentHandling: CONVERT_TO_TEXT
        type: aws_proxy
  /page/{pageId}:
    patch:
      tags:
        - Page
      description: Update page
      parameters:
        - $ref: '#/components/parameters/pathPageId'
      requestBody:
        $ref: '#/components/requestBodies/updatePage'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: string
      x-amazon-apigateway-integration:
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:ap-southeast-1:lambda:path/2015-03-31/functions/arn:aws:lambda:ap-southeast-1:300902935450:function:morbius-node-server-function/invocations
        responses:
          default:
            statusCode: '200'
        passthroughBehavior: when_no_match
        contentHandling: CONVERT_TO_TEXT
        type: aws_proxy
  /{proxy+}:
    x-amazon-apigateway-any-method:
      security: []
      responses: {}
      x-amazon-apigateway-integration:
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:ap-southeast-1:lambda:path/2015-03-31/functions/arn:aws:lambda:ap-southeast-1:300902935450:function:morbius-node-server-function/invocations
        responses:
          default:
            statusCode: '200'
        passthroughBehavior: when_no_match
        contentHandling: CONVERT_TO_TEXT
        type: aws_proxy
  /:
    x-amazon-apigateway-any-method:
      security: []
      responses: {}
      x-amazon-apigateway-integration:
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:ap-southeast-1:lambda:path/2015-03-31/functions/arn:aws:lambda:ap-southeast-1:300902935450:function:morbius-node-server-function/invocations
        responses:
          default:
            statusCode: '200'
        passthroughBehavior: when_no_match
        contentHandling: CONVERT_TO_TEXT
        type: aws_proxy
components:
  x-amazon-apigateway-integration:
    '-':
      httpMethod: POST
      uri: >-
        arn:aws:apigateway:ap-southeast-1:lambda:path/2015-03-31/functions/arn:aws:lambda:ap-southeast-1:300902935450:function:morbius-node-server-function/invocations
      responses:
        default:
          statusCode: '200'
      passthroughBehavior: when_no_match
      contentHandling: CONVERT_TO_TEXT
      type: aws_proxy
    morbius-node-server-function:
      httpMethod: POST
      uri: >-
        arn:aws:apigateway:ap-southeast-1:lambda:path/2015-03-31/functions/arn:aws:lambda:ap-southeast-1:300902935450:function:morbius-node-server-function/invocations
      responses:
        default:
          statusCode: '200'
      passthroughBehavior: when_no_match
      contentHandling: CONVERT_TO_TEXT
      type: aws_proxy
  securitySchemes:
    MyCognito:
      type: apiKey
      name: Authorization
      in: header
      x-amazon-apigateway-authtype: cognito_user_pools
      x-amazon-apigateway-authorizer:
        providerARNs:
          - >-
            arn:aws:cognito-idp:ap-southeast-1:300902935450:userpool/ap-southeast-1_9uTlq8Kiv
        type: cognito_user_pools
  parameters:
    sendEmail:
      in: path
      name: email
      description: email address to send
      required: true
      schema:
        type: string
    pathFileName:
      in: path
      name: fileName
      description: uploaded File Name
      required: true
      schema:
        type: string
    pathPageId:
      in: path
      name: pageId
      description: Page identity
      required: true
      schema:
        type: string
    pathSessionId:
      in: path
      name: sessionId
      description: Session identity
      required: true
      schema:
        type: string
    pathCartId:
      in: path
      name: cartId
      description: Cart identity
      required: true
      schema:
        type: string
    pathInventoryId:
      in: path
      required: true
      name: inventoryId
      schema:
        type: string
    pathPriceId:
      in: path
      required: true
      name: priceId
      schema:
        type: string
    pathShippingFeeTemplateId:
      in: path
      required: true
      name: shippingFeeTemplateId
      schema:
        type: string
    pathTenantId:
      in: path
      required: true
      name: tenantId
      schema:
        type: string
    pathPageTenantId:
      in: path
      required: true
      name: tenantId
      schema:
        type: string
    pathAuthorizationCode:
      in: path
      required: true
      name: authorizationCode
      schema:
        type: string
    queryDownload:
      in: query
      name: download
      schema:
        type: string
        enum:
          - csv
    queryPaid:
      in: query
      name: paid
      description: Cart is paid
      schema:
        type: boolean
    querySkip:
      in: query
      name: skip
      description: Paging skip number
      schema:
        type: number
        default: 0
    queryTake:
      in: query
      name: take
      description: Paging take number
      schema:
        type: number
        default: 20
    queryPage:
      in: query
      name: page
      description: Page number
      schema:
        type: number
        default: 1
    querySize:
      in: query
      name: size
      description: Paging size
      schema:
        type: number
        default: 20
    queryFilters:
      in: query
      name: filters
      description: Filters
      schema:
        type: array
        items:
          type: string
    queryOrders:
      in: query
      name: orders
      description: Orders
      schema:
        type: array
        items:
          type: string
    querySessionId:
      in: query
      name: sessionId
      description: Session Id
      schema:
        type: string
    queryTenantId:
      in: query
      name: tenantId
      description: Tenant Id
      schema:
        type: string
  requestBodies:
    stripeWebhook:
      required: true
      content:
        application/json:
          schema:
            type: object
    updateTenant:
      required: true
      content:
        application/json:
          schema:
            type: object
            minProperties: 1
    createPage:
      required: true
      content:
        application/json:
          schema:
            type: object
            required:
              - pages
              - tenantId
              - accessToken
              - expiresAt
            properties:
              pages:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                    name:
                      type: string
                    accessToken:
                      type: string
              tenantId:
                type: string
              expiresAt:
                type: string
    createSession:
      required: true
      content:
        application/json:
          schema:
            type: object
            required:
              - pageId
              - name
              - currency
            properties:
              pageId:
                type: string
              name:
                type: string
                minLength: 5
              currency:
                type: string
              expiredAt:
                type: string
                format: date-time
              postURL:
                type: string
                format: uri
              ignoreInventory:
                type: boolean
                default: false
              importFileURL:
                type: string
                format: uri
              shippingFees:
                type: array
                items:
                  type: object
                  properties:
                    name:
                      type: string
                    fee:
                      type: string
    updateSession:
      required: true
      content:
        application/json:
          schema:
            type: object
            minProperties: 1
            properties:
              name:
                type: string
                minLength: 5
              currency:
                type: string
              expiredAt:
                type: string
                format: date-time
              postURL:
                type: string
                format: uri
                nullable: true
              ignoreInventory:
                type: boolean
    updateSessionShippingFees:
      required: true
      content:
        application/json:
          schema:
            type: array
            minItems: 1
            items:
              oneOf:
                - $ref: '#/components/schemas/deleteEntityById'
                - $ref: '#/components/schemas/sessionShippingFeeProp'
                - $ref: '#/components/schemas/sessionShippingFee'
    updateSessionItems:
      required: true
      content:
        application/json:
          schema:
            type: array
            minItems: 1
            items:
              oneOf:
                - $ref: '#/components/schemas/deleteEntityById'
                - $ref: '#/components/schemas/sessionItemProp'
                - $ref: '#/components/schemas/sessionItem'
    updateInventory:
      required: true
      content:
        application/json:
          schema:
            type: object
            minProperties: 1
            properties:
              name:
                type: string
              delete:
                type: array
                minItems: 1
                items:
                  type: string
                  description: product code
              upsert:
                $ref: '#/components/schemas/sessionInventoryItem'
    updatePage:
      required: true
      content:
        application/json:
          schema:
            type: object
            minProperties: 1
            properties:
              name:
                type: string
              username:
                type: string
    updateCart:
      required: true
      content:
        application/json:
          schema:
            type: object
            properties:
              shippingFeeId:
                type: string
              deliverTo:
                $ref: '#/components/schemas/deliverTo'
    updateCartsDelivery:
      required: true
      content:
        application/json:
          schema:
            type: array
            items:
              type: object
              required:
                - id
                - deliveryTrackingNumber
                - deliveryServiceProvider
              properties:
                id:
                  type: string
                deliveryTrackingNumber:
                  type: string
                deliveryServiceProvider:
                  type: string
    updateCartItems:
      required: true
      content:
        application/json:
          schema:
            type: object
            additionalProperties:
              type: integer
              minimum: 0
            example:
              code1: 2
              code2: 0
    putCartItems:
      required: true
      content:
        application/json:
          schema:
            type: object
    putTenant:
      required: true
      content:
        application/json:
          schema:
            type: object
            properties:
              id:
                type: string
              name:
                type: string
              email:
                type: string
              picture:
                type: string
  schemas:
    clientSecretResponse:
      type: object
      properties:
        amount:
          type: string
        currency:
          type: string
        clientSecret:
          type: string
    subscribeResponse:
      type: object
      properties:
        url:
          type: string
    linkStripeAccount:
      type: object
      properties:
        url:
          type: string
    tenantPayment:
      type: object
      properties:
        invoice:
          type: string
        amount:
          type: number
        invoicePDF:
          type: string
    sessions:
      type: array
      items:
        $ref: '#/components/schemas/session'
    session:
      type: object
      properties:
        id:
          type: string
        pageId:
          type: string
        name:
          type: string
        currency:
          type: string
        expiredAt:
          type: string
        postURL:
          type: string
          nullable: true
          format: uri
        items:
          $ref: '#/components/schemas/sessionItems'
        ignoreIventory:
          type: boolean
        shippingFees:
          type: array
          items:
            $ref: '#/components/schemas/sessionShippingFee'
    sessionById:
      type: object
      properties:
        id:
          type: string
        pageId:
          type: string
        name:
          type: string
        expiredAt:
          type: string
        postURL:
          type: string
          nullable: true
          format: uri
        items:
          $ref: '#/components/schemas/sessionItems'
        ignoreIventory:
          type: boolean
        page:
          $ref: '#/components/schemas/sessionPage'
        shippingFees:
          type: array
          items:
            $ref: '#/components/schemas/sessionShippingFee'
    sessionPage:
      type: object
      properties:
        id:
          type: string
        tenantId:
          type: string
        name:
          type: string
        expiredAt:
          type: string
        username:
          type: string
    sessionItems:
      type: array
      items:
        $ref: '#/components/schemas/sessionItem'
    sessionItem:
      allOf:
        - type: object
          properties:
            id:
              type: string
        - $ref: '#/components/schemas/sessionItemProp'
    sessionItemProp:
      type: object
      properties:
        code:
          type: string
        name:
          type: string
        price:
          type: number
          minimum: 0
        quantity:
          type: integer
          minimum: 0
    sessionShippingFeeProp:
      type: object
      properties:
        name:
          type: string
        fee:
          type: string
    sessionShippingFee:
      allOf:
        - type: object
          properties:
            id:
              type: string
        - $ref: '#/components/schemas/sessionShippingFeeProp'
    sessionShippingFees:
      type: array
      items:
        $ref: '#/components/schemas/sessionShippingFee'
    sessionInventoryItem:
      type: object
      additionalProperties:
        type: object
        properties:
          quantity:
            type: integer
            minimum: 0
    tenant:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        email:
          type: string
        picture:
          type: string
        stripeAccount:
          type: string
        stringAccountPaymentEnabled:
          type: boolean
    cartDetail:
      type: object
      properties:
        id:
          type: string
        sessionId:
          type: string
        customerId:
          type: string
        paid:
          type: boolean
        paidAt:
          type: string
        customerName:
          type: string
        items:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              price:
                type: number
              quantity:
                type: number
        deliverTo:
          $ref: '#/components/schemas/deliverTo'
        total:
          type: number
        stripeFee:
          type: number
        applicationFee:
          type: number
    cartsDetail:
      type: array
      items:
        $ref: '#/components/schemas/cartDetail'
    deliverTo:
      type: object
      properties:
        name:
          type: string
        contactNo:
          type: string
          pattern: /^\+?[0-9]+$/
        address:
          type: object
          required:
            - address
            - postcode
            - city
            - state
            - country
          properties:
            address:
              type: string
            postcode:
              type: number
            city:
              type: string
            state:
              type: string
            country:
              type: string
    page:
      type: object
      properties:
        id:
          type: string
        tenantId:
          type: string
        name:
          type: string
        expiresAt:
          type: string
        username:
          type: string
        haveFacebookAccess:
          type: boolean
    pages:
      type: array
      items:
        $ref: '#/components/schemas/page'
    deleteEntityById:
      type: object
      properties:
        id:
          type: string
        delete:
          type: boolean
