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

# Migrate customers

> Migrate a customer from an old system to Fire spark



## OpenAPI

````yaml POST /customers/migrate
openapi: 3.0.1
info:
  title: Fire spark Admin API
  description: Back-office and merchant operations endpoints for Fire spark.
  version: 1.0.0
servers:
  - url: https://firespark.cloud/api/admin/v1
security:
  - bearerAuth: []
paths:
  /customers/migrate:
    post:
      summary: Migrate customers
      description: Migrate a customer from an old system to Fire spark
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - customers
              properties:
                customers:
                  type: array
                  minimum: 1
                  maximum: 1000
                  items:
                    $ref: '#/components/schemas/CustomerWithBalance'
      responses:
        '201':
          description: Customers batch enqueued successfully
        '422':
          description: Invalid customer entry
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    CustomerWithBalance:
      type: object
      required:
        - balance
        - id
        - name
        - email
        - registration_date
      properties:
        id:
          type: string
          description: Your customer unique identifier
        platforms:
          type: array
          description: Platforms associated with the customer
          items:
            type: string
          nullable: true
        name:
          description: The full name of the customer
          type: string
          example: John Smith
        email:
          description: The email of the customer
          type: string
          format: email
        gender:
          description: The gender of the customer
          type: string
          nullable: true
          enum:
            - MALE
            - FEMALE
        dob:
          description: The date of birth of the customer
          type: string
          nullable: true
          format: date-time
        document_type:
          description: >-
            The document type of the customer. If provided, document_number is
            required.
          type: string
          nullable: true
        document_number:
          description: >-
            The document number of the customer. If provided, document_type is
            required.
          type: string
          nullable: true
          maxLength: 50
        country:
          description: The country of the customer
          type: string
          nullable: true
          maxLength: 100
        registration_date:
          description: The date when the customer was registered
          type: string
          format: date-time
        metrics:
          $ref: '#/components/schemas/CustomerMetrics'
          type: object
          description: The metrics of the customer
        balance:
          type: array
          description: The starting wallet items of the new customer
          items:
            $ref: '#/components/schemas/BalanceItem'
        devices:
          type: array
          description: The devices of the customer
          items:
            $ref: '#/components/schemas/Device'
        tags:
          type: object
          description: Include your conditions customer tags here
        status:
          description: The status of the customer
          type: string
          enum:
            - ACTIVE
            - INACTIVE
        metadata:
          description: The metadata of the customer
          type: object
    Error:
      required:
        - error
        - details
      type: object
      properties:
        error:
          type: string
        details:
          type: string
    CustomerMetrics:
      type: object
      description: >-
        Aggregated customer engagement metrics. Not returned on Storefront
        customer responses.
      properties:
        topProducts:
          type: array
          description: Recently interacted products for this customer
          default: []
          items:
            type: object
            required:
              - timestamp
              - product_id
              - category_id
            properties:
              timestamp:
                type: string
                format: date-time
              product_id:
                type: string
                minLength: 1
                maxLength: 64
                pattern: ^[a-zA-Z0-9_-]+$
              category_id:
                type: string
                nullable: true
                minLength: 1
                maxLength: 64
                pattern: ^[a-zA-Z0-9_-]+$
    BalanceItem:
      type: object
      required:
        - reward_id
        - amount
        - expiration_date
        - brand_id
      properties:
        reward_id:
          type: string
          description: The reward id of the balance item
          format: uuid
        amount:
          type: number
          description: The amount of the balance item
        expiration_date:
          type: string
          description: The expiration date of the balance item. Null if amount is 0.
          format: date-time
          nullable: true
        brand_id:
          type: string
          description: The id of the brand that owns the reward of this balance item.
          nullable: true
        channel_id:
          type: string
          description: The id of the channel that owns the reward of this balance item.
          nullable: true
        store_id:
          type: string
          description: The id of the store that owns the reward of this balance item.
          nullable: true
        issued_at:
          type: string
          description: >-
            The date when the balance item was originally issued. Defaults to
            right now.
          format: date-time
        funded_by:
          type: string
          description: Who funded the rewards used in this balance item
    Device:
      type: object
      properties:
        device_token:
          type: string
          description: The unique token that identifies the device
        device_info:
          type: object
          description: Optional information about the device
          properties:
            platform:
              type: string
              enum:
                - ios
                - android
                - web
                - windows
                - macos
              description: The platform of the device
            model:
              type: string
              description: The model of the device
            osVersion:
              type: string
              description: The operating system version of the device
        expires_at:
          type: string
          format: date-time
          description: The date when the device token expires
        created_at:
          type: string
          format: date-time
          description: The date when the device was registered
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````