> ## 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

> Create a deep link URL.
Depending on a shop's settings, the `zip` value could be an email, phone number, or postal
code. All use the key `zip`.

### Required API key scope
- Orders




## OpenAPI

````yaml post /order/link
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/link:
    post:
      tags:
        - Return Actions
      summary: Create Return Deep Link
      description: >
        Create a deep link URL.

        Depending on a shop's settings, the `zip` value could be an email, phone
        number, or postal

        code. All use the key `zip`.


        ### Required API key scope

        - Orders
      operationId: createReturnDeepLink
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeeplinkCreationRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeeplinkCreationResponse'
        '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:
    DeeplinkCreationRequest:
      type: object
      required:
        - name
        - zip
      properties:
        name:
          type: string
          examples:
            - Shopify Order Name
          description: The name of the order in the commerce provider (e.g. Shopify).
        zip:
          type: string
          examples:
            - '43215'
          description: >
            The order detail used to identify the order. Often the customer's
            shipping ZIP code, but depending on the

            merchant's shop settings, could also be the customer's email or
            phone number.
        gift:
          type: boolean
          examples:
            - false
          description: >
            Whether or not the return will use Loop's Gift flow. For details,
            see

            [Gift Returns](https://help.loopreturns.com/en/articles/1911041).
    DeeplinkCreationResponse:
      type: object
      properties:
        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

````