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

# Import existing customers

> For migrating customers from another affiliate platform. Instead of a click key, each
customer names the affiliate (`affiliateExternalId`) and optionally the tracker
(`externalTrackerId`) they belong to. Sends up to 10,000 customers per request.



## OpenAPI

````yaml https://platform.affelios.com/swagger/v1/swagger.json post /api/v1/customer/import
openapi: 3.0.4
info:
  title: Affelios Platform API
  description: >-
    Send customers and transactions to Affelios, and read your affiliate
    program's data. Authenticate every request with an API key in the X-Api-Key
    header. Create keys in the dashboard under Settings > API keys.
  version: v1
servers:
  - url: https://platform.affelios.com
security:
  - ApiKey: []
tags:
  - name: Affiliates
    description: >-
      Affiliate accounts in your program, their collaborators and their
      commission plan assignments.
  - name: Customers
    description: >-
      Customers referred by affiliates. Create a customer with the click key
      from the landing page to credit the affiliate who referred them.
  - name: Mcp Connection
  - name: Testimonials
    description: Affiliate testimonials and the published list shown on public pages.
  - name: Transactions
    description: >-
      Customer activity such as deposits, revenue and wagering. Commission is
      calculated from transactions.
paths:
  /api/v1/customer/import:
    post:
      tags:
        - Customers
      summary: Import existing customers
      description: >-
        For migrating customers from another affiliate platform. Instead of a
        click key, each

        customer names the affiliate (`affiliateExternalId`) and optionally the
        tracker

        (`externalTrackerId`) they belong to. Sends up to 10,000 customers per
        request.
      operationId: CustomerImportPost
      requestBody:
        description: The customers to import, at most 10,000.
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/AffiliateCustomerImportBody'
              description: Customers to import.
      responses:
        '200':
          description: How many customers were imported, skipped as duplicates, or failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AffiliateCustomerImportResponse'
        '400':
          description: >-
            The list is empty or too long, or a customer has both or neither of
            `brandId` and `externalBrandId`.
        '401':
          description: The X-Api-Key header is missing or the key is not valid.
        '403':
          description: The API key is valid but does not have permission for this endpoint.
components:
  schemas:
    AffiliateCustomerImportBody:
      required:
        - items
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/AffiliateCustomerImportLineItem'
          description: The customers, at most 10,000 per request.
      additionalProperties: false
      description: Customers to import.
    AffiliateCustomerImportResponse:
      type: object
      properties:
        numImported:
          type: integer
          description: Customers created.
          format: int32
        numDuplicates:
          type: integer
          description: >-
            Customers skipped because one with the same external ID already
            exists.
          format: int32
        numFailed:
          type: integer
          description: Customers that could not be created.
          format: int32
        firstFailureId:
          type: string
          description: >-
            The external ID of the last customer that failed. When several fail,
            this may not be the customer `firstFailureMessage` describes.
          nullable: true
        firstFailureMessage:
          type: string
          description: Why the first failed customer was rejected.
          nullable: true
      additionalProperties: false
      description: The result of creating or importing customers in bulk.
    AffiliateCustomerImportLineItem:
      required:
        - affiliateExternalId
        - externalId
        - registrationDate
      type: object
      properties:
        externalId:
          minLength: 1
          type: string
          description: Your unique ID for the customer.
        affiliateExternalId:
          minLength: 1
          type: string
          description: The External ID of the affiliate who referred the customer.
        externalTrackerId:
          type: string
          description: The External ID of the tracker the customer came through, if known.
          nullable: true
        username:
          type: string
          description: A display name for the customer, shown in reports.
          nullable: true
        registrationDate:
          type: string
          description: When the customer registered, in UTC.
          format: date-time
        brandId:
          type: string
          description: >-
            The Affelios ID of the brand. Send this or `externalBrandId`, not
            both.
          nullable: true
        externalBrandId:
          type: string
          description: The External ID of the brand. Send this or `brandId`, not both.
          nullable: true
        country:
          type: string
          description: The customer's country.
          nullable: true
        revShareExcluded:
          type: boolean
          description: When true, the customer earns no revenue share commission.
        cpaExcluded:
          type: boolean
          description: When true, the customer earns no CPA commission.
        category:
          type: string
          description: A category for your own reporting.
          nullable: true
        label:
          type: string
          description: A label for your own reporting.
          nullable: true
        customParameter:
          type: string
          description: >-
            A custom tracking value, such as a sub ID, to store with the
            customer's tracking.
          nullable: true
        referringUrl:
          type: string
          description: The URL the customer was referred from, if known.
          nullable: true
      additionalProperties: false
      description: >-
        A customer to import from another platform, attributed by affiliate
        rather than click key.
  securitySchemes:
    ApiKey:
      type: apiKey
      description: >-
        Your Affelios API key. Create one in the dashboard under Settings > API
        keys.
      name: X-Api-Key
      in: header

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.