> ## 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.

# Imports affiliate items.



## OpenAPI

````yaml https://platform.affelios.com/swagger/v1/swagger.json post /api/v1/affiliate/import
openapi: 3.0.4
info:
  title: Affelios Platform API
  version: v1
servers: []
security:
  - Bearer: []
paths:
  /api/v1/affiliate/import:
    post:
      tags:
        - Affiliate
      summary: Imports affiliate items.
      operationId: AffiliateImportPost
      parameters:
        - name: X-Api-Key
          in: header
          schema:
            type: string
      requestBody:
        description: Affiliate items.
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/AffiliateImportBody'
          text/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/AffiliateImportBody'
          application/*+json:
            schema:
              allOf:
                - $ref: '#/components/schemas/AffiliateImportBody'
      responses:
        '200':
          description: OK
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/AffiliateImportResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/AffiliateImportResponse'
            text/json:
              schema:
                $ref: '#/components/schemas/AffiliateImportResponse'
components:
  schemas:
    AffiliateImportBody:
      required:
        - items
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/AffiliateImportLineItem'
      additionalProperties: false
    AffiliateImportResponse:
      type: object
      properties:
        numImported:
          type: integer
          format: int32
        numDuplicates:
          type: integer
          format: int32
        numFailed:
          type: integer
          format: int32
        firstFailureId:
          type: string
          nullable: true
        firstFailureMessage:
          type: string
          nullable: true
      additionalProperties: false
    AffiliateImportLineItem:
      required:
        - balance
        - email
        - externalId
        - name
        - paid
        - username
      type: object
      properties:
        externalId:
          minLength: 1
          type: string
        email:
          minLength: 1
          type: string
        username:
          minLength: 1
          type: string
        name:
          minLength: 1
          type: string
        website:
          type: string
          nullable: true
        companyName:
          type: string
          nullable: true
        companyNumber:
          type: string
          nullable: true
        addressLine1:
          type: string
          nullable: true
        addressLine2:
          type: string
          nullable: true
        city:
          type: string
          nullable: true
        region:
          type: string
          nullable: true
        country:
          type: string
          nullable: true
        postcode:
          type: string
          nullable: true
        balance:
          type: number
          format: double
        paid:
          type: number
          format: double
      additionalProperties: false
  securitySchemes:
    Bearer:
      type: apiKey
      description: >-
        JWT Authorization header using the Bearer scheme. Example:
        "Authorization: Bearer {token}"
      name: Authorization
      in: header

````