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

# Link an Imprint customer and partner customer accounts

> Creates a link between an existing Imprint customer and a partner's customer account. The API key provided with the request will be used to link the partner with the imprint customer.



## OpenAPI

````yaml /api-reference/openapi.yaml post /v2/customers/{customer_id}/link
openapi: 3.1.0
info:
  title: Public Imprint API
  version: '2.0'
servers:
  - url: https://dev.sbx.imprint.co
    description: Imprint public api sandbox
security:
  - basicAuth: []
  - bearerAuth: []
paths:
  /v2/customers/{customer_id}/link:
    post:
      tags:
        - Customer Links
      summary: Link an Imprint customer and partner customer accounts
      description: >-
        Creates a link between an existing Imprint customer and a partner's
        customer account. The API key provided with the request will be used to
        link the partner with the imprint customer.
      operationId: linkCustomerAccount
      parameters:
        - name: customer_id
          in: path
          required: true
          description: The unique identifier for the Imprint customer
          schema:
            type: string
            example: BBB815E9-F654-438D-9AD3-3F7BB8136FC0
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - partner_customer_id
              properties:
                partner_customer_id:
                  $ref: '#/components/schemas/PartnerCustomerId'
                metadata:
                  type: object
                  description: Additional linking metadata
                  additionalProperties: true
                  example:
                    store_id: store_789
                    platform_version: 2.1.0
      responses:
        '200':
          description: Customer accounts linked successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerLink'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvalidRequestError'
        '404':
          description: Customer not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerNotFoundError'
        '409':
          description: Customer already linked
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: object
                    required:
                      - type
                      - message
                    properties:
                      type:
                        type: string
                        enum:
                          - CUSTOMER_ALREADY_LINKED
                      message:
                        type: string
                        example: Customer already linked to a partner account
                      existing_link:
                        $ref: '#/components/schemas/CustomerLink'
components:
  schemas:
    PartnerCustomerId:
      type: string
      description: The unique identifier for the customer in the partner's system
      example: PARTNER_USER_456
    CustomerLink:
      type: object
      required:
        - customer_id
        - partner_customer_id
        - status
        - created_at
      properties:
        customer_id:
          type: string
          example: 9B5E1EE0-2E1C-46E7-81B9-3C3917204BE4
          description: The ID of the Imprint customer
        partner_customer_id:
          $ref: '#/components/schemas/PartnerCustomerId'
        status:
          type: string
          enum:
            - ACTIVE
            - INACTIVE
          example: ACTIVE
          description: Status of the linked relationship
        created_at:
          type: string
          description: the RFC-3339 timestamp when the link was created at.
          example: '2025-02-13T19:08:07.000Z'
        updated_at:
          type: string
          description: the RFC-3339 timestamp when the link was last updated.
          example: '2025-02-13T19:08:07.000Z'
        metadata:
          type: object
          description: Additional linking metadata
          additionalProperties: true
          example:
            store_id: store_789
            platform_version: 2.1.0
    InvalidRequestError:
      type: object
      properties:
        path:
          type: string
          description: The path of the endpoint returning the error
          example: /v2/customers
        details:
          type: array
          items:
            type: string
          description: The details of the error being returned
          example:
            - 'email: must be a well-formed email address'
        error:
          type: string
          description: The category of error being returned
          example: Bad Request
        status:
          type: integer
          description: The HTTP status code of the error
          example: 400
        timestamp:
          type: string
          description: The timestamp that the error occurred
          example: '2025-01-20T18:18:22.923+00:00'
    CustomerNotFoundError:
      type: object
      required:
        - type
        - message
      properties:
        type:
          type: string
          description: The category of error being returned
          example: CUSTOMER_NOT_FOUND_ERROR
        message:
          type: string
          description: A message describing the cause of the error
          example: 'Customer not found for provided ID: CSMR-v1-123'
        param:
          type: string
          description: The param causing the error
          example: customer_id
  securitySchemes:
    bearerAuth:
      bearerFormat: auth-scheme
      description: >-
        Bearer HTTP authentication. Allowed headers-- Authorization: Bearer
        <api_key>
      scheme: bearer
      type: http

````