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

# Create Product Link



## OpenAPI

````yaml https://app.levanta.io/api/creator/v2/openapi.json post /links
openapi: 3.1.0
info:
  version: 2.0.0
  title: Levanta Creator API v2
  description: >-
    Authorize all requests with an API key in the Authorization header as the
    second token. E.g. Authorization -> "Bearer {api_key}".
servers:
  - url: https://app.levanta.io/api/creator/v2
security: []
externalDocs:
  url: https://app.levanta.io/creator/api-docs
paths:
  /links:
    post:
      tags:
        - Links
      summary: Create Product Link
      operationId: CreatorCreateProductLinkV2
      requestBody:
        description: The product link to create
        content:
          application/json:
            schema:
              type: object
              properties:
                product:
                  type: object
                  properties:
                    primary_id:
                      type: string
                    marketplace:
                      type: string
                      enum:
                        - amazon.com
                        - amazon.com.mx
                        - amazon.co.uk
                        - amazon.ca
                        - amazon.de
                        - amazon.es
                        - amazon.fr
                        - amazon.it
                        - amazon.nl
                        - walmart.com
                        - shopify.com
                      description: >-
                        Represents a Levanta marketplace (ex: amazon.co.uk,
                        walmart.com, shopify.com).
                  required:
                    - primary_id
                    - marketplace
                subid1:
                  type: string
                  minLength: 1
                  maxLength: 256
                  pattern: ^[a-zA-Z0-9-_@./ ]*$
                  description: >-
                    An ID that identifies where the created link will be used.
                    Allowed characters: [a-zA-Z0-9-_@./ ]
                subid2:
                  type: string
                  minLength: 1
                  maxLength: 256
                  pattern: ^[a-zA-Z0-9-_@./ ]*$
                  description: >-
                    An ID that identifies where the created link will be used.
                    Allowed characters: [a-zA-Z0-9-_@./ ]
                sharedid:
                  type: string
                  description: >-
                    Will be added to the link parameters as `sharedid`. NOTE:
                    only supported when product.marketplace is shopify.com,
                    otherwise an 422 error will be thrown.
              required:
                - product
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  type:
                    type: string
                    enum:
                      - product
                      - storefront
                  marketplace:
                    type: string
                    enum:
                      - amazon.com
                      - amazon.com.mx
                      - amazon.co.uk
                      - amazon.ca
                      - amazon.de
                      - amazon.es
                      - amazon.fr
                      - amazon.it
                      - amazon.nl
                      - walmart.com
                      - shopify.com
                    description: The marketplace the link is associated with
                  url:
                    type: string
                  mobileOptimizedUrl:
                    type: string
                required:
                  - id
                  - type
                  - marketplace
                  - url
                  - mobileOptimizedUrl
        '400':
          description: You do not have permission to create a link for this product
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: number
                    enum:
                      - 400
                  message:
                    type: string
                    enum:
                      - >-
                        You do not have permission to create a link for this
                        product
                required:
                  - status
                  - message
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: number
                    enum:
                      - 401
                  message:
                    type: string
                    enum:
                      - Unauthorized
                required:
                  - status
                  - message
        '404':
          description: Product Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: number
                    enum:
                      - 404
                  message:
                    type: string
                    enum:
                      - Product Not Found
                required:
                  - status
                  - message
        '415':
          description: 'Invalid Content Type: Must be "application/json" for post requests'
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: number
                    enum:
                      - 415
                  message:
                    type: string
                    enum:
                      - >-
                        Invalid Content Type: Must be "application/json" for
                        post requests
                required:
                  - status
                  - message
        '422':
          description: Input Validation Failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: number
                    enum:
                      - 422
                  message:
                    type: string
                    enum:
                      - Input Validation Failed
                required:
                  - status
                  - message
      security:
        - Bearer: []
components:
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer

````