openapi: 3.0.3
info:
  title: Keeta Order Management API
  version: v.1.0.0
  contact:
    name: Keeta Developer Website
    email: https://developers.mykeeta.com/
  description: >
    This API provides comprehensive order management capabilities for Keeta
    platform integration, including order operations, refund management, and
    real-time notifications.
servers:
  - url: https://open.mykeeta.com/api/open
paths:
  /order/get:
    post:
      operationId: getOrderDetails
      tags:
        - Endpoints
      summary: Query on Order Details
      description: >-
        This endpoint allows the third party system to retrieve comprehensive
        details about a specific order from Keeta platform.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - orderViewId
                - shopId
              properties:
                orderViewId:
                  type: integer
                  format: int64
                  example: 756823555555859
                  description: Unique identifier for orders on Keeta platform
                shopId:
                  type: integer
                  format: int64
                  example: 466663
                  description: Unique identifier of the Keeta store
      responses:
        '200':
          description: Successful returns order details.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/CommonResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/FindMerchantOrderByViewIdResp'
  /order/confirm:
    post:
      operationId: confirmOrder
      tags:
        - Endpoints
      summary: Order Confirmation
      description: >
        This endpoint allows the third party to inform the Keeta ordering
        application that an order has been accepted and food preparation will
        begin shortly.


        **Notes:**

        1. **Timing Requirements** 
         - Developers must call this endpoint immediately upon receiving new order notifications from Keeta. 
         - The Keeta platform will automatically cancel any order that remains unconfirmed after 5 minutes.
        2. **State Management**
         - The endpoint rejects requests under these conditions:
         - The order was already accepted through a Keeta POS terminal - The order status has already progressed beyond the initial state
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - orderViewId
                - shopId
              properties:
                orderViewId:
                  type: integer
                  format: int64
                  example: 756823555555859
                  description: Unique identifier for orders on Keeta platform
                shopId:
                  type: integer
                  format: int64
                  example: 466663
                  description: Unique identifier of the Keeta store
      responses:
        '200':
          $ref: '#/components/responses/Success'
  /order/cancel:
    post:
      operationId: cancelOrder
      tags:
        - Endpoints
      summary: Order Cancellation
      description: >
        This endpoint allows merchants to request order cancellation through the
        Keeta platform when they are unable to fulfill a customer's order.


        **Notes:**

        1. The developers should only invoke this API when the merchant is
        **unable to fulfill the order.**

        2. Upon successful cancellation, the order status will be updated to
        **"CANCELLED"** in Keeta's system and Keeta will **automatically
        initiate a full refund** to the customer.

        3. This API **does not support duplicate calls**. If the order is
        already in a **"CANCELLED"** state, the system will return an error
        response.

        4. Merchants should **confirm the necessity of cancellation** before
        proceeding to avoid unnecessary losses.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - orderViewId
                - shopId
                - cancelCode
              properties:
                orderViewId:
                  type: integer
                  format: int64
                  example: 756823555555859
                  description: Unique identifier for orders on Keeta platform
                shopId:
                  type: integer
                  format: int64
                  example: 466663
                  description: Unique identifier of the Keeta store
                cancelCode:
                  type: integer
                  example: 500000
                  description: >
                    This field represents the code value for the reason an order
                    was canceled. Please send the corresponding cancellation
                    reason code for the merchant's order cancellation in this
                    field.
                  x-enumDescriptions:
                    '500000': >-
                      indicates other unspecified reasons (requires
                      cancelReason)
                    '500001': indicates insufficient ingredients
                    '500002': indicates store temporary closure
                    '500003': indicates staff shortage
                  enum:
                    - 500000
                    - 500001
                    - 500002
                    - 500003
                cancelReason:
                  type: string
                  example: too expensive
                  description: >-
                    This text field provides a detailed explanation for the
                    cancellation when using the generic reason code (500000).
      responses:
        '200':
          $ref: '#/components/responses/Success'
  /order/agree:
    post:
      operationId: agreeRefund
      tags:
        - Endpoints
      summary: Refund Confirmation
      description: >
        This endpoint allows merchants to programmatically approve customer
        refund requests that were initiated through the Keeta platform.


        **Notes:**

        1. When a customer submits a refund request on the Keeta platform, the
        system will send a webhook notification to the third-party system.

        2. If the third-party system supports refund management, merchants can
        review and approve refund requests directly within their system.

        3. Once approved, the third-party system **must call this API** to
        confirm the refund with Keeta.

        4. This API **does not support duplicate calls**. If the refund has
        already been approved or rejected (e.g., via Keeta POS), subsequent
        calls will return an error.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - orderViewId
                - shopId
              properties:
                orderViewId:
                  type: integer
                  format: int64
                  example: 756823555555859
                  description: Unique identifier for orders on Keeta platform
                shopId:
                  type: integer
                  format: int64
                  example: 466663
                  description: Unique identifier of the Keeta store
      responses:
        '200':
          $ref: '#/components/responses/Success'
  /order/reject:
    post:
      operationId: rejectRefund
      tags:
        - Endpoints
      summary: Refund Rejection
      description: >
        This endpoint enables merchant to formally reject customer refund
        requests initiated through the Keeta platform.


        **Notes:**

        1. When a customer submits a refund request on the Keeta platform, the
        system will send a **webhook notification** to the third-party system.

        2. If the third-party system has implemented refund processing
        capabilities, merchants can review and evaluate customer refund requests
        directly within their own system endpoint.

        3. When merchants decide to reject a refund request after careful
        consideration, the third-party system must explicitly call this
        rejection API endpoint to formally communicate the decision to Keeta's
        platform.

        4. This API **does not support duplicate calls**. If the refund has
        already been approved or rejected (e.g., via Keeta POS), subsequent
        calls will return an error.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - orderViewId
                - shopId
                - rejectCode
              properties:
                orderViewId:
                  type: integer
                  format: int64
                  description: Unique identifier for orders on Keeta platform
                  example: 756823555555859
                shopId:
                  type: integer
                  format: int64
                  example: 466663
                  description: Unique identifier of the Keeta store
                rejectCode:
                  type: integer
                  description: |
                    Reason code for refund rejection:

                    100000: indicates other unspecified reasons

                    100001: indicates meal preparation already completed

                    100002: indicates delivery process already initiated
                  enum:
                    - 100000
                    - 100001
                    - 100002
                rejectReason:
                  type: string
                  example: Your Reason
                  description: >
                    The rejectReason field contains the merchant's textual
                    explanation for refusing a refund request. This provides
                    transparency to customers about the rejection decision.


                    When Using Custom Rejection Code (100000), The rejectReason
                    field becomes mandatory.


                    For rejectCode = 100001 (meal already prepared) or 100002
                    (delivery already started), The rejectReason field is
                    optional.
      responses:
        '200':
          $ref: '#/components/responses/Success'
  /order/prepare:
    post:
      operationId: orderReady
      tags:
        - Endpoints
      summary: Order Ready
      description: >
        This endpoint allows merchant to notify the Keeta platform that an order
        has been fully prepared and is ready for rider pickup.


        **Notes:**

        1. Keeta strongly recommends that developers integrate this API to
        significantly enhance delivery efficiency.

        2. Calling this endpoint automatically updates the order status to
        '**Order Ready**' in Keeta's system.

        3. This API **does not support duplicate calls**.

        4. It is crucial to call this API only after meal preparation is fully
        completed to avoid disrupting the delivery workflow. Premature or
        mistaken invocations could lead to delivery inefficiencies and
        negatively affect the overall customer experience.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - orderViewId
                - shopId
              properties:
                orderViewId:
                  type: integer
                  format: int64
                  example: 756823555555859
                  description: Unique identifier for orders on Keeta platform
                shopId:
                  type: integer
                  format: int64
                  example: 466663
                  description: Unique identifier of the Keeta store
      responses:
        '200':
          $ref: '#/components/responses/Success'
  /order/refund/part/products/preview:
    post:
      operationId: queryPartialRefundableItems
      tags:
        - Endpoints
      summary: Partial Refundable Item Query
      description: >-
        This API is designed to retrieve detailed information about items that
        are eligible for partial refunds. It allows developers to access and
        display specific product details related to refund eligibility.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - orderViewId
                - shopId
              properties:
                orderViewId:
                  type: integer
                  format: int64
                  example: 756823555555859
                  description: Unique identifier for orders on Keeta platform
                shopId:
                  type: integer
                  format: int64
                  example: 466663
                  description: Unique identifier of the Keeta store
                products:
                  type: array
                  description: >-
                    A List of products designated for refund: This field should
                    be populated with specific product information for partial
                    refunds. If left empty, the API will return all products
                    eligible for refund, with the refund amount set to zero.
                  items:
                    $ref: '#/components/schemas/AfterSaleProductDTO'
      responses:
        '200':
          description: Successful returns partial refundable item details.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/CommonResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/PartRefundPreviewResp'
  /order/refund/part/apply:
    post:
      operationId: initiatePartialRefund
      tags:
        - Endpoints
      summary: Initiate a Partial Refund
      description: >-
        This API allows merchants to submit requests for partial refunds on
        specific products within an order. It is designed to adjust billing and
        chargeback processes when certain items in an order will not incur costs
        due to various reasons, such as promotions, errors, or customer
        satisfaction measures.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - orderViewId
                - shopId
                - products
                - partRefundType
              properties:
                orderViewId:
                  type: integer
                  format: int64
                  example: 756823555555859
                  description: Unique identifier for orders on Keeta platform
                shopId:
                  type: integer
                  format: int64
                  example: 466663
                  description: Unique identifier of the Keeta store
                products:
                  type: array
                  description: A List of products designated for refund
                  items:
                    $ref: '#/components/schemas/AfterSaleProductDTO'
                partRefundType:
                  type: integer
                  description: >
                    This field represents the code value for the reason for
                    initiating a "partial product refund" request within an
                    order.

                    Please send the appropriate code value that corresponds to
                    the reason for initiating the "partial product refund"
                    request in this field. The specific meanings of the codes
                    are as follows:
                  x-enumDescriptions:
                    '200000': >-
                      indicates other unspecified reasons (requires
                      partRefundReason)
                    '200001': indicates slow meal preparation
                    '200002': indicates insufficient ingredients
                    '200003': indicates missing or incomplete delivery
                    '200004': indicates wrong item prepared
                  enum:
                    - 200000
                    - 200001
                    - 200002
                    - 200003
                    - 200004
                partRefundReason:
                  type: string
                  example: Do not like
                  description: >
                    This field is intended to provide a detailed textual
                    explanation for initiating a partial refund request on
                    specific items within an order.


                    For partRefundType = 200000 (Other Reasons), the
                    partRefundReason field is mandatory and must be filled in.


                    For partRefundType = 200001, 200002, 200003, or 200004
                    (Standard Reasons), the partRefundReason field is optional
                    and may be omitted or left empty.
      responses:
        '200':
          $ref: '#/components/responses/Success'
  /order/collect:
    post:
      operationId: confirmOrderPickup
      tags:
        - Endpoints
      summary: Order Picked-up Confirmation
      description: >
        This API is designed to notify the Keeta platform that a customer has
        personally collected their order. It ensures that the system accurately
        reflects the order's completion through customer self-pickup.


        **Notes:**

        This API should be invoked in situations where the customer opts for
        self-service pickup, collecting their order directly from the merchant
        premises. It updates Keeta's system with the order's completed status.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - orderViewId
                - shopId
              properties:
                orderViewId:
                  type: integer
                  format: int64
                  example: 756823555555859
                  description: Unique identifier for orders on Keeta platform
                shopId:
                  type: integer
                  format: int64
                  example: 466663
                  description: Unique identifier of the Keeta store
      responses:
        '200':
          $ref: '#/components/responses/Success'
  /order/dispatched:
    post:
      operationId: orderDispatched
      tags:
        - MerchanSelfDelivery
      summary: Order Dispatched
      description: >
        This endpoint allows merchants to notify the Keeta platform that a
        courier has picked up the order and the delivery is in progress for
        merchant self-delivery orders.


        **Notes:**

        1. This API is exclusively for **merchant self-delivery orders** where
        the merchant manages their own delivery service.

        2. Calling this endpoint updates the order status to indicate that the
        courier has collected the order and delivery is underway.

        3. The courier information provided helps customers track their delivery
        and contact the delivery person if needed.

        4. This API can only be called after the order has been accepted by the
        merchant. It cannot be used to update orders that have been
        **completed** or **cancelled**.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - orderViewId
                - shopId
              properties:
                orderViewId:
                  type: integer
                  format: int64
                  example: 123456789
                  description: Unique identifier for orders on Keeta platform
                shopId:
                  type: integer
                  format: int64
                  example: 987654321
                  description: Unique identifier of the Keeta store
                courierInfo:
                  $ref: '#/components/schemas/CourierInfo'
      responses:
        '200':
          description: Courier pickup notification successful
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/CommonResponse'
                  - type: object
                    properties:
                      code:
                        type: integer
                        description: >
                          **Response Codes for Order Dispatched:**

                          - **0**: Success - Courier diapatched notification
                          successful

                          - **109000000**: Request parameter error (specific
                          details in message field)
                            - "merchantOrderViewId is null"
                            - "shopId is null"
                          - **209000101**: Order does not exist

                          - **2090006003**: This order is not a merchant
                          self-delivery order

                          - **309000000**: System error
                        example: 0
  /order/delivered:
    post:
      operationId: orderDelivered
      tags:
        - MerchanSelfDelivery
      summary: Order Delivered
      description: >
        This endpoint allows merchants to notify the Keeta platform that an
        order has been successfully delivered to the customer for merchant
        self-delivery orders.


        **Notes:**

        1. This API is exclusively for **merchant self-delivery orders** where
        the merchant manages their own delivery service.

        2. Calling this endpoint marks the order as completed.

        3. Courier information can be updated if needed.

        4. This API does not support duplicate calls for the same order.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - orderViewId
                - shopId
              properties:
                orderViewId:
                  type: integer
                  format: int64
                  example: 123456789
                  description: Unique identifier for orders on Keeta platform
                shopId:
                  type: integer
                  format: int64
                  example: 987654321
                  description: Unique identifier of the Keeta store
                courierInfo:
                  $ref: '#/components/schemas/CourierInfo'
      responses:
        '200':
          description: Order delivery confirmation successful
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/CommonResponse'
                  - type: object
                    properties:
                      code:
                        type: integer
                        description: >
                          **Response Codes for Order Delivered:**

                          - **0**: Success - Order delivery delivered successful

                          - **109000000**: Request parameter error (specific
                          details in message field)
                            - "orderViewId is null"
                            - "shopId is null"
                          - **209000101**: Order does not exist

                          - **2090006003**: This order is not a merchant
                          self-delivery order

                          - **309000000**: System error
                        example: 0
  /order/updateCourierInfo:
    post:
      operationId: updateCourierInfo
      tags:
        - MerchanSelfDelivery
      summary: Update Courier Information
      description: >
        This endpoint allows merchants to update courier information for
        merchant self-delivery orders, including courier name, phone number,
        vehicle information, and other delivery-related details.


        **Notes:**

        1. This API is exclusively for **merchant self-delivery orders** where
        the merchant manages their own delivery service.

        2. Updated courier information helps customers track their delivery and
        contact the delivery person.

        3. This API can be called multiple times to update different courier
        details as needed.

        4. At least one courier information field must be provided in the
        request.

        5. This API can only be called after the order has been accepted by the
        merchant. It cannot be used to update orders that have been
        **completed** or **cancelled**,
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - orderViewId
                - shopId
                - courierInfo
              properties:
                orderViewId:
                  type: integer
                  format: int64
                  example: 123456789
                  description: Unique identifier for orders on Keeta platform
                shopId:
                  type: integer
                  format: int64
                  example: 987654321
                  description: Unique identifier of the Keeta store
                courierInfo:
                  $ref: '#/components/schemas/CourierInfo'
      responses:
        '200':
          description: Courier information update successful
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/CommonResponse'
                  - type: object
                    properties:
                      code:
                        type: integer
                        description: >
                          **Response Codes for Update Courier Info:**

                          - **0**: Success - Courier information update
                          successful

                          - **109000000**: Request parameter error (specific
                          details in message field)
                            - "orderVieId is null"
                            - "shopId is null"
                          - **209000101**: Order does not exist

                          - **2090006003**: This order is not a self-delivery
                          order

                          - **2090006004**: Order status does not support
                          synchronizing delivery information

                          - **309000000**: System error
                        example: 0
  /delivery/merchant/self/delivery/callback:
    post:
      operationId: updateDeliveryTracking
      tags:
        - MerchanSelfDelivery
      summary: Update Delivery Tracking Information
      description: >
        This endpoint allows merchants to provide real-time delivery tracking
        updates for merchant self-delivery orders, including **ETA**(estimated
        time of arrival) and **courier location coordinates**.


        **Notes:**

        1. This API is exclusively for **merchant self-delivery orders** where
        the merchant manages their own delivery service.

        2. Regular updates help improve customer experience by providing
        accurate delivery estimates and tracking.

        3. Coordinate information should use GPS coordinates with precision of 6
        decimal places for accuracy.

        4. At least one tracking parameter (besides orderViewId) must be
        provided in each request.

        5. **Time Range Requirements**: `estimatedTimeStampLeft` and
        `estimatedTimeStampRight` must **both have values or both be omitted**.
        You cannot provide only one of these fields.

        6. **Coordinate Requirements**: `courierCoordinateLng` and
        `courierCoordinateLat` must **both have values or both be omitted**. You
        cannot provide only one coordinate.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - orderViewId
              properties:
                orderViewId:
                  type: integer
                  format: int64
                  example: 1186341416633223
                  description: Unique identifier for orders on Keeta platform
                estimatedTimeStampLeft:
                  type: integer
                  format: int64
                  example: 1754432190391
                  description: >-
                    Left boundary of estimated delivery time range in Unix
                    timestamp milliseconds. **Must be provided together with
                    estimatedTimeStampRight or both omitted.**
                estimatedTimeStampRight:
                  type: integer
                  format: int64
                  example: 1754432190391
                  description: >-
                    Right boundary of estimated delivery time range in Unix
                    timestamp milliseconds. **Must be provided together with
                    estimatedTimeStampLeft or both omitted.**
                estimatedTimeStamp:
                  type: integer
                  format: int64
                  example: 1754432190391
                  description: Estimated delivery time in Unix timestamp milliseconds
                courierCoordinateLng:
                  type: number
                  format: double
                  example: 103.819998
                  description: >-
                    Courier longitude coordinate (GPS), precision recommended to
                    6 decimal places. **Must be provided together with
                    courierCoordinateLat or both omitted.**
                courierCoordinateLat:
                  type: number
                  format: double
                  example: 51.296999
                  description: >-
                    Courier latitude coordinate (GPS), precision recommended to
                    6 decimal places. **Must be provided together with
                    courierCoordinateLat or both omitted.**
      responses:
        '200':
          description: Delivery tracking information update successful
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/CommonResponse'
                  - type: object
                    properties:
                      code:
                        type: integer
                        description: >
                          **Response Codes for Update Delivery Tracking:**

                          - **0**: Success - Delivery tracking information
                          update successful

                          - **111120000**: Internal error, please try again
                          later

                          - **111120001**: Order ID cannot be empty / Order ID
                          must be numeric

                          - **111120001**: At least one valid field must be
                          provided besides order ID and region

                          - **111120001**: Estimated delivery time boundaries
                          must both exist or both be absent

                          - **111120001**: Left boundary of estimated delivery
                          time cannot be greater than right boundary

                          - **111120001**: Longitude and latitude coordinates
                          must both exist or both be absent

                          - **111120001**: Invalid longitude or latitude
                          coordinates

                          - **111120001**: Order does not exist

                          - **111120001**: Order status cannot be updated with
                          delivery information / Order is not merchant self
                          delivery
                        example: 0
