# Create Reverse Orders Waybill

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1/managers/store/reverse-orders/waybill:
    post:
      summary: Create Reverse Orders Waybill
      deprecated: false
      description: |-
        Creates a waybill for a reversed order.

        <Accordion title="🔑Scopes" defaultOpen>
            
        ` orders.read_write` - Orders Read & Write
         
        </Accordion>
      operationId: post-managers-store-reverse-orders-waybill
      tags:
        - Default module/Apps/Merchant APIs/Reverse Orders
        - Reverse Orders
      parameters:
        - name: Authorization
          in: header
          description: >-
            The Authorization token is a unique key given to the third-party
            application (Partner) by Zid. It is used to authenticate the API
            requests made by the Partner application. The token verifies the
            partner's identity and ensures they have permission to access Zid's
            API but does not provide any specific user or store information. It
            should be included in the header of API requests when the partner
            application needs to access Zid's API.
          required: true
          example: '{{Autherization}}'
          schema:
            type: string
        - name: X-MANAGER-TOKEN
          in: header
          description: >-
            Unique manager token used to authorize requests at a manager level,
            specific to each partner.
          required: true
          example: '{{Access-Token}}'
          schema:
            type: string
        - name: Accept-Language
          in: header
          description: Language preference.
          required: true
          example: en
          schema:
            type: string
            default: ar
            enum:
              - ar
              - en
            x-apidog-enum:
              - value: ar
                name: ''
                description: ''
              - value: en
                name: ''
                description: ''
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                order_id:
                  type: integer
                  x-stoplight:
                    id: yavaevsryf3p9
                  description: The ID of the order to reverse.
                  examples:
                    - '"ORD12345"'
                  example: 64086815
                is_standalone_zidship_waybill:
                  type: boolean
                  description: Indicates if the waybill is standalone.
                  example: '0'
              required:
                - order_id
                - is_standalone_zidship_waybill
            examples: {}
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Reverse-Order-Response'
          headers: {}
          x-apidog-name: Reverse order waybill created successfully.
        '401':
          description: ''
          content:
            application/json:
              schema:
                type: object
                description: >-
                  Response returned when the request cannot be authenticated
                  because the required credentials are missing, invalid, or
                  expired.
                properties:
                  status:
                    type: string
                    description: Indicates the overall status of the API response.
                    examples:
                      - error
                  message:
                    type: object
                    description: >-
                      Contains structured details explaining why the request
                      could not be authenticated.
                    properties:
                      type:
                        type: string
                        description: Indicates the category of the response message.
                        examples:
                          - error
                      code:
                        type: string
                        description: >-
                          A machine-readable code identifying the authentication
                          error. Returns null when no specific code is
                          available.
                        examples:
                          - UNAUTHORIZED
                        nullable: true
                      name:
                        type: string
                        description: >-
                          A short, human-readable title describing the
                          authentication error. Returns null when no title is
                          available.
                        examples:
                          - Unauthorized
                        nullable: true
                      description:
                        type: string
                        description: >-
                          A human-readable explanation of why the request could
                          not be authenticated. Returns null when no detailed
                          explanation is available.
                        examples:
                          - >-
                            Authentication credentials are missing, invalid, or
                            expired.
                        nullable: true
                    required:
                      - type
                      - code
                      - name
                      - description
                    x-apidog-orders:
                      - type
                      - code
                      - name
                      - description
                    x-apidog-ignore-properties: []
                required:
                  - status
                  - message
                x-apidog-orders:
                  - status
                  - message
                examples:
                  - status: error
                    message:
                      type: error
                      code: UNAUTHORIZED
                      name: Unauthorized
                      description: >-
                        Authentication credentials are missing, invalid, or
                        expired.
                x-apidog-ignore-properties: []
              examples:
                '2':
                  summary: Example 1
                  value:
                    status: error
                    message:
                      type: error
                      code: ERROR_SESSION_MISSING
                      name: Sorry
                      description: Please login first.
                '3':
                  summary: Example 2
                  value:
                    status: error
                    message:
                      type: error
                      code: ERROR_SESSION_INVALID
                      name: Sorry
                      description: Login session expired. Please login again.
                '4':
                  summary: Example 3
                  value:
                    status: error
                    message:
                      type: error
                      code: ERROR_SESSION_INVALID
                      name: Sorry
                      description: Invalid authentication
          headers: {}
          x-apidog-name: Unauthorized
        '422':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                  message: &ref_0
                    $ref: '#/components/schemas/ResponseEnvelopMessage'
                required:
                  - status
                  - message
                x-apidog-orders:
                  - status
                  - message
                x-apidog-ignore-properties: []
              example:
                status: validation_error
                message:
                  type: validation_errors
                  code: ERROR_POPUP_OK
                  name: Inputs
                  description: Input errors!
                  validations:
                    - field: is_standalone_zidship_waybill
                      errors:
                        - >-
                          The is standalone zidship waybill field must be true
                          or false.
          headers: {}
          x-apidog-name: Validation errors
        '500':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    description: Status of the error.
                  message: *ref_0
                required:
                  - status
                  - message
                x-apidog-orders:
                  - status
                  - message
                x-apidog-ignore-properties: []
              example:
                status: error
                message:
                  type: error
                  code: MSG_HIDDEN
                  name: Error
                  description: Internal Server Error
          headers: {}
          x-apidog-name: Internal Server error
      security: []
      x-apidog-folder: Default module/Apps/Merchant APIs/Reverse Orders
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/613905/apis/api-9148652-run
components:
  schemas:
    Reverse-Order-Response:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the order reverse.
          examples:
            - '"0039bc75-472d-4c48-8c82-5e0a6e8eca14"'
        store_id:
          type: string
          description: Identifier for the store associated with the order.
          examples:
            - '"724b67c5-2fca-4813-a4ab-2f77703b2f37"'
        order_id:
          type: integer
          description: ID of the original order being reversed.
          examples:
            - 1
        consignee_name:
          type: string
          description: Name of the consignee who placed the order.
          examples:
            - '"osama"'
        consignee_mobile:
          type: string
          description: Mobile number of the consignee.
          examples:
            - '"966500000005"'
        consignee_city:
          type: object
          description: 'Object containing details about the consignee''s city:'
          properties:
            id:
              type: integer
              description: City ID.
              examples:
                - 1
            country:
              type: object
              description: 'Object containing details about the country:'
              properties:
                id:
                  type: integer
                  description: Country ID.
                  examples:
                    - 183
                name:
                  type: string
                  description: Name of the country.
                  examples:
                    - '"Saudi Arabia"'
              x-apidog-orders:
                - id
                - name
              x-apidog-ignore-properties: []
            ar_name:
              type: string
            en_name:
              type: string
            name:
              type: string
              description: Name of the city
              examples:
                - '"Riyadh"'
            priority:
              type: integer
              description: Priority level of the city.
          x-apidog-orders:
            - id
            - country
            - ar_name
            - en_name
            - name
            - priority
          x-apidog-ignore-properties: []
        consignee_address_1:
          type: string
          description: Address lines of the consignee.
        consignee_address_2:
          type: string
          description: Address lines of the consignee.
        inventory:
          type: object
          description: 'Object containing details about the inventory:'
          properties:
            id:
              type: string
              description: Identifier for the inventory.
              examples:
                - '"5d1bee6c07e543c99a36849fdd6f5773"'
            country:
              type: object
              description: >-
                Object containing details about the country where the inventory
                is located:
              properties:
                id:
                  type: integer
                  description: Country ID
                  examples:
                    - 183
                name:
                  type: object
                  description: Name of the country.
                  properties:
                    ar:
                      type: string
                    en:
                      type: string
                  x-apidog-orders:
                    - ar
                    - en
                  x-apidog-ignore-properties: []
              x-apidog-orders:
                - id
                - name
              x-apidog-ignore-properties: []
            type:
              type: string
              description: Type of inventory
              examples:
                - '"PHYSICAL"'
            coordinates:
              type: object
              description: Geographic coordinates of the inventory location.
              properties:
                type:
                  type: string
                  description: Type of coordinates (Point).
                  examples:
                    - '"Point"'
                coordinates:
                  type: array
                  description: Array containing longitude and latitude coordinates.
                  items:
                    type: number
              x-apidog-orders:
                - type
                - coordinates
              x-apidog-ignore-properties: []
            city_id:
              type: integer
              description: ID of the city where the inventory is located.
              examples:
                - 1
          x-apidog-orders:
            - id
            - country
            - type
            - coordinates
            - city_id
          x-apidog-ignore-properties: []
        reason:
          type: array
          description: Array containing reasons for reversing the order.
          items:
            type: string
            examples:
              - ' "Does not match the description"'
        waybill:
          type: object
          description: >-
            Object containing details about the waybill associated with the
            reverse order:
          properties:
            id:
              type: string
              description: Unique identifier for the waybill.
              examples:
                - '"50e06bb5-2ea7-480d-9e98-961076cf87d7"'
            cost:
              type: integer
              description: Cost associated with the waybill.
              examples:
                - 10
            label:
              type: string
              description: URL to the label for the waybill.
              examples:
                - >-
                  "https:\\/\\/zidship.com\\/labels\\/50e06bb5-2ea7-480d-9e98-961076cf87d7"
            status:
              type: string
              description: Current status of the waybill.
            courier:
              type: string
              description: URL to the courier details for the waybill.
              examples:
                - >-
                  "https:\\/\\/zidship.com\\/labels\\/50e06bb5-2ea7-480d-9e98-961076cf87d7"
            tracking_url:
              type: string
              description: URL for tracking the waybill.
              examples:
                - '"https:\\/\\/zidship.com\\/track\\/24098837-reverse"'
            service_level:
              type: string
              description: Service level for the waybill.
              examples:
                - '"reverse"'
            tracking_number:
              type: string
              description: Tracking number associated with the waybill.
              examples:
                - '"290446207592"'
          x-apidog-orders:
            - id
            - cost
            - label
            - status
            - courier
            - tracking_url
            - service_level
            - tracking_number
          x-apidog-ignore-properties: []
      x-examples:
        Example 1:
          id: 0039bc75-472d-4c48-8c82-5e0a6e8eca14
          store_id: 724b67c5-2fca-4813-a4ab-2f77703b2f37
          order_id: 1
          consignee_name: osama
          consignee_mobile: '966500000005'
          consignee_city:
            id: 1
            country:
              id: 183
              name: Saudi Arabia
            ar_name: string
            en_name: string
            name: Riyadh
            priority: 1
          consignee_address_1: string
          consignee_address_2: string
          inventory_address_id: 0
          inventory:
            id: 5d1bee6c07e543c99a36849fdd6f5773
            country:
              id: 183
              name:
                ar: string
                en: string
            type: PHYSICAL
            coordinates:
              type: Point
              coordinates:
                - 36.5661908
            city_id: 1
          reason:
            - Does not match the description
          waybill:
            id: 50e06bb5-2ea7-480d-9e98-961076cf87d7
            cost: 10
            label: >-
              https:\/\/zidship.com\/labels\/50e06bb5-2ea7-480d-9e98-961076cf87d7
            status: ''
            courier: >-
              https:\/\/zidship.com\/labels\/50e06bb5-2ea7-480d-9e98-961076cf87d7
            tracking_url: https:\/\/zidship.com\/track\/24098837-reverse
            service_level: reverse
            tracking_number: '290446207592'
      x-internal: true
      x-apidog-orders:
        - id
        - store_id
        - order_id
        - consignee_name
        - consignee_mobile
        - consignee_city
        - consignee_address_1
        - consignee_address_2
        - inventory
        - reason
        - waybill
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    ResponseEnvelopMessage:
      type: object
      properties:
        type:
          type: string
          description: Type of response message returned by the API.
          examples:
            - success
        code:
          type: string
          description: Response code returned by the API, if available.
          examples:
            - MSG_POPUP_OK
          nullable: true
        name:
          type: string
          description: Name or title of the response message, if available.
          examples:
            - Coupons
          nullable: true
        description:
          type: string
          description: Detailed description of the response message, if available.
          examples:
            - Coupons created successfully
          nullable: true
      required:
        - type
        - code
        - name
        - description
      description: Additional response metadata.
      x-apidog-orders:
        - type
        - code
        - name
        - description
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
  securitySchemes: {}
servers:
  - url: https://api.zid.sa/
    description: Prod Env
security: []

```
