openapi: 3.0.0
paths:
  /v1/orders/{sourceOrderId}:
    get:
      operationId: OrdersApiController_findOne
      summary: Retrieve Order
      parameters:
        - name: sourceOrderId
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Order'
        '401':
          description: Unauthorized.
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiExceptionResponse'
      tags:
        - Orders
      security:
        - bearer: []
    put:
      operationId: OrdersApiController_updateOrder
      summary: Update order
      parameters:
        - name: sourceOrderId
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderUpdateDto'
      responses:
        '200':
          description: The order has been successfully updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OkStatusResponse'
        '400':
          description: Bad Request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestExceptionResponse'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedExceptionResponse'
        '404':
          description: Order not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundExceptionResponse'
      tags:
        - Orders
      security:
        - bearer: []
    delete:
      operationId: OrdersApiController_removeOrder
      summary: Delete order
      parameters:
        - name: sourceOrderId
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: The order has been successfully mark for cancelled.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OkStatusResponse'
        '401':
          description: Unauthorized.
        '404':
          description: Order not found.
      tags:
        - Orders
      security:
        - bearer: []
  /v1/orders:
    get:
      operationId: OrdersApiController_findAll
      summary: List Orders
      parameters:
        - name: size
          required: false
          in: query
          example: '5'
          description: Number of records
          schema:
            type: number
        - name: cursor
          required: false
          in: query
          example: c2FsdHlzYWx0Y2xwcjA0YzgzMDAxazF6YmgxMzAxMWY3Zg==
          description: Record cursor
          schema:
            type: string
        - name: buttonNum
          required: false
          in: query
          example: '5'
          description: Number of pages on page cursors
          schema:
            type: number
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/PaginatedDto'
                  - properties:
                      edges:
                        type: array
                        items:
                          $ref: '#/components/schemas/PaginatedResult'
                          properties:
                            node:
                              $ref: '#/components/schemas/Order'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedExceptionResponse'
      tags:
        - Orders
      security:
        - bearer: []
    post:
      operationId: OrdersApiController_createOrder
      summary: Create order
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderCreateDto'
      responses:
        '201':
          description: The order passes validation and has been successfully created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OkStatusResponse'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedExceptionResponse'
        '409':
          description: Order with same sourceOrderId already exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiExceptionResponse'
      tags:
        - Orders
      security:
        - bearer: []
  /v1/orders/{sourceOrderId}/fulfillments:
    get:
      operationId: FulfillmentsController_getOrderFulfillments
      summary: Get Fulfillment
      parameters:
        - name: sourceOrderId
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: Return list of order fulfillments.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CreateFulfillmentInput'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedExceptionResponse'
        '404':
          description: Order or order item not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundExceptionResponse'
      tags:
        - Fulfillments
      security:
        - bearer: []
    post:
      operationId: FulfillmentsController_createFulfillment
      summary: Create Fulfillment
      parameters:
        - name: sourceOrderId
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateFulfillmentInput'
      responses:
        '201':
          description: The fulfillment has been successfully created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OkStatusResponse'
        '400':
          description: Bad Request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestExceptionResponse'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedExceptionResponse'
        '404':
          description: Order or order item not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundExceptionResponse'
      tags:
        - Fulfillments
      security:
        - bearer: []
  /v1/orders/{sourceOrderId}/fulfillments/{sourceFulfillmentId}:
    put:
      operationId: FulfillmentsController_updateFulfillment
      summary: Update Fulfillment
      parameters:
        - name: sourceFulfillmentId
          required: true
          in: path
          schema:
            type: string
        - name: sourceOrderId
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateFulfillmentStatusInput'
      responses:
        '200':
          description: The fulfillment has been successfully updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OkStatusResponse'
        '400':
          description: Bad Request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestExceptionResponse'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedExceptionResponse'
        '404':
          description: Order, order item or fulfillment not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundExceptionResponse'
      tags:
        - Fulfillments
      security:
        - bearer: []
    delete:
      operationId: FulfillmentsController_removeFulfillment
      summary: Delete Fulfillment
      parameters:
        - name: sourceOrderId
          required: true
          in: path
          schema:
            type: string
        - name: sourceFulfillmentId
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: The fulfillment has been successfully mark for cancelled.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OkStatusResponse'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedExceptionResponse'
        '404':
          description: Order, order item or fulfillment not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundExceptionResponse'
      tags:
        - Fulfillments
      security:
        - bearer: []
  /v1/internal/fulfillments/{storeId}/{sourceOrderId}:
    post:
      operationId: FulfillmentsInternalController_createFulfillment
      parameters:
        - name: sourceOrderId
          required: true
          in: path
          schema:
            type: string
        - name: storeId
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateFulfillmentInput'
      responses:
        '201':
          description: ''
  /v1/internal/fulfillments/{sourceOrderId}/{id}:
    get:
      operationId: FulfillmentsInternalController_getFulfillment
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
        - name: sourceOrderId
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: ''
  /v1/returns/filters:
    get:
      operationId: ReturnsAppController_getFilters
      parameters: []
      responses:
        '200':
          description: ''
  /v1/returns/{id}:
    get:
      operationId: ReturnsAppController_findById
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: ''
    put:
      operationId: ReturnsConciergeController_updateReturn
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: ''
  /v1/returns:
    get:
      operationId: ReturnsAppController_getReturns
      parameters:
        - name: filters
          required: true
          in: query
          schema:
            type: string
        - name: page
          required: true
          in: query
          schema:
            type: number
        - name: limit
          required: true
          in: query
          schema:
            type: number
      responses:
        '200':
          description: ''
    post:
      operationId: ReturnsConciergeController_createReturn
      parameters: []
      responses:
        '201':
          description: ''
  /v1/returns/settings/{storeId}:
    get:
      operationId: ReturnsConciergeController_getReturnsProviderSettings
      parameters:
        - name: storeId
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: ''
  /v1/returns/link:
    post:
      operationId: ReturnsConciergeController_createDeepReturnLink
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeepLinkDto'
      responses:
        '201':
          description: ''
  /v1/returns/{id}/items:
    post:
      operationId: ReturnsConciergeController_addItem
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '201':
          description: ''
  /v1/returns/{id}/items/{itemId}:
    delete:
      operationId: ReturnsConciergeController_removeItem
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
        - name: itemId
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: ''
  /v1/returns/parcellab:
    post:
      operationId: ParcelLabReturnsController_upsertReturn
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpsertReturnDto'
      responses:
        '201':
          description: ''
  /v1/returns/parcellab/settings/store/{storeId}:
    get:
      operationId: ParcelLabSettingsController_getSettings
      parameters:
        - name: storeId
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: ''
    put:
      operationId: ParcelLabSettingsController_updateSettings
      parameters:
        - name: storeId
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateReturnSettingDto'
      responses:
        '200':
          description: ''
  /v1/returns/loop:
    post:
      operationId: LoopReturnsController_handleWebhook
      parameters: []
      responses:
        '201':
          description: ''
  /v2/products/{productId}:
    get:
      operationId: ProductApiController_findOne
      summary: Retrieve product
      parameters:
        - name: productId
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProductEntity'
        '401':
          description: Unauthorized.
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiExceptionResponse'
      tags:
        - Products
      security:
        - bearer: []
    put:
      operationId: ProductApiController_updateProduct
      summary: Update product children
      parameters:
        - name: productId
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateProductDto'
      responses:
        '200':
          description: The product has been successfully updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OkStatusResponse'
        '400':
          description: Bad Request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestExceptionResponse'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedExceptionResponse'
        '404':
          description: Product not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundExceptionResponse'
      tags:
        - Products
      security:
        - bearer: []
    delete:
      operationId: ProductApiController_deleteProduct
      summary: Delete all product children
      parameters:
        - name: productId
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: The products have been successfully deleted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OkStatusResponse'
        '400':
          description: Bad Request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestExceptionResponse'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedExceptionResponse'
        '404':
          description: Product not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundExceptionResponse'
      tags:
        - Products
      security:
        - bearer: []
  /v2/products:
    get:
      operationId: ProductApiController_listProducts
      summary: Create Product children
      parameters: []
      responses:
        '201':
          description: The product passes validation and has been successfully created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OkStatusResponse'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedExceptionResponse'
        '409':
          description: Product already exists.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiExceptionResponse'
      tags:
        - Products
      security:
        - bearer: []
    post:
      operationId: ProductApiController_createProduct
      summary: Create Product children
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateProductDto'
      responses:
        '201':
          description: The product passes validation and has been successfully created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OkStatusResponse'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedExceptionResponse'
        '409':
          description: Product already exists.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiExceptionResponse'
      tags:
        - Products
      security:
        - bearer: []
  /v2/products/{productId}/children:
    get:
      operationId: ProductApiController_getProductVariants
      summary: Retrieve all children of a product
      parameters:
        - name: productId
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ProductEntity'
        '401':
          description: Unauthorized.
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiExceptionResponse'
      tags:
        - Products
      security:
        - bearer: []
    post:
      operationId: ProductApiController_createProductVariants
      summary: Create product variant
      parameters:
        - name: productId
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateProductDto'
      responses:
        '201':
          description: The variant passes validation and has been successfully created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OkStatusResponse'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedExceptionResponse'
        '409':
          description: Variant already exists.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiExceptionResponse'
      tags:
        - Products
      security:
        - bearer: []
  /v2/products/{productId}/bundle:
    get:
      operationId: ProductApiController_getProductBundle
      summary: Retrieve all children of a product
      parameters:
        - name: productId
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ProductEntity'
        '401':
          description: Unauthorized.
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiExceptionResponse'
      tags:
        - Products
      security:
        - bearer: []
    post:
      operationId: ProductApiController_addToProductBundle
      summary: Update specific product children
      parameters:
        - name: productId
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddProductsToBundleDto'
      responses:
        '200':
          description: The product variant has been successfully updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OkStatusResponse'
        '400':
          description: Bad Request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestExceptionResponse'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedExceptionResponse'
        '404':
          description: Variant not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundExceptionResponse'
      tags:
        - Products
      security:
        - bearer: []
  /v2/products/{productId}/children/{childId}:
    get:
      operationId: ProductApiController_findManyVariants
      summary: Retrieve specific product variant
      parameters:
        - name: childId
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProductCreateDto'
        '401':
          description: Unauthorized.
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiExceptionResponse'
      tags:
        - Products
      security:
        - bearer: []
    put:
      operationId: ProductApiController_updateProductVariants
      summary: Update specific product children
      parameters:
        - name: childId
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateProductDto'
      responses:
        '200':
          description: The product variant has been successfully updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OkStatusResponse'
        '400':
          description: Bad Request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestExceptionResponse'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedExceptionResponse'
        '404':
          description: Variant not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundExceptionResponse'
      tags:
        - Products
      security:
        - bearer: []
    delete:
      operationId: ProductApiController_deleteProductVariant
      summary: Delete specific product children
      parameters:
        - name: childId
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: The product variant has been successfully deleted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OkStatusResponse'
        '400':
          description: Bad Request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestExceptionResponse'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedExceptionResponse'
        '404':
          description: Variant not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundExceptionResponse'
      tags:
        - Products
      security:
        - bearer: []
  /v2/products/{productId}/bundle/remove:
    post:
      operationId: ProductApiController_removeProductsFromBundle
      summary: Update specific product children
      parameters:
        - name: productId
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddProductsToBundleDto'
      responses:
        '200':
          description: The product variant has been successfully updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OkStatusResponse'
        '400':
          description: Bad Request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestExceptionResponse'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedExceptionResponse'
        '404':
          description: Variant not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundExceptionResponse'
      tags:
        - Products
      security:
        - bearer: []
  /v2/products/{productId}/options:
    put:
      operationId: ProductApiController_updateProductOptions
      summary: Updates product options associated with a product
      parameters:
        - name: productId
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              items:
                type: string
      responses:
        '200':
          description: The product variant has been successfully updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OkStatusResponse'
        '400':
          description: Bad Request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestExceptionResponse'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedExceptionResponse'
        '404':
          description: Variant not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundExceptionResponse'
      tags:
        - Products
      security:
        - bearer: []
  /v1/orders/customers/all:
    get:
      operationId: CustomersApiController_getAllStoreCustomers
      parameters:
        - name: storeId
          required: true
          in: query
          schema:
            type: string
      responses:
        '200':
          description: ''
      security:
        - bearer: []
  /v1/orders/customers/{customerId}:
    get:
      operationId: CustomersApiController_getCustomerById
      parameters:
        - name: customerId
          required: true
          in: path
          schema:
            type: string
        - name: storeId
          required: true
          in: query
          schema:
            type: string
      responses:
        '200':
          description: ''
      security:
        - bearer: []
  /v1/orders/customers/{customerId}/protected:
    get:
      operationId: CustomersApiController_getCustomerProtectedOrders
      parameters:
        - name: customerId
          required: true
          in: path
          schema:
            type: string
        - name: storeId
          required: true
          in: query
          schema:
            type: string
      responses:
        '200':
          description: ''
      security:
        - bearer: []
