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

# Create a cart from a checkout link

> Create a cart from a checkout link by its ID

<sup>Required permissions: `cart:write`</sup>



## OpenAPI

````yaml post /checkout-links/{id}/cart
openapi: 3.1.0
info:
  title: Fynn API
  description: ''
  termsOfService: https://www.fynn.eu/tos
  contact:
    name: Fynn UG (haftungsbeschränkt)
    url: https://www.fynn.eu
    email: hi@fynn.eu
  license:
    name: Proprietary
    url: https://www.fynn.eu/license
  version: 0.0.0
servers:
  - url: https://coreapi.io
    description: Production
  - url: https://preview.coreapi.io
    description: Sandbox
security:
  - JWT: []
tags: []
paths:
  /checkout-links/{id}/cart:
    parameters: []
    post:
      tags:
        - CheckoutLink
      summary: Create a cart from a checkout link
      description: |-
        Create a cart from a checkout link by its ID

        <sup>Required permissions: `cart:write`</sup>
      operationId: createCartFromCheckoutLink
      parameters:
        - name: id
          in: path
          description: CheckoutLink identifier
          required: true
          deprecated: false
          schema:
            type: string
          style: simple
          explode: false
      requestBody:
        description: The new CheckoutLink resource
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/CheckoutLink.CreateCartFromCheckoutLinkRequest
          text/html:
            schema:
              $ref: >-
                #/components/schemas/CheckoutLink.CreateCartFromCheckoutLinkRequest
        required: true
      responses:
        '201':
          description: CheckoutLink resource created
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/CheckoutLink.CheckoutLinkCartResponse-CheckoutLinkCartResponse
            text/html:
              schema:
                $ref: >-
                  #/components/schemas/CheckoutLink.CheckoutLinkCartResponse-CheckoutLinkCartResponse
          links: {}
        '400':
          description: Invalid input
        '422':
          description: Unprocessable entity
      deprecated: false
      security:
        - JWT:
            - cart:write
      x-codeSamples:
        - lang: bash
          label: cURL
          source: |-
            curl -X POST \
             /checkout-links/{id}/cart \
             --header "Content-Type: application/json" \
             --header "Authorization: Bearer <token>" \
             --data '{
                "customerId": "ad7f7b7d-7b7d-7b7d-7b7d-7b7d-7b7d7b7d7b7d",
                "metadata": [
                    ""
                ]
            }'
components:
  schemas:
    CheckoutLink.CreateCartFromCheckoutLinkRequest:
      type: object
      description: ''
      deprecated: false
      properties:
        customerId:
          description: >-
            The ID of the customer which should be pre-authenticated for the
            cart. The receiver of the cart link can see and select the customers
            payment methods and addresses. If the customer is not provided, the
            cart will be anonymous.
          example: ad7f7b7d-7b7d-7b7d-7b7d-7b7d-7b7d7b7d7b7d
          type:
            - string
            - 'null'
        metadata:
          description: >-
            A collection of key-value pairs that can be linked to an object.
            This feature is beneficial for storing extra details regarding the
            object in an organized manner. To remove all keys, simply submit an
            empty value to the metadata. The metadata is shown in webhooks and
            api responses.
          example:
            key: value
          type: array
          items:
            type: string
    CheckoutLink.CheckoutLinkCartResponse-CheckoutLinkCartResponse:
      type: object
      description: ''
      deprecated: false
      properties:
        cartId:
          description: The ID of the cart
          example: ad7f7b7d-7b7d-7b7d-7b7d-7b7d7b7d7b7d
          type: string
        customerId:
          description: The ID of the customer.
          example: ad7f7b7d-7b7d-7b7d-7b7d-7b7d7b7d7b7d
          type:
            - string
            - 'null'
        url:
          description: The public URL to the cart
          example: https://example.com/cart/123
          type: string
  securitySchemes:
    JWT:
      type: http
      scheme: bearer

````