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

# Save a new cart reference

> Save an external cart ID for the authenticated user so it can be resumed later.



## OpenAPI

````yaml /swagger/auth-api.json post /api/v1/{app_id}/carts
openapi: 3.0.0
info:
  contact:
    email: support@enad.io
    name: API support
    url: http://enad.io/support
  description: This is the documentation for Auth API v1
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  termsOfService: http://enad.io/terms/
  title: Public API
  version: '1.0'
servers:
  - url: //customers.enad.io
security: []
paths:
  /api/v1/{app_id}/carts:
    post:
      tags:
        - Cart
      summary: Save a new cart reference
      description: >-
        Save an external cart ID for the authenticated user so it can be resumed
        later.
      parameters:
        - description: UUID of the app
          in: path
          name: app_id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/github_com_enadhq_koopa-key_internal_pkg_server_models.CreateCartRequest
        description: Cart creation data
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github_com_enadhq_koopa-key_internal_pkg_server_models.CartResponse
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github_com_enadhq_koopa-key_internal_pkg_server_web.ErrorMessage
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github_com_enadhq_koopa-key_internal_pkg_server_web.ErrorMessage
        '409':
          description: Duplicate cart
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github_com_enadhq_koopa-key_internal_pkg_server_web.ErrorMessage
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github_com_enadhq_koopa-key_internal_pkg_server_web.ErrorMessage
      security:
        - Bearer: []
components:
  schemas:
    github_com_enadhq_koopa-key_internal_pkg_server_models.CreateCartRequest:
      properties:
        cart_id:
          type: string
        source:
          type: string
      required:
        - cart_id
        - source
      type: object
    github_com_enadhq_koopa-key_internal_pkg_server_models.CartResponse:
      properties:
        cart_id:
          type: string
        created_at:
          type: string
        id:
          type: string
        source:
          type: string
        updated_at:
          type: string
      type: object
    github_com_enadhq_koopa-key_internal_pkg_server_web.ErrorMessage:
      properties:
        details:
          items:
            type: string
          type: array
        message:
          type: string
        success:
          type: boolean
      type: object

````