openapi: 3.0.0
info:
  title: Mrsool Api
  version: 1.0.0
servers:
  - url: http://{{base_url}}auth
  - url: http://{{base_url}}users
  - url: http://{{base_graphql_url}}
  - url: http://{{base_url}}user_preferences
  - url: http://{{base_url}}zendesk
  - url: http://{{base_url}}orders
  - url: http://{{base_url}}chatbot_orders
  - url: http://{{base_url}}shops
  - url: http://{{base_url}}rating_reasons
tags:
  - name: Auth
  - name: User
  - name: User > Courier
  - name: Zendesk
  - name: OrderAssignmenting
  - name: Order
  - name: Order > Courier
  - name: Order > Courier > CourierOrderActions
  - name: Order > Buyer
  - name: Order > Rating
  - name: support
  - name: shift-management
paths:
  /signin:
    post:
      tags:
        - Auth
      summary: Login via mobile
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                vPhone:
                  type: number
                  description: Buyer
                  example: '+967770846029'
                language:
                  type: string
                  example: en
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
  /{user_id}/verify_code:
    patch:
      tags:
        - Auth
      summary: OTP verify_code
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                vVerificationCode:
                  type: integer
                  example: '1234'
                language:
                  type: string
                  example: en
                device_id:
                  type: string
                  example: postman_device_id
      parameters:
        - name: user_id
          in: path
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
  /{user_id}/update_notification_status:
    post:
      tags:
        - User > Courier
      summary: Update notification status - offline-online
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                bNotification:
                  type: boolean
                  description: true/false
                  example: 'true'
                auth_token:
                  type: string
                  description: required
                  example: '{{auth_tokn}}'
                vDeviceToken:
                  type: string
                  example: >-
                    ecXSay8iQBSY_MN8oMZAj8%3AAPA91bEYd0WoY8D9dcIcBGp5Rpng1PxBqKcXJjahPoRmcICigPgUzPYTCfQqOIywlk1XAbHHCKqUWWIrq5WnhtXVdDtMk5r5W1welhIYdXk_vnSOXHdjt7C3WYN7QMX7wbO7HcsqOUft
                vTokenType:
                  type: string
                  example: G
                current_user:
                  type: integer
                  example: '2574681'
      parameters:
        - name: user_id
          in: path
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
  /{user_id}/courier_notifications_v2:
    get:
      tags:
        - User > Courier
      summary: courier_notifications_v2
      parameters:
        - name: auth_token
          in: query
          schema:
            type: string
          example: '{{authToken}}'
        - name: user_id
          in: path
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
  /:
    post:
      tags:
        - shift-management
      summary: CurrentIntersetShift
      requestBody:
        content: {}
      parameters:
        - name: Authorization
          in: header
          schema:
            type: string
          example: Token {{user_id}}:{{authToken}}
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
    put:
      tags:
        - User
      summary: update user_preferences
      requestBody:
        content: {}
      parameters:
        - name: mode
          in: query
          schema:
            type: string
          example: courier
        - name: current_user_id
          in: query
          schema:
            type: string
          example: '{{user_id}}'
        - name: auth_token
          in: query
          schema:
            type: string
          example: '{{authToken}}'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
  /{user_id}/courier_notification_preferences:
    get:
      tags:
        - User > Courier
      summary: courier notification preferences
      parameters:
        - name: current_user_id
          in: query
          schema:
            type: string
          example: '{{user_id}}'
        - name: auth_token
          in: query
          schema:
            type: string
          example: '{{authToken}}'
        - name: user_id
          in: path
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
  /{user_id}:
    patch:
      tags:
        - User
      summary: update user
      description: update user language
      requestBody:
        content: {}
      parameters:
        - name: iUserId
          in: query
          schema:
            type: string
          example: '{{user_id}}'
        - name: auth_token
          in: query
          schema:
            type: string
          example: '{{authToken}}'
        - name: vLanguage
          in: query
          schema:
            type: string
          description: ar,en
          example: ar
        - name: current_user_id
          in: query
          schema:
            type: string
          description: >-
            https://api.staging.mrsool.co/v6/users/2574681?iUserId=2574681&vLanguage=ar&current_user_id=2574681&auth_token=94670eae64650e13c42438bfbdc5587c
          example: '{{user_id}}'
        - name: user_id
          in: path
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
    get:
      tags:
        - User
      summary: Get user
      parameters:
        - name: auth_token
          in: query
          schema:
            type: string
          example: '{{authToken}}'
        - name: current_user_id
          in: query
          schema:
            type: string
          example: '{{user_id}}'
        - name: user_id
          in: path
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
  /{user_id}/notifications:
    get:
      tags:
        - User
      summary: Get Notification History
      parameters:
        - name: iUserId
          in: query
          schema:
            type: string
          example: '{{user_id}}'
        - name: auth_token
          in: query
          schema:
            type: string
          example: '{{authToken}}'
        - name: user_id
          in: path
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
  /configuration:
    get:
      tags:
        - Zendesk
      summary: configuration
      parameters:
        - name: app_sign
          in: query
          schema:
            type: string
          description: |-
            staging: ve2AH4sNv8Qe1JrdoGnScRn6GlY%3D
            production: gKnJlEYa3x5jCPkBfcFh1yrlyRA=
          example: ve2AH4sNv8Qe1JrdoGnScRn6GlY%3D
        - name: country_code
          in: query
          schema:
            type: string
          example: us
        - name: language
          in: query
          schema:
            type: string
          example: ar
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
  /category_details:
    get:
      tags:
        - Zendesk
      summary: category_details
      parameters:
        - name: app_sign
          in: query
          schema:
            type: string
          example: ve2AH4sNv8Qe1JrdoGnScRn6GlY%3D
        - name: country_code
          in: query
          schema:
            type: string
          example: SA
        - name: language
          in: query
          schema:
            type: string
          example: en
        - name: category_id
          in: query
          schema:
            type: integer
          description: b:9505949272215, c:9505921228439
          example: '9505949272215'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
  /recent_orders:
    get:
      tags:
        - Zendesk
      summary: Recent orders
      description: >-
        when user creating an complaint, he need to select an order with that
        complaint, use this api to get recent user's orders
      parameters:
        - name: iUserId
          in: query
          schema:
            type: string
          example: '{{user_id}}'
        - name: request_version
          in: query
          schema:
            type: integer
          example: '1'
        - name: orders_for
          in: query
          schema:
            type: string
          description: '[buyer,courier]'
          example: courier
        - name: language
          in: query
          schema:
            type: string
          example: en
        - name: auth_token
          in: query
          schema:
            type: string
          example: '{{authToken}}'
        - name: current_user_id
          in: query
          schema:
            type: string
          description: '2576043'
          example: '{{user_id}}'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
  /get_action_value:
    get:
      tags:
        - Zendesk
      summary: get_action_value
      parameters:
        - name: country_code
          in: query
          schema:
            type: string
          example: SA
        - name: initial_action
          in: query
          schema:
            type: string
          example: ActionChatOrOrderComplaint
        - name: auth_token
          in: query
          schema:
            type: string
          example: '{{authToken}}'
        - name: current_user_id
          in: query
          schema:
            type: string
          example: '{{user_id}}'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
  /complaint_orders:
    get:
      tags:
        - Zendesk
      summary: complaint_orders
      parameters:
        - name: app_sign
          in: query
          schema:
            type: string
          example: '{{app_sign}}'
        - name: language
          in: query
          schema:
            type: string
          example: en
        - name: order_ids
          in: query
          schema:
            type: integer
          example: '15774968'
        - name: current_user_id
          in: query
          schema:
            type: string
          example: '{{user_id}}'
        - name: auth_token
          in: query
          schema:
            type: string
          example: '{{authToken}}'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
  /15775555/update_order_state:
    post:
      tags:
        - Order > Courier
      summary: updateOrderState
      requestBody:
        content: {}
      parameters:
        - name: action_type
          in: query
          schema:
            type: string
          description: order_pickup,rate_experience
          example: order_pickup
        - name: clongitude
          in: query
          schema:
            type: number
          example: '46.67814'
        - name: iCourierId
          in: query
          schema:
            type: string
          example: '{{user_id}}'
        - name: clatitude
          in: query
          schema:
            type: number
          example: '24.7833433'
        - name: current_user_id
          in: query
          schema:
            type: string
          example: '{{user_id}}'
        - name: auth_token
          in: query
          schema:
            type: string
          example: '{{authToken}}'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
  /{user_id}/my_deliveries:
    get:
      tags:
        - Order > Courier
      summary: Get my deliveries Orders
      parameters:
        - name: iUserId
          in: query
          schema:
            type: string
          example: '{{user_id}}'
        - name: request_version
          in: query
          schema:
            type: integer
          example: '1'
        - name: auth_token
          in: query
          schema:
            type: string
          example: '{{authToken}}'
        - name: user_id
          in: path
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
  /15774982/issue_bill:
    post:
      tags:
        - Order > Courier
      summary: issue_bill
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                iOrderId:
                  type: integer
                  example: '15774982'
                iBuyerId:
                  type: integer
                  example: '2576043'
                dbTotalCost:
                  type: number
                  example: '10.0'
                clongitude:
                  type: number
                  example: '46.67814'
                dbOrderCost:
                  type: number
                  example: '10.0'
                dbDeliveryCost:
                  type: number
                  example: '0.0'
                iCourierId:
                  type: string
                  example: '{{user_id}}'
                clatitude:
                  type: number
                  example: '24.7833433'
                image:
                  type: string
                  format: binary
      parameters:
        - name: current_user_id
          in: query
          schema:
            type: string
          example: '{{user_id}}'
        - name: auth_token
          in: query
          schema:
            type: string
          example: '{{authToken}}'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
  /15775554/get_min_max_offer:
    post:
      tags:
        - Order > Courier
      summary: Get min max offer for a new order
      requestBody:
        content: {}
      parameters:
        - name: iCourierId
          in: query
          schema:
            type: string
          example: '{{user_id}}'
        - name: auth_token
          in: query
          schema:
            type: string
          example: '{{authToken}}'
        - name: current_user_id
          in: query
          schema:
            type: string
          example: '{{user_id}}'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
  /15775471/issue_offer:
    post:
      tags:
        - Order > Courier
      summary: Issue offer
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                iOrderId:
                  type: integer
                  description: >-
                    iOrderId=15775470&iBuyerId=2576043&dbDistanceFromMe=2.16&latitude=24.77358547&current_user_id=2574681&clongitude=46.67814&iCourierId=2574681&auth_token=94670eae64650e13c42438bfbdc5587c&iDeliveryCost=15&clatitude=24.7833433&dtExpiryDateTime=1%3AH&longitude=46.67389758
                  example: '15775471'
                longitude:
                  type: number
                  description: >-
                    iOrderId=15775471&iBuyerId=2576043&dbDistanceFromMe=2.16&latitude=24.77358547&current_user_id=2574681&clongitude=46.67814&iCourierId=2574681&auth_token=94670eae64650e13c42438bfbdc5587c&iDeliveryCost=12&clatitude=24.7833433&dtExpiryDateTime=1%3AH&longitude=46.67389758
                  example: '46.67389758'
                dtExpiryDateTime:
                  type: string
                  example: 1 hr
                clatitude:
                  type: number
                  example: '24.7833433'
                iDeliveryCost:
                  type: integer
                  example: '14'
                iCourierId:
                  type: string
                  example: '{{user_id}}'
                clongitude:
                  type: number
                  example: '46.67814'
                latitude:
                  type: number
                  example: '24.77358547'
                dbDistanceFromMe:
                  type: number
                  example: '2.16'
                iBuyerId:
                  type: integer
                  example: '2576043'
                current_user_id:
                  type: string
                  example: '{{user_id}}'
                auth_token:
                  type: string
                  example: '{{authToken}}'
      parameters:
        - name: current_user_id
          in: query
          schema:
            type: string
          example: '{{user_id}}'
        - name: auth_token
          in: query
          schema:
            type: string
          example: '{{authToken}}'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
  /15774982:
    patch:
      tags:
        - Order > Courier
      summary: 'Edit order to be delivered '
      requestBody:
        content: {}
      parameters:
        - name: iOrderId
          in: query
          schema:
            type: integer
          example: '15774982'
        - name: current_user_id
          in: query
          schema:
            type: string
          example: '{{user_id}}'
        - name: vStatus
          in: query
          schema:
            type: string
          example: delivered
        - name: iCourierId
          in: query
          schema:
            type: string
          example: '{{user_id}}'
        - name: auth_token
          in: query
          schema:
            type: string
          example: '{{authToken}}'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
  /{user_id}/my_orders:
    get:
      tags:
        - Order > Buyer
      summary: my Orders
      parameters:
        - name: iUserId
          in: query
          schema:
            type: string
          example: '{{user_id}}'
        - name: request_version
          in: query
          schema:
            type: integer
          example: '1'
        - name: auth_token
          in: query
          schema:
            type: string
          example: '{{authToken}}'
        - name: ''
          in: query
          schema:
            type: string
          description: >-
            https://api.staging.mrsool.co/v6/users/2575588/my_orders?iUserId=2575588&request_version=1&current_user_id=2575588&auth_token=4314ac13f614154456719939efe366c2
        - name: user_id
          in: path
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
  /15776879/accept_reject_offer:
    post:
      tags:
        - Order > Buyer
      summary: accept_reject_offer
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                iBuyerId:
                  type: string
                  example: '{{user_id}}'
                auth_token:
                  type: string
                  description: 071115a95e4154c9b0ecc82a876b06ab
                  example: '{{authToken}}'
                vStatus:
                  type: string
                  example: accept
                current_user_id:
                  type: string
                  description: 'buyer 77 : 2576043'
                  example: '{{user_id}}'
                new_offer_id:
                  type: integer
                  example: '30132354'
                '':
                  type: string
                  example: '{us'
      parameters:
        - name: current_user_id
          in: query
          schema:
            type: string
          description: buyer 77 :2576043
          example: '{{user_id}}'
        - name: auth_token
          in: query
          schema:
            type: string
          description: 071115a95e4154c9b0ecc82a876b06ab
          example: '{{authToken}}'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
  /a036445e3611d2ba1d7bfc832a121949/rating_reviews:
    post:
      tags:
        - Order > Rating
      summary: Shop rating
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                rating_reason_ids:
                  type: string
                review:
                  type: string
                rating:
                  type: integer
                  example: '3'
                order_id:
                  type: integer
                  example: '15774968'
      parameters:
        - name: current_user_id
          in: query
          schema:
            type: string
          example: '{{user_id}}'
        - name: auth_token
          in: query
          schema:
            type: string
          example: '{{authToken}}'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
  /give_ratings:
    post:
      tags:
        - Order > Rating
      summary: User rating
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                iOrderId:
                  type: integer
                  example: '15774968'
                txReview:
                  type: string
                  example: cool
                iRaterId:
                  type: string
                  example: '{{user_id}}'
                rating_reason_ids:
                  type: string
                fRating:
                  type: integer
                  example: '2'
                iRatedId:
                  type: integer
                  example: '2576043'
      parameters:
        - name: current_user_id
          in: query
          schema:
            type: string
          example: '{{user_id}}'
        - name: auth_token
          in: query
          schema:
            type: string
          example: '{{authToken}}'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
  /275974239:
    get:
      tags:
        - Order
      summary: order detail with chat messages
      parameters:
        - name: ''
          in: header
          schema:
            type: string
        - name: current_latitude
          in: query
          schema:
            type: number
          example: '24.7833433'
        - name: with_messages
          in: query
          schema:
            type: integer
          example: '1'
        - name: current_longitude
          in: query
          schema:
            type: number
          example: '46.67814'
        - name: amplitude_session_id
          in: query
          schema:
            type: integer
          example: '1690186542684'
        - name: with_menu
          in: query
          schema:
            type: integer
          description: 0,1
          example: '1'
        - name: current_user
          in: query
          schema:
            type: string
          description: '2574681'
          example: '{{user_id}}'
        - name: auth_token
          in: query
          schema:
            type: string
          example: '{{authToken}}'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