x-webhooks:
  orderPlacedNotification:
    post:
      operationId: orderPlacedNotification
      tags:
        - Webhooks
      summary: Order Placed Notification
      description: >
        This webhook is sent by Keeta to notify the developer's system that a
        new order has been placed.


        **Event ID:** 1001


        **Notes:**

        In the event that Keeta's platform sends a new order notification but
        does not receive an acknowledgment from the developer's system, Keeta
        will attempt to resend the notification up to a maximum of three
        additional times.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FindMerchantOrderByViewIdResp'
      responses:
        '200':
          $ref: '#/components/responses/Success'
  orderAcceptanceNotification:
    post:
      operationId: orderAcceptanceNotification
      tags:
        - Webhooks
      summary: Order Acceptance Notification
      description: >
        This webhook serves to notify the developer's system when an order's
        status changes to 'Order Confirmed' on the Keeta platform.


        **Event ID:** 1002
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                orderViewId:
                  type: integer
                  format: int64
                  example: 756823555555859
                  description: Unique identifier for orders on Keeta platform
                shopId:
                  type: integer
                  format: int64
                  example: 466663
                  description: Unique identifier of the Keeta store
                status:
                  type: integer
                  description: Order status code, always 30 for this event
                  example: 30
                opTime:
                  type: integer
                  format: int64
                  example: 1751448108144
                  description: >-
                    Time when the event occurred, specified as milliseconds
                    since Jan 1, 1970 (Unix epoch)
      responses:
        '200':
          $ref: '#/components/responses/Success'
  orderCompletionNotification:
    post:
      operationId: orderCompletionNotification
      tags:
        - Webhooks
      summary: Order Completion Notification
      description: >
        This webhook serves to notify the developer's system when an order's
        status changes to 'Delivered' on the Keeta platform.


        **Event ID:** 1003
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                orderViewId:
                  type: integer
                  format: int64
                  example: 756823555555859
                  description: Unique identifier for orders on Keeta platform
                shopId:
                  type: integer
                  format: int64
                  example: 466663
                  description: Unique identifier of the Keeta store
                status:
                  type: integer
                  description: Order status code, always 40 for this event
                  example: 40
                opTime:
                  type: integer
                  format: int64
                  example: 1751448108144
                  description: >-
                    Time when the event occurred, specified as milliseconds
                    since Jan 1, 1970 (Unix epoch)
      responses:
        '200':
          $ref: '#/components/responses/Success'
  orderCancellationNotification:
    post:
      operationId: orderCancellationNotification
      tags:
        - Webhooks
      summary: Order Cancellation Notification
      description: >
        This webhook serves to notify the developer's system when an order's
        status changes to 'Cancelled' on the Keeta platform.


        **Event ID:** 1004
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                orderViewId:
                  type: integer
                  format: int64
                  example: 756823555555859
                  description: Unique identifier for orders on Keeta platform
                shopId:
                  type: integer
                  format: int64
                  example: 466663
                  description: Unique identifier of the Keeta store
                status:
                  type: integer
                  description: Order status code, always 50 for this event
                  example: 50
                opTime:
                  type: integer
                  format: int64
                  example: 1751448108144
                  description: >-
                    Time when the event occurred, specified as milliseconds
                    since Jan 1, 1970 (Unix epoch)
                cancelReason:
                  type: string
                  example: Customer cancel the order
                  description: Text description of cancellation reason
                opType:
                  type: integer
                  example: 10
                  description: |
                    Code representing who initiated the cancellation:
                  x-enumDescriptions:
                    '0': System-automated cancellation
                    '10': Customer-initiated cancellation
                    '20': Merchant-initiated cancellation
                    '30': Customer service-initiated cancellation
                  enum:
                    - 0
                    - 10
                    - 20
                    - 30
      responses:
        '200':
          $ref: '#/components/responses/Success'
  orderRefundStatusChangeNotification:
    post:
      operationId: orderRefundStatusChangeNotification
      tags:
        - Webhooks
      summary: Order Refund Status Change Notification
      description: >
        This webhook is designed to inform the developer's system whenever there
        is a change in the status of an order's refund application on the Keeta
        platform.


        **Event ID:** 1005
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                orderViewId:
                  type: integer
                  format: int64
                  example: 756823555555859
                  description: Unique identifier for orders on Keeta platform
                shopId:
                  type: integer
                  format: int64
                  example: 466663
                  description: Unique identifier of the Keeta store
                status:
                  type: integer
                  example: 2001
                  description: Refund status code
                afterSaleOrderId:
                  type: integer
                  format: int64
                  example: 833443425408767
                  description: Unique identifier for the after-sales application
                isAppeal:
                  type: integer
                  example: 0
                  description: |
                    Indicates if this is an appealed refund request
                  x-enumDescriptions:
                    '0': indicates a standard refund request
                    '1': >-
                      indicates a customer appeal case (requires platform
                      intervention)
                pictures:
                  type: string
                  example: >-
                    https://img-ap-hongkong.mykeeta.net/sailorproduct/9c760595674b395e330cf94b0e5068b0111111.jpg
                  description: >-
                    The pictures field contains a JSON-formatted array string
                    that stores URLs of images uploaded by customers as evidence
                    for their refund requests. This field supports a maximum of
                    9 image URLs, with each URL separated by commas and properly
                    escaped within the JSON array structure.
                money:
                  type: integer
                  format: int64
                  example: 2800
                  description: Refund amount
                currency:
                  type: string
                  example: HKD
                  description: Currency code for the refund amount
                applyOpType:
                  type: integer
                  example: 10
                  description: |
                    Code representing who initiated the refund request:
                  x-enumDescriptions:
                    '0': System-automated refund
                    '10': Customer-initiated refund
                    '20': Merchant-initiated refund
                    '30': Customer service-initiated refund
                applyReason:
                  type: string
                  example: xxx
                  description: Original reason for refund request
                handleOpType:
                  type: integer
                  example: 20
                  description: >
                    This field represents the code value corresponding to the
                    type of personnel handling this after-sales application:
                  x-enumDescriptions:
                    '0': indicates system-automated processing
                    '10': indicates customer-initiated refund
                    '20': indicates merchant-initiated refund
                    '30': >-
                      indicates Keeta customer service representative
                      intervention
                handleReason:
                  type: string
                  example: Merchant agree refund
                  description: >-
                    This field indicates the reason why the after-sales
                    application has been changed to its current status.
                opTime:
                  type: integer
                  format: int64
                  example: 1751448108144
                  description: >-
                    Time when the event occurred, specified as milliseconds
                    since Jan 1, 1970 (Unix epoch)
      responses:
        '200':
          $ref: '#/components/responses/Success'
  deliveryStatusChangeNotification:
    post:
      operationId: deliveryStatusChangeNotification
      tags:
        - Webhooks
      summary: Delivery Status Change Notification
      description: >
        This webhook is designed to inform the developer's system whenever there
        is a change in the status of Keeta Couriers.


        **Event ID:** 1006
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                orderViewId:
                  type: integer
                  format: int64
                  example: 756823555555859
                  description: Unique identifier for orders on Keeta platform
                shopId:
                  type: integer
                  format: int64
                  example: 466663
                  description: Unique identifier of the Keeta store
                logisticsStatus:
                  type: integer
                  example: 10
                  description: >
                    The current operational state of the delivery order in the
                    fulfillment workflow, with the following possible values
                  x-enumDescriptions:
                    '0': >-
                      (Order Created) - The delivery request has been
                      successfully registered in Keeta's system but rider
                      assignment has not yet begun.
                    '10': >-
                      (Dispatching) - The system is actively searching for and
                      assigning an available rider to fulfill the order.
                    '20': >-
                      (Rider Assigned) - A rider has accepted the delivery task
                      and is preparing to travel to the merchant location.
                    '25': >-
                      (Rider Arrived at Store) - The assigned rider has reached
                      the merchant's physical location and is waiting to collect
                      the order.
                    '30': >-
                      (Order Collected) - The rider has physically received the
                      order package and begun the delivery journey to the
                      customer.
                    '50': >-
                      (Delivery Completed) - The order has been successfully
                      delivered to and acknowledged by the customer.
                    '99': (Order Cancelled) - The delivery process was terminated.
                opTime:
                  type: integer
                  format: int64
                  example: 1751448108144
                  description: >-
                    Time when the event occurred, specified as milliseconds
                    since Jan 1, 1970 (Unix epoch)
                courierName:
                  type: string
                  example: Pony Ma
                  description: Name of the courier responsible for delivery
                courierPhone:
                  type: string
                  example: '+96342425335'
                  description: Phone number of the courier responsible for delivery
                bigOrderTag:
                  type: boolean
                  example: false
                  description: >
                    Identifies large orders requiring split delivery:
                      
                    When bigOrderTag = True, the order is a "Large Order"


                    When bigOrderTag = False, the order is a standard
                    single-delivery order


                    **Large Order Definition**: Orders exceeding logistical
                    capacity thresholds, necessitating division into sub-orders.
                merchantSubOrderId:
                  type: integer
                  format: int64
                  description: Unique identifier for the suborder
      responses:
        '200':
          $ref: '#/components/responses/Success'
  partialProductRefundStatusChangeNotification:
    post:
      operationId: partialProductRefundStatusChangeNotification
      tags:
        - Webhooks
      summary: Partial Product Refund Request Status Change Notification
      description: >
        This webhook is designed to notify your system when the status of a
        partial product refund request within an order changes on the Keeta
        platform.


        **Event ID:** 1007
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                orderViewId:
                  type: integer
                  format: int64
                  example: 756823555555859
                  description: Unique identifier for orders on Keeta platform
                shopId:
                  type: integer
                  format: int64
                  example: 466663
                  description: Unique identifier of the Keeta store
                status:
                  type: integer
                  example: 5001
                  description: Refund status code
                afterSaleOrderId:
                  type: integer
                  format: int64
                  example: 833441825390895
                  description: Unique identifier for the after-sales application
                isAppeal:
                  type: integer
                  example: 0
                  description: |
                    Indicates if this is an appealed refund request
                  x-enumDescriptions:
                    '0': Not an appeal
                    '1': Customer appeal case
                pictures:
                  type: string
                  example: >-
                    https://img-ap-hongkong.mykeeta.net/sailorproduct/9c760595674b344560cf94b0e5068b19511.jpg
                  description: >-
                    JSON-formatted array string of image URLs uploaded by
                    customers
                money:
                  type: integer
                  format: int64
                  example: 3620
                  description: Refund amount
                currency:
                  type: string
                  example: HKD
                  description: Currency code for the refund amount
                applyOpType:
                  type: integer
                  example: 10
                  description: Code representing who initiated the refund request
                applyReason:
                  type: string
                  example: >-
                    The quantity of delivered goods has decreased; Additional
                    information: No egg tarts available
                  description: Original reason for refund request
                handleOpType:
                  type: integer
                  example: 20
                  description: Code representing who handled the refund request
                handleReason:
                  type: string
                  example: Merchant agree refund
                  description: Reason for status change
                opTime:
                  type: integer
                  format: int64
                  example: 1751448108144
                  description: >-
                    Time when the event occurred, specified as milliseconds
                    since Jan 1, 1970 (Unix epoch)
                refundProducts:
                  type: array
                  description: >-
                    This field contains detailed information about all the
                    products that are going to be refunded
                  items:
                    $ref: '#/components/schemas/ProductDTO'
      responses:
        '200':
          $ref: '#/components/responses/Success'