info:
  title: Orders Service
  description: Orders service API
  version: 1.0.0
  contact: {}
tags:
  - name: orders
    description: ''
servers:
  - url: https://api.production.orderprotection.com
    description: Production server
components:
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http
  schemas:
    PaginatedDto:
      type: object
      properties:
        pageInfo:
          type: object
          example:
            startCursor: ''
            endCursor: ''
            hasNextPage: false
            hasPreviousPage: false
        pageCursors:
          type: object
          example:
            around:
              - cursor: YXJyYXljb25uZWN0aW9uOjA=
                page: 1
                isCurrent: true
        totalCount:
          type: number
          example: 5
      required:
        - pageInfo
        - pageCursors
        - totalCount
    PaginatedResult:
      type: object
      properties:
        cursor:
          type: string
          example: YXJyYXljb25uZWN0aW9uOjA=
      required:
        - cursor
    ApiExceptionResponse:
      type: object
      properties:
        message:
          type: string
          readOnly: true
          example: order not found
        error:
          type: string
          readOnly: true
          example: Not Found
        statusCode:
          type: number
          readOnly: true
          example: 404
      required:
        - message
        - error
        - statusCode
    OkStatusResponse:
      type: object
      properties:
        status:
          type: string
          readOnly: true
          deprecated: false
          example: ok
      required:
        - status
    BadRequestExceptionResponse:
      type: object
      properties:
        message:
          type: string
          readOnly: true
          example: '''sourceOrderId'' is required'
        statusCode:
          type: number
          readOnly: true
          example: 400
      required:
        - message
        - statusCode
    UnauthorizedExceptionResponse:
      type: object
      properties:
        message:
          type: string
          readOnly: true
          example: Unauthorized
        statusCode:
          type: number
          readOnly: true
          example: 401
      required:
        - message
        - statusCode
    Order:
      type: object
      properties:
        id:
          type: string
          readOnly: true
          example: asdasdfasdfasdfasdf
        fulfillments:
          readOnly: true
          example:
            - id: '12345'
              sourceOrderId: '12345'
              fulfillmentStatus: shipped
              trackingCompany: ups
              trackingNumber: '12345'
              sourceItemIds:
                - id: '12345'
                  quantity: 1
          type: array
          items:
            type: string
        sourceOrderId:
          type: string
          readOnly: true
          example: '12345'
        originalSourceOrderId:
          type: string
          readOnly: true
          example: '12345'
        originalOrderId:
          type: string
          readOnly: true
          example: '12345'
        sourceOrderNumber:
          type: string
          readOnly: true
          example: '#12345'
        sourceCreatedAt:
          format: date-time
          type: string
          readOnly: true
          example: '2000-05-15T21:00:00.000Z'
        sourceUpdatedAt:
          format: date-time
          type: string
          readOnly: true
          example: '2026-05-11T20:49:04.472Z'
        sourceCancelledAt:
          format: date-time
          type: string
          readOnly: true
          example: '2026-05-11T20:49:04.473Z'
        policyCancelledAt:
          format: date-time
          type: string
          readOnly: true
          example: '2026-05-11T20:49:04.473Z'
        platformId:
          type: string
          readOnly: true
          example: api
          enum:
            - shopify
            - woocommerce
            - magento
            - bigcommerce
            - fluid
            - api
        premiumPaid:
          type: number
          readOnly: true
          example: '2026-05-11T20:49:04.473Z'
        premiumCost:
          type: number
          readOnly: true
          example: '2026-05-11T20:49:04.473Z'
        currency:
          type: string
          readOnly: true
          enum:
            - ADP
            - AED
            - AFA
            - AFN
            - ALK
            - ALL
            - AMD
            - ANG
            - AOA
            - AOK
            - AON
            - AOR
            - ARA
            - ARP
            - ARS
            - ARY
            - ATS
            - AUD
            - AWG
            - AYM
            - AZM
            - AZN
            - BAD
            - BAM
            - BBD
            - BDT
            - BEC
            - BEF
            - BEL
            - BGJ
            - BGK
            - BGL
            - BGN
            - BHD
            - BIF
            - BMD
            - BND
            - BOB
            - BOP
            - BOV
            - BRB
            - BRC
            - BRE
            - BRL
            - BRN
            - BRR
            - BSD
            - BTN
            - BUK
            - BWP
            - BYB
            - BYN
            - BYR
            - BZD
            - CAD
            - CDF
            - CHC
            - CHE
            - CHF
            - CHW
            - CLF
            - CLP
            - CNY
            - COP
            - COU
            - CRC
            - CSD
            - CSJ
            - CSK
            - CUC
            - CUP
            - CVE
            - CYP
            - CZK
            - DDM
            - DEM
            - DJF
            - DKK
            - DOP
            - DZD
            - ECS
            - ECV
            - EEK
            - EGP
            - ERN
            - ESA
            - ESB
            - ESP
            - ETB
            - EUR
            - FIM
            - FJD
            - FKP
            - FRF
            - GBP
            - GEK
            - GEL
            - GHC
            - GHP
            - GHS
            - GIP
            - GMD
            - GNE
            - GNF
            - GNS
            - GQE
            - GRD
            - GTQ
            - GWE
            - GWP
            - GYD
            - HKD
            - HNL
            - HRD
            - HRK
            - HTG
            - HUF
            - IDR
            - IEP
            - ILP
            - ILR
            - ILS
            - INR
            - IQD
            - IRR
            - ISJ
            - ISK
            - ITL
            - JMD
            - JOD
            - JPY
            - KES
            - KGS
            - KHR
            - KMF
            - KPW
            - KRW
            - KWD
            - KYD
            - KZT
            - LAJ
            - LAK
            - LBP
            - LKR
            - LRD
            - LSL
            - LSM
            - LTL
            - LTT
            - LUC
            - LUF
            - LUL
            - LVL
            - LVR
            - LYD
            - MAD
            - MDL
            - MGA
            - MGF
            - MKD
            - MLF
            - MMK
            - MNT
            - MOP
            - MRO
            - MRU
            - MTL
            - MTP
            - MUR
            - MVQ
            - MVR
            - MWK
            - MXN
            - MXP
            - MXV
            - MYR
            - MZE
            - MZM
            - MZN
            - NAD
            - NGN
            - NIC
            - NIO
            - NLG
            - NOK
            - NPR
            - NZD
            - OMR
            - PAB
            - PEH
            - PEI
            - PEN
            - PES
            - PGK
            - PHP
            - PKR
            - PLN
            - PLZ
            - PTE
            - PYG
            - QAR
            - RHD
            - ROK
            - ROL
            - RON
            - RSD
            - RUB
            - RUR
            - RWF
            - SAR
            - SBD
            - SCR
            - SDD
            - SDG
            - SDP
            - SEK
            - SGD
            - SHP
            - SIT
            - SKK
            - SLL
            - SOS
            - SRD
            - SRG
            - SSP
            - STD
            - STN
            - SUR
            - SVC
            - SYP
            - SZL
            - THB
            - TJR
            - TJS
            - TMM
            - TMT
            - TND
            - TOP
            - TPE
            - TRL
            - TRY
            - TTD
            - TWD
            - TZS
            - UAH
            - UAK
            - UGS
            - UGW
            - UGX
            - USD
            - USN
            - USS
            - UYI
            - UYN
            - UYP
            - UYU
            - UYW
            - UZS
            - VEB
            - VEF
            - VES
            - VNC
            - VND
            - VUV
            - WST
            - XAF
            - XAG
            - XAU
            - XBA
            - XBB
            - XBC
            - XBD
            - XCD
            - XDR
            - XEU
            - XFO
            - XFU
            - XOF
            - XPD
            - XPF
            - XPT
            - XRE
            - XSU
            - XTS
            - XUA
            - XXX
            - YDD
            - YER
            - YUD
            - YUM
            - YUN
            - ZAL
            - ZAR
            - ZMK
            - ZMW
            - ZRN
            - ZRZ
            - ZWC
            - ZWD
            - ZWL
            - ZWN
            - ZWR
          example: USD
        orderItems:
          readOnly: true
          example:
            - id: clv5u1ix00002pheol047kwrv
              orderId: clv5u1ix00000pheoqpxke986
              productName: Handcrafted Wooden Table
              productUrl: https://bogus-clarity.name/
              productImage: https://picsum.photos/seed/orderprotection1/200/300
              itemDescription: null
              sku: 978-0-10-081434-9
              selectedOptions: []
              quantity: 20
              price: 31.5
              discount: 0
              tax: 0
              sourceItemId: '387179'
              sourceProductId: '477353'
              sourceVariantId: '17742'
              addressId: null
              createdAt: '2024-04-18T22:48:08.964Z'
              updatedAt: '2024-04-18T22:48:08.964Z'
              refundedQuantity: 0
            - id: clv5u1ix00003pheom3edzt29
              orderId: clv5u1ix00000pheoqpxke986
              productName: Crazy T-Shirt
              selectedOptions: []
              productUrl: https://test.site/
              productImage: https://picsum.photos/seed/orderprotection2/200/300
              itemDescription: null
              sku: '5555'
              quantity: 3
              price: 32.2
              discount: 0
              tax: 0
              sourceItemId: '387180'
              sourceProductId: '477353'
              sourceVariantId: '17742'
              addressId: null
              createdAt: '2024-04-18T22:48:08.964Z'
              updatedAt: '2024-04-18T22:48:08.964Z'
              refundedQuantity: 0
          type: array
          items:
            type: string
        total:
          type: number
          readOnly: true
          example: 12.55
        discountTotal:
          type: number
          readOnly: true
          example: 2.55
        shippingCost:
          type: number
          readOnly: true
          example: 7.55
        shippingCostTax:
          type: number
          readOnly: true
          example: 1.44
        tax:
          type: number
          readOnly: true
          example: 1.44
        subtotal:
          type: number
          readOnly: true
          example: 1200
        customerEmail:
          type: string
          readOnly: true
          example: customer@email.com
        customerName:
          type: string
          readOnly: true
          example: John Doe
        customerPhone:
          type: string
          readOnly: true
          example: (801) 555-5555
          format: phone
        exchangeRate:
          type: number
          readOnly: true
          example: 1
        storeId:
          type: string
          readOnly: true
          example: test
        policyId:
          type: string
          readOnly: true
          example: asdadsasdad
        eligibleForOta:
          type: boolean
          readOnly: true
          example: false
        createdAt:
          format: date-time
          type: string
          readOnly: true
          example: '2026-05-11T20:49:04.474Z'
        activities:
          readOnly: true
          example:
            - message: Order created
              orderId: asdasd
          type: array
          items:
            type: string
        updatedAt:
          format: date-time
          type: string
          readOnly: true
          example: '2026-05-11T20:49:04.474Z'
        deletedAt:
          format: date-time
          type: string
          readOnly: true
          example: '2026-05-11T20:49:04.474Z'
      required:
        - id
        - fulfillments
        - sourceOrderId
        - originalSourceOrderId
        - originalOrderId
        - sourceOrderNumber
        - sourceCreatedAt
        - sourceUpdatedAt
        - sourceCancelledAt
        - policyCancelledAt
        - platformId
        - premiumPaid
        - premiumCost
        - currency
        - orderItems
        - total
        - discountTotal
        - shippingCost
        - shippingCostTax
        - tax
        - subtotal
        - customerEmail
        - customerName
        - customerPhone
        - exchangeRate
        - storeId
        - policyId
        - eligibleForOta
        - createdAt
        - activities
        - updatedAt
        - deletedAt
    SelectedOptions:
      type: object
      properties:
        name:
          type: string
          example: Size
          description: Name associated with the selected option. e.g. size, color
        value:
          type: string
          example: XL
          description: Value associated with the name e.g. XS, Orange
      required:
        - name
        - value
    OrderItemDto:
      type: object
      properties:
        productName:
          type: string
          example: Handcrafted Soft Mouse
          description: Product name
        productUrl:
          type: string
          example: https://example.net/product/5
          description: Product URL
        productImage:
          type: string
          example: https://example.net/product/5/image.jpg
          description: Product Image URL
        sku:
          type: string
          example: 978-0-279-23986-8
          description: Product sku
        itemDescription:
          type: string
          example: 'Color: White. Size: 12'
          description: >-
            Product variant information to help determine which item was
            purchased
        quantity:
          type: number
          example: 2
          description: Product quantity
        price:
          type: number
          example: 1050
          description: Product price
        discount:
          type: number
          example: 1050
          description: Product discount
        tax:
          type: number
          example: 1050
          description: Product tax
        sourceItemId:
          type: string
          example: '396568'
          description: Product source item id
        sourceProductId:
          type: string
          example: '164073'
          description: Product source product id
        sourceVariantId:
          type: string
          example: '449493'
          description: Product source variant id
        selectedOptions:
          example:
            - name: Size
              value: XS
          default: []
          description: Options associated with a variant. e.g. size, color
          type: array
          items:
            $ref: '#/components/schemas/SelectedOptions'
      required:
        - productName
        - productUrl
        - productImage
        - sku
        - quantity
        - price
        - discount
        - tax
        - sourceItemId
        - sourceProductId
        - sourceVariantId
    OrderCreateDto:
      type: object
      properties:
        sourceOrderId:
          type: string
          example: '#517AB'
          description: Order ID on your platform
        originalSourceOrderNumber:
          type: string
          example: '12345'
          description: >-
            If this was a replacement for another Order, you can include the
            original order id here.
        originalSourceOrderId:
          type: string
          example: '12345'
          description: >-
            (DEPRECATED) The original order id. Please use
            originalSourceOrderNumber instead
        sourceOrderNumber:
          type: string
          example: '#634C'
          description: Order Number on your platform
        sourceCreatedAt:
          format: date-time
          type: string
          example: '2000-05-15T21:00:00.000Z'
          description: Creation date of the order on your platform
        sourceUpdatedAt:
          format: date-time
          type: string
          example: '2000-05-15T21:00:00.000Z'
          description: Updated date of the order on your platform
        sourceCancelledAt:
          format: date-time
          type: string
          example: '2000-05-15T21:00:00.000Z'
          description: Cancellation date of the order on your platform
        platformId:
          type: string
          example: api
          enum:
            - shopify
            - woocommerce
            - magento
            - bigcommerce
            - fluid
            - api
          description: Platform identifier
        premiumPaid:
          type: number
          example: 1.5
          description: Premium paid after discounts
        premiumCost:
          type: number
          example: 1
          description: Gross cost of revenue
        premiumDiscount:
          type: number
          example: 1
          description: Premium Discount
        riskLevel:
          type: string
          example: low
          description: The fraud analysis level for an order
        currency:
          type: string
          example: USD
          enum:
            - ADP
            - AED
            - AFA
            - AFN
            - ALK
            - ALL
            - AMD
            - ANG
            - AOA
            - AOK
            - AON
            - AOR
            - ARA
            - ARP
            - ARS
            - ARY
            - ATS
            - AUD
            - AWG
            - AYM
            - AZM
            - AZN
            - BAD
            - BAM
            - BBD
            - BDT
            - BEC
            - BEF
            - BEL
            - BGJ
            - BGK
            - BGL
            - BGN
            - BHD
            - BIF
            - BMD
            - BND
            - BOB
            - BOP
            - BOV
            - BRB
            - BRC
            - BRE
            - BRL
            - BRN
            - BRR
            - BSD
            - BTN
            - BUK
            - BWP
            - BYB
            - BYN
            - BYR
            - BZD
            - CAD
            - CDF
            - CHC
            - CHE
            - CHF
            - CHW
            - CLF
            - CLP
            - CNY
            - COP
            - COU
            - CRC
            - CSD
            - CSJ
            - CSK
            - CUC
            - CUP
            - CVE
            - CYP
            - CZK
            - DDM
            - DEM
            - DJF
            - DKK
            - DOP
            - DZD
            - ECS
            - ECV
            - EEK
            - EGP
            - ERN
            - ESA
            - ESB
            - ESP
            - ETB
            - EUR
            - FIM
            - FJD
            - FKP
            - FRF
            - GBP
            - GEK
            - GEL
            - GHC
            - GHP
            - GHS
            - GIP
            - GMD
            - GNE
            - GNF
            - GNS
            - GQE
            - GRD
            - GTQ
            - GWE
            - GWP
            - GYD
            - HKD
            - HNL
            - HRD
            - HRK
            - HTG
            - HUF
            - IDR
            - IEP
            - ILP
            - ILR
            - ILS
            - INR
            - IQD
            - IRR
            - ISJ
            - ISK
            - ITL
            - JMD
            - JOD
            - JPY
            - KES
            - KGS
            - KHR
            - KMF
            - KPW
            - KRW
            - KWD
            - KYD
            - KZT
            - LAJ
            - LAK
            - LBP
            - LKR
            - LRD
            - LSL
            - LSM
            - LTL
            - LTT
            - LUC
            - LUF
            - LUL
            - LVL
            - LVR
            - LYD
            - MAD
            - MDL
            - MGA
            - MGF
            - MKD
            - MLF
            - MMK
            - MNT
            - MOP
            - MRO
            - MRU
            - MTL
            - MTP
            - MUR
            - MVQ
            - MVR
            - MWK
            - MXN
            - MXP
            - MXV
            - MYR
            - MZE
            - MZM
            - MZN
            - NAD
            - NGN
            - NIC
            - NIO
            - NLG
            - NOK
            - NPR
            - NZD
            - OMR
            - PAB
            - PEH
            - PEI
            - PEN
            - PES
            - PGK
            - PHP
            - PKR
            - PLN
            - PLZ
            - PTE
            - PYG
            - QAR
            - RHD
            - ROK
            - ROL
            - RON
            - RSD
            - RUB
            - RUR
            - RWF
            - SAR
            - SBD
            - SCR
            - SDD
            - SDG
            - SDP
            - SEK
            - SGD
            - SHP
            - SIT
            - SKK
            - SLL
            - SOS
            - SRD
            - SRG
            - SSP
            - STD
            - STN
            - SUR
            - SVC
            - SYP
            - SZL
            - THB
            - TJR
            - TJS
            - TMM
            - TMT
            - TND
            - TOP
            - TPE
            - TRL
            - TRY
            - TTD
            - TWD
            - TZS
            - UAH
            - UAK
            - UGS
            - UGW
            - UGX
            - USD
            - USN
            - USS
            - UYI
            - UYN
            - UYP
            - UYU
            - UYW
            - UZS
            - VEB
            - VEF
            - VES
            - VNC
            - VND
            - VUV
            - WST
            - XAF
            - XAG
            - XAU
            - XBA
            - XBB
            - XBC
            - XBD
            - XCD
            - XDR
            - XEU
            - XFO
            - XFU
            - XOF
            - XPD
            - XPF
            - XPT
            - XRE
            - XSU
            - XTS
            - XUA
            - XXX
            - YDD
            - YER
            - YUD
            - YUM
            - YUN
            - ZAL
            - ZAR
            - ZMK
            - ZMW
            - ZRN
            - ZRZ
            - ZWC
            - ZWD
            - ZWL
            - ZWN
            - ZWR
          description: Order currency
        total:
          type: number
          example: 15.4
          description: Order total
        discountTotal:
          type: number
          example: 1.2
          description: Order discount
        shippingCost:
          type: number
          example: 3.5
          description: Order shipping cost
        tax:
          type: number
          example: 0.55
          description: Order tax
        subtotal:
          type: number
          example: 11.3
          description: Order subtotal
        customerEmail:
          type: string
          example: john@doe.com
          description: Customer email
        customerName:
          type: string
          example: John
          description: Customer name
        customerPhone:
          type: string
          example: +1-555-796-3644
          description: Customer phone number
        customerSourceId:
          type: string
          example: '123457958'
          description: Customer Shopify ID / OP Customer Source ID
        shippingCostTax:
          type: number
          example: 23.55
          description: Tax associated with shipping
        orderItems:
          example:
            - productName: Handcrafted Wooden Table
              productUrl: https://bogus-clarity.name/
              productImage: https://bogus-clarity.name/product/image.jpg
              sku: 978-0-10-081434-9
              quantity: 4
              price: 45.43
              sourceItemId: '387179'
              sourceProductId: '477353'
              sourceVariantId: '17742'
              description: 'Variant: White Oak. Size: 10''x10'''
            - productName: Another prod
              productUrl: https://test.site/
              sku: '5555'
              quantity: 4
              price: 45.43
              sourceItemId: '387180'
              sourceProductId: '477353'
              sourceVariantId: '17742'
              description: 'Variant: White Oak. Size: 10''x10'''
          description: Array of product items
          type: array
          items:
            $ref: '#/components/schemas/OrderItemDto'
        address:
          type: object
          example:
            firstName: Milford
            lastName: Mayert
            address1: 991 Nicolas Landing
            address2: Apt. 796
            city: Rippinfurt
            state: AZ
            zip: '08731'
            country: PR
          description: Shipping Address
        tags:
          type: string
          example: test,this,out
      required:
        - sourceOrderId
        - sourceCreatedAt
        - platformId
        - currency
        - total
        - subtotal
        - orderItems
        - address
    OrderUpdateDto:
      type: object
      properties:
        originalSourceOrderId:
          type: string
          example: '12345'
          description: >-
            If this was a replacement for another Order, you can include the
            original order id here.
        sourceOrderNumber:
          type: string
          example: '#634C'
          description: Order Number on your platform
        sourceCreatedAt:
          format: date-time
          type: string
          example: '2000-05-15T21:00:00.000Z'
          description: Creation date of the order on your platform
        sourceUpdatedAt:
          format: date-time
          type: string
          example: '2000-05-15T21:00:00.000Z'
          description: Updated date of the order on your platform
        sourceCancelledAt:
          format: date-time
          type: string
          example: '2000-05-15T21:00:00.000Z'
          description: Cancellation date of the order on your platform
        platformId:
          type: string
          example: api
          enum:
            - shopify
            - woocommerce
            - magento
            - bigcommerce
            - fluid
            - api
          description: Platform identifier
        premiumPaid:
          type: number
          example: '1.5'
          description: Premium paid
        currency:
          type: string
          example: USD
          enum:
            - ADP
            - AED
            - AFA
            - AFN
            - ALK
            - ALL
            - AMD
            - ANG
            - AOA
            - AOK
            - AON
            - AOR
            - ARA
            - ARP
            - ARS
            - ARY
            - ATS
            - AUD
            - AWG
            - AYM
            - AZM
            - AZN
            - BAD
            - BAM
            - BBD
            - BDT
            - BEC
            - BEF
            - BEL
            - BGJ
            - BGK
            - BGL
            - BGN
            - BHD
            - BIF
            - BMD
            - BND
            - BOB
            - BOP
            - BOV
            - BRB
            - BRC
            - BRE
            - BRL
            - BRN
            - BRR
            - BSD
            - BTN
            - BUK
            - BWP
            - BYB
            - BYN
            - BYR
            - BZD
            - CAD
            - CDF
            - CHC
            - CHE
            - CHF
            - CHW
            - CLF
            - CLP
            - CNY
            - COP
            - COU
            - CRC
            - CSD
            - CSJ
            - CSK
            - CUC
            - CUP
            - CVE
            - CYP
            - CZK
            - DDM
            - DEM
            - DJF
            - DKK
            - DOP
            - DZD
            - ECS
            - ECV
            - EEK
            - EGP
            - ERN
            - ESA
            - ESB
            - ESP
            - ETB
            - EUR
            - FIM
            - FJD
            - FKP
            - FRF
            - GBP
            - GEK
            - GEL
            - GHC
            - GHP
            - GHS
            - GIP
            - GMD
            - GNE
            - GNF
            - GNS
            - GQE
            - GRD
            - GTQ
            - GWE
            - GWP
            - GYD
            - HKD
            - HNL
            - HRD
            - HRK
            - HTG
            - HUF
            - IDR
            - IEP
            - ILP
            - ILR
            - ILS
            - INR
            - IQD
            - IRR
            - ISJ
            - ISK
            - ITL
            - JMD
            - JOD
            - JPY
            - KES
            - KGS
            - KHR
            - KMF
            - KPW
            - KRW
            - KWD
            - KYD
            - KZT
            - LAJ
            - LAK
            - LBP
            - LKR
            - LRD
            - LSL
            - LSM
            - LTL
            - LTT
            - LUC
            - LUF
            - LUL
            - LVL
            - LVR
            - LYD
            - MAD
            - MDL
            - MGA
            - MGF
            - MKD
            - MLF
            - MMK
            - MNT
            - MOP
            - MRO
            - MRU
            - MTL
            - MTP
            - MUR
            - MVQ
            - MVR
            - MWK
            - MXN
            - MXP
            - MXV
            - MYR
            - MZE
            - MZM
            - MZN
            - NAD
            - NGN
            - NIC
            - NIO
            - NLG
            - NOK
            - NPR
            - NZD
            - OMR
            - PAB
            - PEH
            - PEI
            - PEN
            - PES
            - PGK
            - PHP
            - PKR
            - PLN
            - PLZ
            - PTE
            - PYG
            - QAR
            - RHD
            - ROK
            - ROL
            - RON
            - RSD
            - RUB
            - RUR
            - RWF
            - SAR
            - SBD
            - SCR
            - SDD
            - SDG
            - SDP
            - SEK
            - SGD
            - SHP
            - SIT
            - SKK
            - SLL
            - SOS
            - SRD
            - SRG
            - SSP
            - STD
            - STN
            - SUR
            - SVC
            - SYP
            - SZL
            - THB
            - TJR
            - TJS
            - TMM
            - TMT
            - TND
            - TOP
            - TPE
            - TRL
            - TRY
            - TTD
            - TWD
            - TZS
            - UAH
            - UAK
            - UGS
            - UGW
            - UGX
            - USD
            - USN
            - USS
            - UYI
            - UYN
            - UYP
            - UYU
            - UYW
            - UZS
            - VEB
            - VEF
            - VES
            - VNC
            - VND
            - VUV
            - WST
            - XAF
            - XAG
            - XAU
            - XBA
            - XBB
            - XBC
            - XBD
            - XCD
            - XDR
            - XEU
            - XFO
            - XFU
            - XOF
            - XPD
            - XPF
            - XPT
            - XRE
            - XSU
            - XTS
            - XUA
            - XXX
            - YDD
            - YER
            - YUD
            - YUM
            - YUN
            - ZAL
            - ZAR
            - ZMK
            - ZMW
            - ZRN
            - ZRZ
            - ZWC
            - ZWD
            - ZWL
            - ZWN
            - ZWR
          description: Order currency
        total:
          type: number
          example: '15.40'
          description: Order total
        discountTotal:
          type: number
          example: '1.20'
          description: Order discount
        shippingCost:
          type: number
          example: '3.50'
          description: Order shipping cost
        tax:
          type: number
          example: '0.55'
          description: Order tax
        subtotal:
          type: number
          example: '11.30'
          description: Order subtotal
        customerEmail:
          type: string
          example: john@doe.com
          description: Customer email
        customerName:
          type: string
          example: John
          description: Customer name
        customerPhone:
          type: string
          example: +1-555-796-3644
          description: Customer phone number
        shippingCostTax:
          type: number
          example: '234'
          description: Tax associated with shipping
    NotFoundExceptionResponse:
      type: object
      properties:
        message:
          type: string
          readOnly: true
          example: Not Found
        error:
          type: string
          readOnly: true
          example: Not Found
        statusCode:
          type: number
          readOnly: true
          example: 404
      required:
        - message
        - error
        - statusCode
    Fulfillment:
      type: object
      properties:
        sourceFulfillmentId:
          type: string
        fulfillmentStatus:
          type: object
        trackingCompany:
          type: string
        trackingNumber:
          type: array
          items:
            type: string
        trackingUrl:
          type: array
          items:
            type: string
        sourceOrderId:
          type: string
        createdAt:
          format: date-time
          type: string
        updatedAt:
          format: date-time
          type: string
      required:
        - sourceFulfillmentId
        - fulfillmentStatus
        - trackingCompany
        - trackingNumber
        - trackingUrl
        - sourceOrderId
        - createdAt
        - updatedAt
    FulfillmentOrderItem:
      type: object
      properties:
        id:
          type: string
        productName:
          type: string
          example: Product Name
        price:
          type: number
          example: 1.24
        productImage:
          type: string
          example: https://example.com/image.jpg
        sourceItemId:
          type: string
          example: '1234'
        sku:
          type: string
          example: SKU1234
        sourceProductId:
          type: string
          example: sourceProductId123
        sourceVariantId:
          type: string
          example: '12345'
        quantity:
          type: number
          example: 1
      required:
        - id
        - productName
        - price
        - productImage
        - sourceItemId
        - sku
        - sourceProductId
        - sourceVariantId
        - quantity
    FulfillmentItem:
      type: object
      properties:
        id:
          type: string
        quantity:
          type: number
          example: 1
        item:
          $ref: '#/components/schemas/FulfillmentOrderItem'
      required:
        - id
        - quantity
        - item
    SourceItemIdDto:
      type: object
      properties: {}
    CreateFulfillmentInput:
      type: object
      properties:
        sourceItemIds:
          example:
            - sourceItemId: '1478'
              quantity: 1
            - sourceItemId: '1479'
              quantity: 2
          description: Array of order items objects with the sourceItemId and quantity
          type: array
          items:
            $ref: '#/components/schemas/SourceItemIdDto'
        fulfillmentStatus:
          type: string
          example: Fulfilled
          enum:
            - DELIVERED
            - FULFILLED
            - UNFULFILLED
            - PARTIALLY_FULFILLED
            - AWAITING_SHIPMENT
            - SCHEDULED
            - ON_HOLD
            - ATTEMPTED_DELIVERY
            - CARRIER_PICKED_UP
            - CONFIRMED
            - DELAYED
            - FAILURE
            - NOT_DELIVERED
            - IN_TRANSIT
            - LABEL_PRINTED
            - LABEL_PURCHASED
            - OUT_FOR_DELIVERY
            - PICKED_UP
            - READY_FOR_PICKUP
            - SHIPPED
          description: Fulfillment Status
        trackingCompany:
          type: string
          example: FedEx
          description: Tracking Company
        trackingNumber:
          example:
            - AB0303456
          description: Tracking Number
          type: array
          items:
            type: string
        trackingUrl:
          example:
            - https://example-follow-shipment.com/AB0303456
          description: Tracking URL
          type: array
          items:
            type: string
        sourceFulfillmentId:
          type: string
          example: fulfillment-123
          description: >-
            Source Fulfillment ID. This will allow you to update your
            fulfillment using your internal fulfillment ID
      required:
        - sourceItemIds
        - fulfillmentStatus
        - sourceFulfillmentId
    UpdateFulfillmentStatusInput:
      type: object
      properties:
        status:
          type: string
          description: >-
            Fulfillment Status, update the fulfillment status to let us know if
            the fulfillment is in progress, fulfilled, or canceled
          example: fulfilled
          enum:
            - DELIVERED
            - FULFILLED
            - UNFULFILLED
            - PARTIALLY_FULFILLED
            - AWAITING_SHIPMENT
            - SCHEDULED
            - ON_HOLD
            - ATTEMPTED_DELIVERY
            - CARRIER_PICKED_UP
            - CONFIRMED
            - DELAYED
            - FAILURE
            - NOT_DELIVERED
            - IN_TRANSIT
            - LABEL_PRINTED
            - LABEL_PURCHASED
            - OUT_FOR_DELIVERY
            - PICKED_UP
            - READY_FOR_PICKUP
            - SHIPPED
        trackingCompany:
          type: string
          example: FedEx
          description: Tracking Company
        trackingNumber:
          example:
            - AB0303456
          description: Tracking Number
          type: array
          items:
            type: string
        trackingUrl:
          example:
            - https://example-follow-shipment.com/AB0303456
          description: Tracking URL
          type: array
          items:
            type: string
      required:
        - status
    DeepLinkDto:
      type: object
      properties: {}
    UpsertReturnDto:
      type: object
      properties: {}
    UpdateReturnSettingDto:
      type: object
      properties: {}
    ProductEntity:
      type: object
      properties:
        productId:
          type: string
          readOnly: true
        name:
          type: string
          readOnly: true
        description:
          type: string
          readOnly: true
        sku:
          type: string
          readOnly: true
        price:
          type: number
          readOnly: true
        tax:
          type: number
          readOnly: true
        productImage:
          type: string
          readOnly: true
      required:
        - productId
        - name
        - description
        - sku
        - price
        - tax
        - productImage
    ProductOptionValueDto:
      type: object
      properties:
        name:
          type: string
          example: Matte
        price:
          type: number
          example: 5
        priceType:
          type: string
          enum:
            - FIXED
            - PERCENTAGE
          default: FIXED
        sku:
          type: string
          example: SKU-MATTE
        optionValueId:
          type: string
          example: value-001
      required:
        - name
        - price
        - priceType
    ProductOptionDto:
      type: object
      properties:
        name:
          type: string
          example: Finish
        optionId:
          type: string
          example: finish-001
        required:
          type: boolean
          default: false
        type:
          type: string
          enum:
            - DROPDOWN
            - INPUT
            - RADIO_BUTTON
          default: DROPDOWN
        productOptionValue:
          type: array
          items:
            $ref: '#/components/schemas/ProductOptionValueDto'
      required:
        - name
        - optionId
        - type
    CreateProductDto:
      type: object
      properties:
        productId:
          type: string
          example: '123456'
          description: Unique ID for the product
        status:
          type: string
          example: ACTIVE
          description: Status of the variant
          enum:
            - ACTIVE
            - DRAFT
            - ARCHIVED
            - DELETED
        variantId:
          type: string
          example: '123456'
          description: >-
            If your platform supports variant ids, you can use this field here.
            Otherwise use the productId field and leave this blank
        name:
          type: string
          example: '123456'
          description: This is the name of the product.
        description:
          type: string
          example: This product is super awesome and will solve all of your problems
          description: >-
            This is the description of the product. This will help with making
            sure the correct product is chosen
        sku:
          type: string
          example: '123456'
          description: SKU of the product
        price:
          type: number
          example: 22.22
          description: Price of the product
        tax:
          type: number
          example: '123456'
          description: Unique ID for the product
        inventoryType:
          type: string
          example: FULL
          description: What kind of inventory tracking we will do
        inventoryQuantity:
          type: number
          example: '123456'
          description: >-
            This is the amount remaining in stock. This is used if you are using
            the FULL inventory type
        productImage:
          type: string
          example: https://somedomain.com/image.png
          description: This is the url to show a product image.
        productType:
          type: string
          example: This is the type of product. Can be SIMPLE or GROUPED
          description: >-
            This tells us if this product is a bundle or a simple product with
            variants
        inStock:
          type: boolean
          example: true
          description: >-
            If using the SIMPLE mode you just simply tell us if the product is
            in stock or not
        bundleProductIds:
          example:
            - product-id-1
            - product-id-2
          description: >-
            If you are creating a bundled product and have already created the
            child products you can include
                their ids here
          type: array
          items:
            type: string
        productOptions:
          description: Optional list of product options (e.g. finish, color, etc.)
          type: array
          items:
            $ref: '#/components/schemas/ProductOptionDto'
      required:
        - productId
        - status
        - name
        - price
        - inventoryQuantity
        - productType
    ProductVariantInputDto:
      type: object
      properties:
        variantId:
          type: string
          example: v-1
          description: Variant ID
        name:
          type: string
          example: Variant 1
          description: Variant name
        sku:
          type: string
          example: sku-1
          description: SKU for the variant
        price:
          type: number
          example: 100
          description: Price of the variant
        tax:
          type: number
          example: 5
          description: Tax amount for the variant
        inventoryQuantity:
          type: number
          example: 10
          description: Inventory quantity of the variant
        inventoryTracked:
          type: boolean
          example: true
          description: Whether inventory is tracked for the variant
        productImage:
          type: string
          example: variant1_image.jpg
          description: Image URL for the variant
        status:
          type: string
          example: ACTIVE
          description: Status of the variant
      required:
        - variantId
        - name
        - sku
        - price
        - tax
        - inventoryQuantity
        - inventoryTracked
        - status
    ProductCreateDto:
      type: object
      properties:
        productId:
          type: string
          example: '123456'
          description: Unique ID for the product
        variants:
          example:
            - variantId: v-1
              name: Variant 1
              sku: sku-1
              price: 100
              tax: 5
              inventoryQuantity: 10
              inventoryTracked: true
              productImage: variant1_image.jpg
            - variantId: v-2
              name: Variant 2
              sku: sku-2
              price: 150
              tax: 7
              inventoryQuantity: 5
              inventoryTracked: true
              productImage: variant2_image.jpg
          description: List of variants for the product
          type: array
          items:
            $ref: '#/components/schemas/ProductVariantInputDto'
      required:
        - productId
        - variants
    UpdateProductDto:
      type: object
      properties:
        name:
          type: string
          example: '123456'
          description: This is the name of the product.
        status:
          type: string
          example: ACTIVE
          description: Status of the variant
        description:
          type: string
          example: This product is super awesome and will solve all of your problems
          description: >-
            This is the description of the product. This will help with making
            sure the correct product is chosen
        sku:
          type: string
          example: '123456'
          description: SKU of the product
        price:
          type: number
          example: 22.22
          description: Price of the product
        tax:
          type: number
          example: '123456'
          description: Unique ID for the product
        inventoryType:
          type: string
          example: FULL
          description: What kind of inventory tracking we will do
        inventoryQuantity:
          type: number
          example: '123456'
          description: >-
            This is the amount remaining in stock. This is used if you are using
            the FULL inventory type
        productImage:
          type: string
          example: https://somedomain.com/image.png
          description: This is the url to show a product image.
        productType:
          type: string
          example: SIMPLE
          description: >-
            This tells us if this product is a bundle or a simple product with
            variants
        inStock:
          type: boolean
          example: true
          description: >-
            If using the SIMPLE mode you just simply tell us if the product is
            in stock or not
        productOption:
          description: Options for the product, like size, color, etc.
          type: array
          items:
            $ref: '#/components/schemas/ProductOptionDto'
    AddProductsToBundleDto:
      type: object
      properties:
        productIds:
          description: >-
            Your internal product ids that you would like to add to this bundle,
            they must be created in OrderProtection first
          example:
            - product-1
            - product-2
            - product-2
          default: []
          type: array
          items:
            type: string
      required:
        - productIds
