> ## Documentation Index
> Fetch the complete documentation index at: https://docs.loopreturns.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Return Deep Link with QR Code

> Generate a link to a QR code image file that,
when scanned, will take the user directly to their order in Loop so
they can initiate a return without requiring them to enter their order information.

The deep link URL is also returned. If `type` is not included in the request, or is a non-supported format, a
`png` will be returned.

### Required API key scope
- Orders




## OpenAPI

````yaml post /order/qr
openapi: 3.1.0
info:
  title: Returns API
  version: v1
  description: API used for performing operations on returns.
servers:
  - url: https://api.loopreturns.com/api/v1
security: []
tags:
  - name: Return Actions
  - name: Return Data
paths:
  /order/qr:
    post:
      tags:
        - Return Actions
      summary: Create Return Deep Link with QR Code
      description: >
        Generate a link to a QR code image file that,

        when scanned, will take the user directly to their order in Loop so

        they can initiate a return without requiring them to enter their order
        information.


        The deep link URL is also returned. If `type` is not included in the
        request, or is a non-supported format, a

        `png` will be returned.


        ### Required API key scope

        - Orders
      operationId: createReturnDeepLinkWithQrCode
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QrCreationRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QrCreationResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/BadRequestWithErrorCode'
                  - $ref: '#/components/schemas/OrderNotAvailableResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MissingOrderFieldsResponse'
      security:
        - api_key: []
components:
  schemas:
    QrCreationRequest:
      type: object
      required:
        - name
        - zip
      properties:
        name:
          type: string
          examples:
            - Shopify Order Name
        zip:
          type: string
          examples:
            - '43215'
        gift:
          type: boolean
          examples:
            - false
        type:
          type: string
          enum:
            - png
            - eps
            - svg
          examples:
            - png
        size:
          type: integer
          examples:
            - 250
    QrCreationResponse:
      type: object
      properties:
        qr:
          type: string
          examples:
            - https://api.loopreturns.com/api/v1/qr/i/example-uuid-for-qr-image
        deeplink_url:
          type: string
          examples:
            - https://test-shop.loopreturns.com/#/link/examp1e-uu1d-h3r3
    BadRequestWithErrorCode:
      type: object
      description: >-
        Bad-request error where `errors` is an array of message strings (for
        example, the order could not be loaded or a deep link could not be
        created).
      properties:
        errors:
          type: array
          items:
            type: string
          examples:
            - - errorCode1
    OrderNotAvailableResponse:
      type: object
      description: >-
        Returned with HTTP 400 when the order exists but is not available for
        return (for example, it is blocklisted). Here `errors` is an object with
        a message and an error code.
      properties:
        errors:
          type: object
          properties:
            message:
              type: string
              examples:
                - This order is not available for return.
            code:
              type: string
              examples:
                - NOT_AUTHORIZED
    MissingOrderFieldsResponse:
      type: object
      description: >-
        Returned with HTTP 422 by /order/link and /order/qr when the required
        order-lookup fields (`name` and `zip`) are missing. The submitted lookup
        fields are echoed back under `data`.
      properties:
        errors:
          type: object
          properties:
            message:
              type: string
              examples:
                - Missing fields - "name" and "zip" are required.
        data:
          type: object
          properties:
            name:
              type:
                - string
                - 'null'
            zip:
              type:
                - string
                - 'null'
            size:
              type:
                - integer
                - 'null'
            type:
              type:
                - string
                - 'null'
            gift:
              type:
                - boolean
                - 'null'
  responses:
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            type: object
            required:
              - errors
            properties:
              errors:
                type: string
                examples:
                  - Unauthorized.
  securitySchemes:
    api_key:
      type: apiKey
      name: X-Authorization
      in: header

````