components:
  responses:
    Success:
      description: Request executed successfully
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CommonResponse'
  schemas:
    CommonResponse:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: integer
          description: >
            A numeric status identifier indicating the result of the interface
            call, used to determine whether the operation executed
            successfully. 
          x-enumDescriptions:
            '0': The request was executed successfully.
            Non-zero value: >-
              The request execution failed. Specific error details can be viewed
              in the message field.
          example: 0
        message:
          type: string
          description: >-
            Text description corresponding to the status code, explaining the
            operation result or error cause to users.
          example: Success
    FindMerchantOrderByViewIdResp:
      type: object
      properties:
        orderInfo:
          allOf:
            - description: >-
                This structure contains all the detailed information about the
                order (such as order delivery information, recipient
                information, cost information, etc.)
            - $ref: '#/components/schemas/OrderInfoDTO'
    OrderInfoDTO:
      type: object
      description: >-
        Contains foundational order details: customer requirements, estimated
        delivery time, and basic order metadata.
      properties:
        baseOrder:
          allOf:
            - description: >-
                Contains foundational order details: customer requirements
                (e.g., utensils needed), estimated delivery time, and basic
                order metadata.
            - $ref: '#/components/schemas/BaseOrderDTO'
        merchantOrder:
          allOf:
            - description: >-
                Order information acquired from order data model from merchant
                ends.
            - $ref: '#/components/schemas/MerchantOrderDTO'
        merchantOrderDeliveries:
          type: array
          description: >-
            Provides delivery personnel details, including rider name, contact
            number, etc.
          items:
            $ref: '#/components/schemas/MerchantOrderDeliveryDTO'
        deliveryInfos:
          type: array
          description: >-
            Tracks real-time logistics data including remaining delivery time,
            live location updates, and ETA adjustments.
          items:
            $ref: '#/components/schemas/DeliveryInfoDTO'
        orderPromotionDtlList:
          type: array
          description: >-
            Lists all applied promotions, including coupon details, discount
            breakdowns, etc.
          items:
            $ref: '#/components/schemas/OrderPromotionDtlDTO'
        refundInfos:
          type: array
          description: >-
            Documents refund history, including initiation reasons, approval
            statuses, etc.
          items:
            $ref: '#/components/schemas/RefundInfos'
        recipientInfo:
          allOf:
            - description: >-
                Encapsulates recipient details, including full name, phone
                number, and complete delivery address.
            - $ref: '#/components/schemas/RecipientInfo'
        feeDtl:
          allOf:
            - description: A breakdown of payment components. For details, please check FAQ
            - $ref: '#/components/schemas/FeeDtl'
        rebates:
          allOf:
            - description: >-
                Records partial refunds (item-level reimbursements). Null for
                full-order refunds.
            - $ref: '#/components/schemas/Rebates'
        rebatesTag:
          type: boolean
          description: >
            field explicitly identifies whether an order has undergone a
            **partial item refund**. This flag enables quick differentiation
            between fully refunded orders and those with selective item
            reimbursements.

            When the value of rebatesTag equals True, it indicates that a
            partial item refund has been processed for this order.

            When the value of rebatesTag equals False, it means that no partial
            refunds exist for this order.
        products:
          type: array
          description: >-
            Details all ordered items, including dish names, quantities,
            customization notes, and pricing.
          items:
            $ref: '#/components/schemas/ProductDTO'
        bigOrderTag:
          type: boolean
          description: >
            Identifies large orders requiring split delivery:

            When bigOrderTag = True, the order is a "Large Order"

            When bigOrderTag = False, the order is a standard single-delivery
            order

            **Large Order Definition**: Orders exceeding logistical capacity
            thresholds, necessitating division into sub-orders.
        subOrderInfoList:
          type: array
          description: >-
            This field contains an array of sub-order objects that collectively
            represent the disaggregated components of a **large parent order.**
          items:
            $ref: '#/components/schemas/SubOrderInfoDTO'
    BaseOrderDTO:
      type: object
      properties:
        orderViewId:
          type: integer
          format: int64
          description: The unique identifier for orders on Keeta platform.
          example: 756823555555859
        chooseTableware:
          type: integer
          description: |
            This field indicates whether utensils are requested for an order.
          x-enumDescriptions:
            '0': it explicitly means the customer does **not** require utensils.
            '1': it signifies the customer **does** need standard utensils.
          example: 1
        deliveryTime:
          type: integer
          format: int64
          example: 1751444617821
          description: >-
            This field represents Keeta calculated estimated time of arrival
            (ETA) for order delivery, expressed as milliseconds since Jan 1,
            1970 (Unix epoch)
        ctime:
          type: integer
          format: int64
          example: 1751442900803
          description: >-
            This immutable timestamp records the exact moment when the customer
            successfully placed the order on Keeta platform, using Unix epoch
            time (milliseconds since 01/01/1970).
        estimatedDiningReadyUrgeTime:
          type: integer
          format: int64
          example: 1751442900883
          description: >-
            For self-pickup orders, this field stores the expected
            ready-for-collection time as a Unix millisecond timestamp.
    MerchantOrderDTO:
      type: object
      properties:
        ctime:
          type: integer
          format: int64
          example: 1751442900855
          description: >-
            Records the exact timestamp (in Unix milliseconds since 01/01/1970)
            when the merchant first receives and creates the order in their
            system
        seqNoStr:
          type: string
          example: '29332222'
          description: >-
            A unique sequential identifier displayed to customers in the Keeta
            app as the official order reference number. This code will be
            displayed on order receipts.
        status:
          type: integer
          example: 40
          description: >
            This integer field represents the current state of a merchant's
            order in the fulfillment lifecycle. The system updates this value in
            real-time as the order progresses through different stages:
          x-enumDescriptions:
            '10': >-
              (Order Submitted) - The order has been successfully placed and
              paid for by the customer, but is still awaiting merchant
              confirmation.
            '20': >-
              (Merchant Accepted) - The restaurant has actively confirmed they
              will fulfill the order.
            '30': >-
              (Food Preparation) - The kitchen staff has begun cooking the
              order.
            '35': >-
              (Preparation Complete) - All items have been cooked and packaged,
              ready for courier pickup (for delivery orders) or customer
              collection (for self pickup orders)
            '40': >-
              (Order Fulfilled) - Successful completion of the entire order
              process
            '50': >-
              (Order Cancelled) - The order has been terminated. For specified
              cancel reasons please refer to cancelReason fields.
        pushOrderResult:
          type: integer
          example: 1
          description: >
            This field indicates whether the order has been successfully
            transmitted to the third party's system for processing.
          x-enumDescriptions:
            '0': >-
              (Push Failed) This status indicates the order information was not
              successfully delivered to the third party's system.
            '1': >-
              (Push Successful)This status confirms the order has been properly
              received by the merchant's system.
        orderViewId:
          type: integer
          format: int64
          example: 756823555555859
          description: The unique identifier for the order in Keeta platform.
        shopId:
          type: integer
          format: int64
          example: 611469
          description: Unique identifier of the Keeta store.
        shopName:
          type: string
          example: Adani Bar
          description: The official display name of the specific branch location.
        unconfirmedStatusTime:
          type: integer
          format: int64
          example: 1751442911840
          description: Timestamp when order entered "Pending Acceptance" state (Status=10)
        confirmedStatusTime:
          type: integer
          format: int64
          example: 1751442900883
          description: Timestamp when merchant accepted order (Status=20)
        readiedStatusTime:
          type: integer
          format: int64
          example: 1751442900883
          description: Timestamp when order was marked "Ready for Pickup" (Status=35)
        completedStatusTime:
          type: integer
          format: int64
          example: 1751442900883
          description: Timestamp when order reached final completion (Status=40)
        canceledStatusTime:
          type: integer
          format: int64
          description: Timestamp when order was cancelled (Status=50)
        userId:
          type: integer
          format: int64
          example: 10000011133443
          description: >-
            Unique identifier of the customer who placed the order, linking to
            user profile and order history.
        userGetMode:
          type: string
          example: delivery
          description: |
            This field specifies delivery method
            - **delivery**: Requires courier dispatch
            - **pickup**: Customer self-collection
        estimatedDiningReadyUrgeTime:
          type: integer
          format: int64
          example: 1751442900883
          description: >-
            (For pickup orders only) The expected ready-for-collection
            timestamp.
    MerchantOrderDeliveryDTO:
      type: object
      properties:
        waybillId:
          type: integer
          format: int64
          example: 34524
          description: >-
            Internal delivery tracking ID. It can be ignored by the third party
            developers.
        subimitDeliveryResult:
          type: integer
          example: 1
          description: |
            Indicates the success or failure of a delivery request submission:
          x-enumDescriptions:
            '0': >-
              the delivery request failed to process (developers should
              implement retry logic with exponential backoff when encountering
              this status)
            '1': >-
              the delivery request was successfully accepted by Keeta's
              logistics platform
        deliveryStatus:
          type: integer
          example: 50
          description: >
            The current operational state of the delivery order in the
            fulfillment workflow, with the following possible values
          x-enumDescriptions:
            '0': >-
              (Order Created) - The delivery request has been successfully
              registered in Keeta's system but rider assignment has not yet
              begun.
            '10': >-
              (Dispatching) - The system is actively searching for and assigning
              an available rider to fulfill the order.
            '20': >-
              (Rider Assigned) - A rider has accepted the delivery task and is
              preparing to travel to the merchant location.
            '25': >-
              (Rider Arrived at Store) - The assigned rider has reached the
              merchant's physical location and is waiting to collect the order.
            '30': >-
              (Order Collected) - The rider has physically received the order
              package and begun the delivery journey to the customer.
            '50': >-
              (Delivery Completed) - The order has been successfully delivered
              to and acknowledged by the customer.
            '99': (Order Cancelled) - The delivery process was terminated.
        deliveryStatusTime:
          type: integer
          format: int64
          example: 1751444617911
          description: >-
            This field contains a Unix timestamp (in milliseconds since January
            1, 1970) indicating when the current delivery status
            (deliveryStatus) was updated.
        arrivedStatusTime:
          type: integer
          format: int64
          example: 1751444617999
          description: >-
            This field provides a Unix timestamp recording the actual time when
            the order was successfully delivered to the customer.
        deliveryMode:
          type: string
          example: '9001'
          description: >
            The deliveryMode field specifies the logistics method for order
            fulfillment:
          x-enumDescriptions:
            '1001': >-
              indicates that delivery tracking available through Keeta's
              logistics system.
            '9001': indicates that merchant manages own delivery process.
        courierName:
          type: string
          example: Jack Ma
          description: Displays the verified name of the rider assigned to the delivery.
        courierPhone:
          type: string
          example: '+966540505598'
          description: Provides the actual contact number of the Keeta Courier.
        courierPrivacyPhone:
          type: string
          example: '+96234232424'
          description: >-
            Contains a temporary virtual phone number of Keeta Courier provided
            by Keeta privacy protection system.
        merchantOrderDeliveryHisList:
          type: array
          description: >-
            The merchantOrderDeliveryHisList field maintains a complete
            chronological record of all delivery status change, including change
            time and status.
          items:
            $ref: '#/components/schemas/MerchantOrderDeliveryHisDTO'
    MerchantOrderDeliveryHisDTO:
      type: object
      properties:
        opTime:
          type: integer
          format: int64
          example: 1751444617999
          description: >-
            This field contains a Unix timestamp (in milliseconds since January
            1, 1970) indicating when the current delivery status
            (deliveryStatus) was updated.
        deliveryStatus:
          type: integer
          example: 50
          description: >
            The current operational state of the delivery order in the
            fulfillment workflow, with the following possible values
          x-enumDescriptions:
            '0': >-
              (Order Created) - The delivery request has been successfully
              registered in Keeta's system but rider assignment has not yet
              begun.
            '10': >-
              (Dispatching) - The system is actively searching for and assigning
              an available rider to fulfill the order.
            '20': >-
              (Rider Assigned) - A rider has accepted the delivery task and is
              preparing to travel to the merchant location.
            '25': >-
              (Rider Arrived at Store) - The assigned rider has reached the
              merchant's physical location and is waiting to collect the order.
            '30': >-
              (Order Collected) - The rider has physically received the order
              package and begun the delivery journey to the customer.
            '50': >-
              (Delivery Completed) - The order has been successfully delivered
              to and acknowledged by the customer.
            '99': (Order Cancelled) - The delivery process was terminated.
    DeliveryInfoDTO:
      type: object
      properties:
        waybillId:
          type: integer
          format: int64
          example: 3456565342356
          description: >-
            Internal delivery tracking ID. It can be ignored by the third party
            developers.
        estimatedTime:
          type: integer
          example: 1800
          description: >
            This field indicates the *remaining duration* (in seconds) from the
            current time until the order is expected to reach its next status
            milestone

            **Example Scenario:**

            - Current Time: 14:00:00

            - Next Status ETA: 14:30:00

            - estimatedTime = **1800** (30 minutes × 60 seconds)
        estimatedAbsolutelyTime:
          type: integer
          example: 1751444617999
          description: >
            This field indicates the *exact predicted moment* when the next
            status transition should occur, expressed as milliseconds since Jan
            1, 1970 (Unix epoch)

            **Example Scenario:**

            - Next Status ETA: 2024-01-01 14:30:00 UTC

            - estimatedAbsolutelyTime = **1704126600**
    OrderPromotionDtlDTO:
      type: object
      properties:
        i18n:
          allOf:
            - description: Currency information
            - $ref: '#/components/schemas/I18nDTO'
        type:
          type: integer
          example: 4
          description: >-
            Numeric code representing promotion type (reference typeName for
            mapping)
        typeName:
          type: string
          example: Delivery charge discount
          description: |
            Promotion type name. Common values:
          x-enumDescriptions:
            Use red packets: it indicates that the customer used discount coupon.
            Delivery charge discount: the order received reduced/free delivery fees.
            Promo items: the customer purchased specially marked promotional products.
        promotionRuleDesc:
          type: string
          example: delivery fee 8 off 0
          description: >-
            Detailed terms and conditions of the promotion, which help merchants
            to understand how the promotion events work.
        activityId:
          type: string
          example: 5620053
          description: Unique identifier for the promotion campaign
        reduceFee:
          type: integer
          format: int64
          example: 800
          description: >-
            This field indicates the total discount amount applied to the order
            through the promotion activity.
        sillAmount:
          type: integer
          format: int64
          description: >-
            Some promotional activities require the order amount to meet a
            minimum threshold before becoming eligible. This field specifies
            that minimum qualifying amount. When present, the order subtotal
            must exceed this value for the promotion to be applicable.
        merchantActivityFee:
          type: integer
          format: int64
          example: 400
          description: >-
            This field shows the portion of the total discount amount
            (reduceFee) that is financially borne by the merchant. It represents
            the merchant contribution to the promotional discount, which will be
            deducted from the merchant settlement amount with the platform.
        platformActivityFee:
          type: integer
          format: int64
          example: 400
          description: >-
            This field displays the portion of the total discount amount
            (reduceFee) that is subsidized by Keeta platform. It reflects the
            platform share of the promotional cost, which Keeta absorbs as part
            of its marketing initiatives or partnership agreements with
            merchants.
        mainCategory:
          type: integer
          example: 1
          description: >
            The **mainCategory** field indicates the type of coupon used in the
            transaction through a numeric code value. This classification system
            helps identify the scope and applicability of each coupon.
          x-enumDescriptions:
            '1': >-
              When the mainCategory =1, it signifies that the customer applied a
              universal coupon valid for all products across the platform
              without restrictions.
            '2': >-
              When the mainCategory = 2 denotes a merchant-specific coupon that
              can only be redeemed at particular partnered stores.
            '3': >-
              When the mainCategory = 3 represents a product-specific coupon
              that applies only to designated items in the catalog.
            '4': >-
              When the mainCategory = 4, it indicates the customer used a
              delivery fee coupon specifically designed to discount shipping
              costs.
    Rebates:
      type: object
      properties:
        rebatesInfos:
          type: array
          description: >-
            This field contains detailed information about all products in the
            order that are included in the refund process.
          items:
            $ref: '#/components/schemas/RebatesInfo'
        residueProducts:
          type: array
          description: >-
            This field contains information about products in the order that are
            not part of the refund.
          items:
            $ref: '#/components/schemas/ProductDTO'
        valuationRule:
          type: string
          example: >-
            Refund formula: [Item price / (Subtotal + Top-up to minimum)] ×
            [Actual payment amount - Tips - Platform fee - Delivery fee]
          description: >-
            This field displays the mathematical formula used to calculate the
            refund amount.
        applyOpType:
          type: integer
          description: |
            This code identifies who initiated the partial refund request:
          x-enumDescriptions:
            '0': indicates a system-automated refund
            '10': indicates a customer-initiated refund
            '20': indicates a merchant-initiated refund
            '30': indicates a customer service-initiated refund
        rebatesPrintWarnSuffix:
          type: string
          example: ''
          description: >-
            After partial refund processing, this text appears at the end of the
            special notice section on the order receipt.
        rebatesPrintWarnTitle:
          type: string
          example: ''
          description: >-
            This field serves as the heading/title for the partial refund
            notification that appears on the order receipt.
        rebatesPrintWarnInfo:
          type: string
          example: ''
          description: >-
            This field contains the main explanatory text about the partial
            refund that appears on the order receipt.
    RebatesInfo:
      type: object
      properties:
        rebatesProducts:
          type: array
          example:
            - spuId: 11020674
              skuId: 9968694
              count: 1
              price: 8925
              priceStr: $89.25
              originPrice: 11900
              originPriceStr: $119.00
              name: Sweet & Sour Pork Ribs
              id: 325842225
              currency: HKD
              groups:
                - groupId: 4709910
                  groupName: AmoHamza Zawrag Variants
                  minNumber: 0
                  maxNumber: 0
                  status: 0
                  groupOpenItemCode: VGsku-00035
                  shopProductGroupSkuList:
                    - groupSkuId: 26518586
                      spuId: 9979492
                      spuName: Fried
                      price: 0
                      priceStr: '--'
                      currency: SAR
                      spuPvList: []
                      groupSkuOpenItemCode: sku-00036-#V0#-
                      spuNameI18n:
                        ar: مقلي
                        en: Fried
                        default: Fried
                      groupSkuCount: 1
                      count: 1
                      groupSkuExtra: {}
              remark: ''
              picList:
                - >-
                  http://img-ap-hongkong.mykeeta.net/sailorproduct/99903319d53a2fa1e704d2a2ea016cbb167763.jpg
              spec: Sweet & Sour Pork Ribs
              priceWithoutGroup:
                amount: 8925
                amountStr: $89.25
                originAmount: 11900
                originAmountStr: $119.00
              spuOpenItemCode: menu.89.category.225.product.1013090
              skuOpenItemCode: '89.1013090'
              refundPrice: 7957
              refundPriceStr: $79.57
              priceWithGroup:
                amount: 8925
                amountStr: $89.25
                originAmount: 11900
                originAmountStr: $119.00
              nameI18n:
                en: Sweet & Sour Pork Ribs
                default: 糖醋排骨
                zh-HK: 糖醋排骨
              specI18n:
                en: Sweet & Sour Pork Ribs
                default: 糖醋排骨
                zh-HK: 糖醋排骨
          description: >-
            This field contains detailed information about all products included
            in the refund process for this order.
          items:
            $ref: '#/components/schemas/ProductDTO'
        customerRefundPriceStr:
          type: string
          example: $14.28
          description: >-
            This field represents the total refund amount that will be actually
            returned to the customer.
        merchantRefundPriceStr:
          type: string
          example: $14.28
          description: >-
            This field represents the total refund amount to be borne by the
            merchant, calculated as the sum of three components: the refunded
            commission (merchantBrokerageStr), the merchant share of promotional
            discounts (merchantActivityFeeStr), and the base product price
            (merchantProductPriceStr).
        merchantBrokerageStr:
          type: string
          example: $1.07
          description: >-
            This field represents the amount of commission fee that Keeta
            platform will refund back to the merchant. When Keeta originally
            processed the order, a commission fee was deducted from the merchant
            earnings.
        merchantActivityFeeStr:
          type: string
          example: $6.58
          description: >-
            This field indicates the promotional discount amount that Keeta
            platform will refund back to the merchant. During the original
            order, any applied discounts were shared between Keeta and the
            merchant according to their agreement. With the customer now
            requesting a refund, Keeta must return the merchant contributed
            portion of these promotional discounts.
        merchantProductPriceStr:
          type: string
          example: $28.00
          description: >-
            This field contains the product cost amount that the merchant needs
            to refund to the customer. It represents the base price of the items
            being refunded, excluding any platform fees or promotional
            discounts.
    RefundInfos:
      type: object
      properties:
        applyType:
          type: integer
          example: 4001
          description: >
            The **applyType** field is an integer value that identifies the
            specific type of refund request being processed. Each numeric code
            corresponds to a distinct refund initiation scenario, providing
            clear categorization of how and why the refund was triggered.
          x-enumDescriptions:
            '1001': >-
              This code indicates the refund was voluntarily initiated by the
              customer through order detail page.
            '1002': >-
              When a merchant declines a customer's initial refund request
              (1001), the customer may escalate the case. This code signifies
              such an appeal, triggering platform review.
            '2001': >-
              Keeta's customer service representatives may file refunds on
              behalf of users who encounter technical issues or need special
              assistance during the process.
            '2002': >-
              Reserved for refunds directly initiated by Keeta's internal
              systems or staff due to operational/technical requirements,
              independent of customer requests.
            '3001': >-
              Order cancellation auto-refund, which applied when orders are
              canceled through standard workflows, automatically triggering
              refunds without manual intervention.
            '3002': >-
              The system detects and processes refunds for identical duplicate
              requests to prevent accidental double refunds.
            '3003': >-
              Occurs when payment confirmation arrives after order cancellation,
              requiring automatic reversal of the payment.
            '4001': >-
              Merchant-originated refund. Merchants may proactively issue
              refunds for operational reasons (e.g., inventory shortages,
              service failures).
        refundMoney:
          type: string
          example: '2600'
          description: >-
            This field specifies the **actual refund amount** that will be
            credited back to the customer.
        i18n:
          allOf:
            - description: >-
                This field contains currency localization details for the refund
                amount.
            - $ref: '#/components/schemas/I18nDTO'
        status:
          type: integer
          example: 5002
          description: ''
          x-enumDescriptions:
            '1001': >-
              the customer has just created an after-sales request which is
              pending merchant review.
            '1002': >-
              the customer voluntarily withdrew their request before any action
              was taken.
            '1003': >-
              the customer escalated the case to Keeta's support team after the
              merchant rejected their initial request (1001 → 2002 → 1003).
            '1004': >-
              the customer withdrew their appeal (1003) before Keeta's review
              team could process it.
            '2000': >-
              the merchant initiated an after-sales request, typically for order
              cancellation.
            '2001': >-
              the merchant accepted the customer's request (1001 → 2001),
              allowing the refund/return to proceed.
            '2002': >-
              the merchant declined the customer's request (1001 → 2002), often
              prompting an appeal (1003).
            '3000': >-
              Keeta's customer service team filed an after-sales request on
              behalf of either user or merchant.
            '3001': >-
              Keeta's support team manually approved the request after review,
              common for disputed cases.
            '3002': >-
              Keeta's support team denied the request after evaluation,
              typically due to policy violations.
            '4001': >-
              he customer did not process the after-sales request within the
              required timeframe and Keeta's system automatically cancelled it.
            '4002': >-
              the merchant did not respond to the request within the required
              timeframe and Keeta's system automatically approved it.
            '4003': the merchant cancelled the order.
            '4004': Keeta's customer service cancelled the order.
            '4011': >-
              Keeta's system automatically reviewed order records and rejected
              the refund request based on liability determination.
            '4012': >-
              Keeta's system automatically reviewed order records and approved
              the refund request based on liability determination.
            '5001': >-
              the order refund is currently being processed and will be
              completed shortly.
            '5002': the order refund has been successfully processed.
            '5003': the order refund failed to process.
        refundType:
          type: integer
          example: 0
          description: >
            This field indicates the method by which the refund amount will be
            returned to the customer. The possible values are:
          x-enumDescriptions:
            '0': >-
              the refund amount will be returned through the original payment
              method used for the order. This is the default refund method.
            '1': >-
              the refund amount will be credited to the customer's Keeta account
              balance.
        applyReason:
          type: string
          example: 'Item unavailable. Additional information: Insufficient dishes'
          description: >-
            This field provides a description of the reason for the refund
            request.
        opTime:
          type: integer
          format: int64
          example: 1744559452999
          description: >-
            This field contains a Unix timestamp (in milliseconds since January
            1, 1970) that records when the refund request transitioned to its
            current status. This timestamp is essential for tracking the exact
            timing of status changes throughout the refund process.
        refundStatusHisList:
          type: array
          description: >-
            This field maintains a complete chronological history of all status
            changes for the refund request.
          items:
            $ref: '#/components/schemas/RefundStatusHis'
    I18nDTO:
      type: object
      properties:
        currency:
          type: string
          example: SAR
          description: >-
            This field contains the currency code that indicates the monetary
            unit used for the transaction or display.
        region:
          type: string
          example: ''
          description: >-
            This field specifies a geographic region code that represents a
            sub-national area, typically providing more granular location
            information than country-level.
        country:
          type: string
          example: ''
          description: >-
            This field contains the country code that identifies the nation or
            territory associated with the transaction.
        locale:
          type: string
          example: ''
          description: >-
            This field provides the language and region combination used for
            localization purposes. It determines the language for text displays
            and formatting conventions for dates/numbers. **This field is
            typically empty/null unless specific localization is required.**
    RefundStatusHis:
      type: object
      properties:
        opReason:
          type: string
          example: 'Item unavailable. Additional information: Insufficient dishes'
          description: >
            This field documents the reason for the after-sales request status
            change. It may contain:

            - The customer's original refund reason when initiating the request
            (e.g., "Received wrong item")

            - The merchant's justification for approving/rejecting the request
            (e.g., "Verified delivery completion")

            - System-generated explanations for automatic status changes (e.g.,
            "Auto-approved due to merchant timeout")

            - Keeta custom service team's decision rationale when intervening in
            disputes
        opTime:
          type: integer
          format: int64
          example: 1751444617999
          description: >-
            This field records the precise timestamp (in milliseconds since Unix
            epoch January 1, 1970 00:00:00 UTC) when the refund status
            transition occurred. This provides an auditable timeline of all
            state changes throughout the refund lifecycle.
        toStatus:
          type: integer
          example: 2000
          description: >-
            This field indicates the target status code that the refund request
            is transitioning to. The numeric values and their meanings exactly
            correspond to those defined in the RefundInfos.status field.
    RecipientInfo:
      type: object
      properties:
        name:
          type: string
          example: Pony Ma
          description: >-
            This field contains the full name of the order recipient who will
            receive the delivery.
        phone:
          type: string
          example: '+966540505555'
          description: >-
            This field provides the primary contact phone number of the order
            recipient.
        interCode:
          type: string
          example: '+96'
          description: >-
            This field specifies the international dialing code for the
            recipient phone number (e.g., "+86" for China, "+1" for USA). This
            enables proper international calling format when needed.
        addressName:
          type: string
          example: Sha Tian, HongKong District
          description: >-
            This field contains the complete address information including
            administrative divisions and street information (e.g., "Beijing,
            Haidian District, Zhongguancun Street"). It provides the main
            location context for delivery.
        houseNumber:
          type: string
          example: No. 27, Building 5, Unit 302
          description: >-
            This field provides the detailed building and unit number
            information to precisely identify the delivery location (e.g., "No.
            27, Building 5, Unit 302"). Combined with addressName, it forms the
            complete delivery address.
        point:
          allOf:
            - description: >-
                This object contains the precise geographic coordinates of the
                delivery location with Latitude and Longitude 
            - $ref: '#/components/schemas/PointDTO'
    PointDTO:
      type: object
      properties:
        latitude:
          type: number
          format: double
          description: >-
            This field contains the north-south position of the delivery
            location in decimal degrees format, ranging from -90.0 to +90.0.
            Positive values indicate positions north of the equator, while
            negative values represent locations south of the equator.
        longitude:
          type: number
          format: double
          description: >-
            This field contains the east-west position of the delivery location
            in decimal degrees format, ranging from -180.0 to +180.0. Positive
            values indicate positions east of the prime meridian, while negative
            values represent locations west of the prime meridian.
    FeeDtl:
      type: object
      properties:
        merchantFee:
          allOf:
            - description: >-
                This field contains the complete breakdown of all charges that
                the merchant should collect from the customer for the order. 
            - $ref: '#/components/schemas/MerchantFee'
        customerFee:
          allOf:
            - description: This field details the actual amount paid by the customer.
            - $ref: '#/components/schemas/CustomerFee'
    MerchantFee:
      type: object
      properties:
        i18n:
          allOf:
            - description: This field contains currency information.
            - $ref: '#/components/schemas/I18nDTO'
        productPrice:
          type: integer
          format: int64
          example: 4600
          description: >-
            The total base price of all items in the order before any
            adjustments.
        brokerage:
          type: integer
          format: int64
          example: 592
          description: >-
            The commission fee that Keeta platform will deduct from the merchant
            settlement, calculated as a percentage of productPrice according to
            the merchant contract terms.
        activityFee:
          type: integer
          format: int64
          example: 900
          description: >-
            The portion of promotional discounts that the merchant is
            responsible for absorbing. This amount is deducted from the merchant
            settlement.
        diffPrice:
          type: integer
          format: int64
          example: 0
          description: >-
            The minimum order value surcharge applied when an order subtotal
            (productPrice) falls below the store required minimum spend
            threshold.
        total:
          type: integer
          format: int64
          example: 2976
          description: >-
            The merchant receivable amount after all adjustment. Calculated as:
            total = productPrice - brokerage - activityFee + diffPrice
        platformServiceFee:
          type: integer
          format: int64
          example: 0
          description: >-
            A service fee charged by Keeta platform directly to the customer
            (not deducted from merchant funds).
    CustomerFee:
      type: object
      properties:
        i18n:
          allOf:
            - description: This field contains currency information.
            - $ref: '#/components/schemas/I18nDTO'
        productPrice:
          type: integer
          format: int64
          example: 4600
          description: >-
            The total price of all menu items before any discounts or
            promotions.
        shippingFee:
          type: integer
          format: int64
          example: 1900
          description: The delivery fee charged for the order.
        platformFee:
          type: integer
          format: int64
          example: 0
          description: The service fee Keeta charges to users for using the platform.
        discounts:
          type: integer
          format: int64
          example: 1900
          description: >-
            The total amount discounted from the order through all applicable
            promotions, coupons, and special offers.
        tip:
          type: integer
          format: int64
          example: 0
          description: >-
            The optional gratuity amount given by the customer to the Keeta
            courier.
        diffPrice:
          type: integer
          format: int64
          example: 0
          description: >-
            The minimum order value surcharge applied when an order subtotal
            (productPrice) falls below the store required minimum spend
            threshold.
        payTotal:
          type: integer
          format: int64
          example: 4600
          description: >-
            The final amount actually paid by the customer. Calculated as:
            (productPrice) + (shippingFee) + (platformFee) + (diffPrice) -
            (discounts) + (tip)
    ProductDTO:
      type: object
      properties:
        spuId:
          type: integer
          format: int64
          example: 41669804
          description: The unique ID of the SPU, generated by Keeta platform
        skuId:
          type: integer
          format: int64
          example: 41009754
          description: The unique ID of the SKU, generated by Keeta platform
        count:
          type: integer
          format: int64
          example: 2
          description: The quantity of this SKU purchased by the user
        price:
          type: integer
          format: int64
          example: 4600
          description: The discounted price of this SKU (after applying all promotions)
        priceStr:
          type: string
          example: SAR 46.00
          description: The discounted price with currency information (e.g., "SAR 24.00")
        orderViewId:
          type: integer
          format: int64
          example: 756823555555859
          description: The unique order ID generated by Keeta
        originPrice:
          type: integer
          format: int64
          example: 7156
          description: The original price of this SKU before any discounts
        originPriceStr:
          type: string
          example: SAR 46.00
          description: The original price with currency information (e.g., "SAR 24.00")
        name:
          type: string
          example: ULTIMATE-TUNA
          description: The name of the product/SKU (usually same as SPU name)
        id:
          type: integer
          format: int64
          example: 368813062
          description: >-
            The internal SKU ID used only within Keeta system (developers can
            ignore)
        currency:
          type: string
          example: SAR
          description: The currency used for all price-related fields in this structure
        groups:
          type: array
          description: All option group information for this SKU
          example:
            groupId: 4709910
            groupName: AmoHamza Zawrag Variants
            minNumber: 0
            maxNumber: 0
            status: 0
            groupOpenItemCode: VGsku-00035
            shopProductGroupSkuList:
              - groupSkuId: 26518586
                spuId: 9979492
                spuName: Fried
                price: 0
                priceStr: '--'
                currency: SAR
                spuPvList: []
                groupSkuOpenItemCode: sku-00036-#V0#-
                spuNameI18n:
                  ar: مقلي
                  en: Fried
                  default: Fried
                groupSkuCount: 1
                count: 1
                groupSkuExtra: {}
          items:
            $ref: '#/components/schemas/ProductGroupDTO'
        remark:
          type: string
          example: ''
          description: User remarks for this product (e.g., "I prefer it spicy")
        desc:
          type: string
          description: Description information about this SPU
        picList:
          type: array
          description: Image URLs for this SPU to help customers understand the product
          items:
            type: string
            example: >-
              https://img-ap-hongkong.mykeeta.net/sailorproduct/9c760595674b395e330cf94b0e34565311.jpg
        spec:
          type: string
          example: ''
          description: >-
            Specification information for this SKU (e.g., "Large" or "Small" for
            pizza sizes)
        priceWithoutGroup:
          allOf:
            - description: The unit price of the product without option groups
            - $ref: '#/components/schemas/AmountDTO'
        spuOpenItemCode:
          type: string
          example: p|c-1305444:p-10259676
          description: >-
            Developer-provided code that corresponds to Keeta spuId (see Menu
            Development Guide)
        skuOpenItemCode:
          type: string
          example: p|c-1305444:p-10259676
          description: >-
            Developer-provided code that corresponds to Keeta skuId (see Menu
            Development Guide)
        refundPrice:
          type: integer
          format: int64
          description: The refund amount the user will receive if returning this product
        refundPriceStr:
          example: $ 3.00
          type: string
          description: The refund amount with currency information (e.g., "SAR 24.00")
        priceWithGroup:
          allOf:
            - description: The price of the product including Choicegroupsku
            - $ref: '#/components/schemas/AmountDTO'
        nameI18n:
          type: object
          example:
            en: 7-SELECT Chicken Cutlet &Lettuce Sandwich 148g
            default: 7-SELECT吉列雞扒生菜軟包三文治
            zh-HK: 7-SELECT吉列雞扒生菜軟包三文治
          description: >-
            Multi-language translations of the product name. (key=language code,
            value=translation)
          additionalProperties:
            type: string
        descI18n:
          type: object
          example:
            zh-HK: ''
            default: ''
          description: >-
            Multi-language translations of the product description.
            (key=language code, value=translation)
          additionalProperties:
            type: string
        specI18n:
          type: object
          example:
            zh-HK: ''
            default: ''
          description: >-
            Multi-language translations of the product specifications.
            (key=language code, value=translation)
          additionalProperties:
            type: string
    ProductPVDTO:
      type: object
      properties:
        propertyKey:
          allOf:
            - description: >-
                Represents the attribute name in product specifications, such as
                "Size" for a pizza
            - $ref: '#/components/schemas/IdAndName'
        valueList:
          type: array
          description: >-
            List of available values for this specification attribute, such as
            "Large", "Medium", "Small" for size options
          items:
            $ref: '#/components/schemas/IdAndName'
    IdAndName:
      type: object
      properties:
        id:
          type: integer
          format: int64
          description: >-
            This structure is commonly used to represent product specification
            information. This field indicates the ID of the related attribute.
        name:
          type: string
          description: >-
            This structure is commonly used to represent product specification
            information. This field indicates the name of the related attribute.
    ProductGroupDTO:
      type: object
      properties:
        groupId:
          type: integer
          format: int64
          example: 4587525
          description: Unique identifier for the ChoiceGroup, generated by Keeta system
        groupName:
          type: string
          example: Extras
          description: Display name of the ChoiceGroup
        minNumber:
          type: integer
          description: >-
            Minimum required selections for this ChoiceGroup (enforced during
            ordering)
        maxNumber:
          type: integer
          description: >-
            Maximum allowed selections for this ChoiceGroup (enforced during
            ordering)
        status:
          type: integer
          example: 1
          description: |
            Availability status of the ChoiceGroup
          x-enumDescriptions:
            '0': indicates that the ChoiceGroup is not available,
            '1': indicates that the ChoiceGroup is available
        shopProductGroupSkuList:
          type: array
          description: >-
            Contains all available ChoiceGroupSkus (selectable items) within
            this ChoiceGroup
          items:
            $ref: '#/components/schemas/ProductGroupSkuDTO'
        groupOpenItemCode:
          type: string
          example: '2345432'
          description: >-
            Developer-provided external reference code that maps to groupId (see
            Menu Development Guide)
    ProductGroupSkuDTO:
      type: object
      properties:
        groupSkuId:
          type: integer
          format: int64
          example: 25703896
          description: Unique identifier for the ChoiceGroupSku, generated by Keeta system
        spuId:
          type: integer
          format: int64
          example: 8544619
          description: Unique identifier for the parent SPU, generated by Keeta system
        spuName:
          type: string
          example: Without Extras
          description: Name of the Standard Product Unit (SPU)
        price:
          type: integer
          format: int64
          example: 0
          description: Price of this ChoiceGroupSku
        priceStr:
          type: string
          example: '-'
          description: Formatted price with currency symbol (e.g., "SAR 24.00")
        currency:
          type: string
          example: SAR
          description: Currency code (e.g., "SAR" for Saudi Riyal)
        groupSkuOpenItemCode:
          type: string
          example: '9992'
          description: >-
            Developer-provided external code mapping to groupSkuId (see Menu
            Development Guide)
        refundPrice:
          type: integer
          format: int64
          example: 0
          description: Refund amount for this ChoiceGroupSku in smallest currency unit
        refundPriceStr:
          type: string
          example: ''
          description: Formatted refund amount with currency (e.g., "SAR 24.00")
        spuNameI18n:
          type: object
          description: Localized SPU names (key=language code, value=translation)
          additionalProperties:
            type: string
        groupSkuCount:
          type: integer
          format: int64
          example: 1
          description: Total purchased quantity (count × parent ProductDTO.count)
        count:
          type: integer
          example: 1
          description: Customer selected quantity of the ChoicegroupSku
    AmountDTO:
      type: object
      properties:
        amount:
          type: integer
          format: int64
          example: 4600
          description: >-
            Total discounted price for the product (discounted unit price ×
            quantity)
        unitPrice:
          type: integer
          format: int64
          example: 2300
          description: Discounted price per unit of the product
        amountStr:
          type: string
          example: SAR 23.00
          description: >-
            Formatted total discounted price with currency symbol (e.g., "SAR
            24.00")
        originAmount:
          type: integer
          format: int64
          example: 4600
          description: >-
            Original total price before discounts (original unit price ×
            quantity)
        originUnitPrice:
          type: integer
          format: int64
          example: 2300
          description: Original price per unit before any discounts
        originAmountStr:
          type: string
          example: SAR 23.00
          description: >-
            Formatted original unit price with currency symbol (e.g., "SAR
            24.00")
    SubOrderInfoDTO:
      type: object
      properties:
        merchantSubOrder:
          allOf:
            - description: >-
                Contains basic sub-order information(see MerchantSubOrderDTO
                section for details)
            - $ref: '#/components/schemas/MerchantSubOrderDTO'
        products:
          type: array
          description: >-
            Lists all products included in this sub-order (see ProductDTO
            section for details)
          items:
            $ref: '#/components/schemas/ProductDTO'
        merchantOrderDeliveries:
          type: array
          description: >-
            Contains all delivery-related information for this sub-order (see
            MerchantOrderDeliveryDTO section)
          items:
            $ref: '#/components/schemas/MerchantOrderDeliveryDTO'
        deliveryInfos:
          type: array
          description: >-
            Provides real-time delivery tracking information for the sub-order
            (see DeliveryInfoDTO section)
          items:
            $ref: '#/components/schemas/DeliveryInfoDTO'
        partRefund:
          allOf:
            - description: >-
                Contains refund details specific to this sub-order (see
                PartRefundDTO section)
            - $ref: '#/components/schemas/PartRefundDTO'
    MerchantSubOrderDTO:
      type: object
      properties:
        merchantSubOrderId:
          type: integer
          format: int64
          description: Unique identifier for the suborder
        orderViewId:
          type: integer
          format: int64
          description: >-
            Unique ID of the main/parent order from which this suborder was
            split
        shopId:
          type: integer
          format: int64
          description: Unique store ID generated by Keeta system
        userId:
          type: integer
          format: int64
          description: Unique user ID generated by Keeta system
        subOrderSeq:
          type: string
          description: >-
            Suborder sequence number printed on receipts (Format:
            #MainOrderID-SuborderIndex/TotalSuborders, e.g., "#9527-1/3" means
            main order 9527, suborder 1 of 3)
        extra:
          type: string
          description: |
            Additional suborder metadata containing:
            - Main order ID
            - Suborder sequence index
            - Total suborder count
            Example: "#9527-1/3" shows main order 9527, suborder 1 of 3
        ctime:
          type: integer
          format: int64
          description: >-
            Suborder creation time as Unix timestamp (milliseconds since January
            1, 1970)
        utime:
          type: integer
          format: int64
          description: >-
            Suborder update time as Unix timestamp. Typically equals ctime
            unless modified.
    PartRefundDTO:
      type: object
      properties:
        products:
          type: array
          description: >-
            Contains detailed information about all products in the suborder
            that are included in the refund process
          items:
            $ref: '#/components/schemas/ProductDTO'
        residueProducts:
          type: array
          description: >-
            Contains detailed information about products in the suborder that
            are not part of the refund
          items:
            $ref: '#/components/schemas/ProductDTO'
    AfterSaleProductDTO:
      type: object
      required:
        - orderProductId
        - refundCount
      properties:
        orderProductId:
          type: integer
          format: int64
          example: 1234534224
          description: Unique identifier for the SPU, generated by Keeta platform
        refundCount:
          type: integer
          format: int64
          example: 1
          description: The quantity of this specific product to be refunded
    PartRefundPreviewResp:
      type: object
      properties:
        products:
          type: array
          description: >-
            This field returns the detailed information of all products
            specified in the refund request parameters that require processing.
          items:
            $ref: '#/components/schemas/AfterSaleOrderPartRefundProductsPreviewVO'
        promotionInfoList:
          type: array
          description: >-
            This field contains comprehensive amount details related to the
            product refunds.
          items:
            $ref: '#/components/schemas/AfterSalePromotionVO'
        refundPrice:
          allOf:
            - description: >-
                This field represents the total calculated refund amount for all
                products included in the refund request parameters.
            - $ref: '#/components/schemas/AfterSalePriceCurrency'
        valuationRule:
          type: string
          example: >-
            Refund formula: [Item price / (Subtotal + Top-up to minimum)] ×
            [Actual payment amount - Tips - Platform fee - Delivery fee]
          description: >-
            This field provides the detailed calculation methodology used to
            determine the refundPrice value.
    AfterSaleOrderPartRefundProductsPreviewVO:
      type: object
      properties:
        id:
          type: integer
          format: int64
          example: 9312039
          description: Unique identifier for the SPU, generated by Keeta system
        spuId:
          type: integer
          format: int64
          example: 9312039
          description: Unique identifier for the SPU, generated by Keeta system
        skuId:
          type: integer
          format: int64
          example: 8414079
          description: Unique identifier for the SKU, generated by Keeta system
        count:
          type: integer
          format: int64
          example: 2
          description: Total quantity of this product purchased by the customer
        price:
          type: string
          example: $10.00
          description: Unit price of the product
        name:
          type: string
          example: Lemon Tea Double Cup Set Meal
          description: Display name of the product
        refundType:
          type: integer
          example: 0
          description: |
            Indicates the refund status of the product:
          x-enumDescriptions:
            '0': indicates that the product has not been refunded
            '1': indicates that the product has been fully refunded
            '2': indicates that the product has been partially refunded
        refundCount:
          type: integer
          format: int64
          example: 0
          description: Quantity of this product to be refunded
        refundPrice:
          type: string
          example: $0.00
          description: Total refund amount for this product
        choiceGroupList:
          type: array
          description: >-
            Detailed ChoiceGroup and ChoiceGroupSku information for refunded
            items
          items:
            $ref: '#/components/schemas/AfterSaleOrderProductGroupPreviewVO'
        associatedChoiceGroupList:
          type: array
          description: ChoiceGroups associated with the refunded product
          items:
            $ref: '#/components/schemas/AfterSaleOrderProductAssociatedGroupPreviewVO'
        spec:
          type: string
          example: ''
          description: Product specifications (e.g., size)
    AfterSaleOrderProductGroupPreviewVO:
      type: object
      properties:
        id:
          type: integer
          format: int64
          example: 3271540
          description: Unique identifier for the ChoiceGroup, generated by Keeta system
        name:
          type: string
          example: sweetness
          description: Display name of the ChoiceGroup (e.g., "Toppings", "Size Options")
        choiceGroupSkuList:
          type: array
          example:
            - id: 16320510
              spuId: 0
              name: Slightly sweet
              price: $0.00
              refundCount: 0
              refundPrice: 0
              groupSkuCount: 0
          description: >-
            Contains all ChoiceGroupSkus (selectable items) belonging to this
            ChoiceGroup
          items:
            $ref: '#/components/schemas/AfterSaleOrderProductGroupSkuPreviewVO'
    AfterSaleOrderProductGroupSkuPreviewVO:
      type: object
      properties:
        id:
          type: integer
          format: int64
          description: >-
            Unique identifier for the ChoiceGroupSku (option item), generated by
            Keeta system
          example: 3443
        spuId:
          type: integer
          format: int64
          description: >-
            Unique identifier of the parent SPU (Standard Product Unit),
            generated by Keeta system
          example: 45325445
        name:
          type: string
          description: Display name of the ChoiceGroupSku
          example: ChoiceGroupSkuName
        price:
          type: string
          description: Unit price of the ChoiceGroupSku with currency formatting
          example: $24.00
        refundCount:
          type: integer
          format: int64
          description: Quantity of this ChoiceGroupSku to be refunded
          example: 3
        refundPrice:
          type: integer
          format: int64
          description: Total refund amount for this ChoiceGroupSku
          example: 156
        groupSkuCount:
          type: integer
          format: int64
          description: Preview of option group quantity for partial refunds
          example: 3
    AfterSalePromotionVO:
      type: object
      properties:
        type:
          type: integer
          description: Type of promotion/discount applied
          example: 3
        title:
          type: string
          description: >
            This field indicates the discount category code currently being
            applied, with the following values:
          x-enumDescriptions:
            '1': >-
              indicates the "Subtotal Module" containing total product amount
              information
            '2': >-
              indicates the "Minimum Spend Supplement Module" containing the
              amount needed to meet minimum spending requirements
            '3': indicates the "Coupon Module" containing coupon discount amounts
            '4': >-
              indicates the "Delivery Fee Module" containing delivery fee
              reductions
            '5': >-
              indicates the "Platform Fee Module" containing platform fee
              deductions
            '6': >-
              indicates the "Tip Module" containing customer tips for delivery
              personnel
            '7': >-
              indicates the "All Discounts Module" containing comprehensive
              coupon discounts (equivalent to type 3)
            '8': >-
              indicates the "Payment Discount Module" containing instant payment
              discount amounts
          example: promotionName
        originFee:
          allOf:
            - description: >-
                Original product price before any discounts (calculated as:
                originFee = realPayFee + reduceFee)
            - $ref: '#/components/schemas/AfterSalePriceCurrency'
        realPayFee:
          allOf:
            - description: Actual amount paid by customer after discounts
            - $ref: '#/components/schemas/AfterSalePriceCurrency'
        reduceFee:
          allOf:
            - description: Discount amount deducted from original price due to promotions
            - $ref: '#/components/schemas/AfterSalePriceCurrency'
    AfterSaleOrderProductAssociatedGroupPreviewVO:
      type: object
      properties:
        id:
          type: integer
          format: int64
          description: Unique identifier for the ChoiceGroup, generated by Keeta system
          example: 123
        name:
          type: string
          description: Display name of the ChoiceGroup
          example: noodles
        auditStatus:
          type: integer
          description: >
            The value of this field represents the approval status of the
            'ChoiceGroup'
          x-enumDescriptions:
            '0': >-
              This choiceGroup has violated regulations and has not passed the
              manual review of the Keeta platform
            '1': >-
              This choiceGroup has successfully passed the manual review on the
              Keeta platform
        status:
          type: integer
          description: >
            The value of this field indicates whether the status of the
            choiceGroup is valid
          x-enumDescriptions:
            '0': Indicates that this choiceGroup is invalid
            '1': Indicates that this choiceGroup is valid
    AfterSalePriceCurrency:
      type: object
      properties:
        amount:
          type: integer
          format: int64
          description: >-
            This field value represents the numerical value corresponding to the
            amount
          example: 24
        currency:
          type: string
          description: This field value represents currency information
          example: SAR
        amountStr:
          type: string
          description: >-
            This field value represents the numerical value corresponding to the
            amount, and will carry currency information, example: "SAR 24.00"
          example: SAR 24.00
    CourierInfo:
      type: object
      description: >-
        Comprehensive courier information for self-delivery orders, including
        personal details, contact information, and vehicle specifications.
      properties:
        courierId:
          type: integer
          format: int64
          example: 123456
          description: Unique identifier for the courier, generated by the vendor system
        courierName:
          type: string
          example: أحمد محمد
          description: Full name of the courier responsible for delivery
        courierPhone:
          type: string
          example: '501234567'
          description: Primary contact phone number of the courier
        courierVehicle:
          type: integer
          description: |
            Type of vehicle used by the courier for delivery:
          x-enumDescriptions:
            '1': Walking - Courier delivers on foot
            '2': Bicycle - Courier uses bicycle for delivery
            '3': Motorcycle - Courier uses motorcycle for delivery
            '4': Private Car - Courier uses private vehicle for delivery
          enum:
            - 1
            - 2
            - 3
            - 4
          example: 3
        courierPhoneInterCode:
          type: string
          example: '+966'
          description: >-
            International dialing code for the courier phone number (e.g.,
            "+966" for Saudi Arabia)
        vehiclePlateNumber:
          type: string
          example: DXB-A-12345
          description: License plate number of the delivery vehicle
        courierLastName:
          type: string
          example: محمد
          description: Last name (family name) of the courier
        courierFirstName:
          type: string
          example: أحمد
          description: First name (given name) of the courier
tags:
  - name: Endpoints
    description: >-
      Request APIs - All endpoints for requesting order information and making
      updates
  - name: Webhooks
    description: Webhooks - Webhook notifications sent by Keeta to third-party systems
  - name: MerchanSelfDelivery
    description: >+
      The endpoint below is restricted to merchant self-delivery orders and is
      only available for updates after the merchant accepts the order. Orders
      that are completed or cancelled cannot be updated. <br> **Availability:**
      This API is available starting August 16, 2025.

