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

# Migrate events

> Migrate events from an old system to Masivo



## OpenAPI

````yaml POST /customers/migrate/events
openapi: 3.0.1
info:
  title: Masivo's REST API
  description: Learn how to use Masivo's REST API
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://app.masivo.ai/api/storefront/v1
security:
  - bearerAuth: []
paths:
  /customers/migrate/events:
    post:
      description: Migrate events from an old system to Masivo
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - customers
              properties:
                customers:
                  type: array
                  minimum: 1
                  maximum: 1000
                  items:
                    $ref: '#/components/schemas/CustomerWithEvent'
            example: {}
        required: true
      responses:
        '201':
          description: Customer events enqueued successfully
        '422':
          description: Invalid customer entry
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    CustomerWithEvent:
      type: object
      required:
        - id
        - events
      properties:
        id:
          type: string
          description: Your customer unique identifier
        events:
          type: array
          items:
            $ref: '#/components/schemas/MigratedEvent'
    Error:
      required:
        - error
        - details
      type: object
      properties:
        error:
          type: string
        details:
          type: string
    MigratedEvent:
      type: object
      required:
        - type
        - order
        - fulfilled
        - issued_at
        - resolved_at
        - brand_id
      properties:
        type:
          type: string
          description: The type of the event
          example: PURCHASE
        channel_id:
          type: string
          description: The channel id of the event
          nullable: true
        store_id:
          type: string
          description: The store id of the event
          nullable: true
        brand_id:
          type: string
          description: The brand id of the event
          nullable: true
        order:
          $ref: '#/components/schemas/Order'
        fulfilled:
          type: boolean
          description: If the event was fulfilled.
        issued_at:
          type: string
          description: The date when the event was issued
          format: date-time
        resolved_at:
          type: string
          description: The date when the event was resolved
          format: date-time
          nullable: true
    Order:
      type: object
      required:
        - purchase_id
        - value
        - discounted_value
        - products
        - payment_method
      properties:
        purchase_id:
          type: string
          description: The id of a placed order in your system
        channel_id:
          type: string
          description: The channel unique identifier in your system
        store_id:
          type: string
          description: The store unique identifier in your system
        value:
          type: number
          description: The order total or subtotal
          example: 20.95
        discounted_value:
          type: number
          description: The order total or subtotal after discounts
          example: 10.95
        products:
          type: array
          minimum: 1
          items:
            $ref: '#/components/schemas/OrderProduct'
        shipping:
          $ref: '#/components/schemas/Shipping'
          description: The shipping information of the order
        payment_method:
          type: string
          description: The payment method used in the order
          enum:
            - CREDIT
            - DEBIT
            - CASH
            - BANK_TRANSFER
            - OTHER
        redeem:
          type: array
          description: The rewards to redeem in the order
          items:
            $ref: '#/components/schemas/RedemptionReward'
        metadata:
          type: object
          description: The metadata of the order
    OrderProduct:
      type: object
      required:
        - sku
        - amount
        - value
      properties:
        sku:
          type: string
          description: The product sku
        amount:
          type: number
          description: The quantity of the product
        value:
          type: number
          description: The total or subtotal of the product
        discounted_value:
          type: number
          description: The total or subtotal of the product after discounts
        redeem:
          type: array
          description: The rewards to redeem in the product
          items:
            $ref: '#/components/schemas/RedemptionReward'
        tags:
          type: object
          description: Include your conditions event tags here
        metadata:
          type: object
          description: Include any additional info here
    Shipping:
      type: object
      properties:
        value:
          type: number
          description: The shipping cost
          example: 3.25
        discounted_value:
          type: number
          description: The shipping cost after discounts
          example: 2.25
        redeem:
          type: array
          description: The rewards to redeem in the shipping
          items:
            $ref: '#/components/schemas/RedemptionReward'
        tags:
          type: object
          description: Include your conditions event tags here
        metadata:
          type: object
          description: Include any additional info here
    RedemptionReward:
      type: object
      properties:
        id:
          type: string
          description: The reward id to redeem
          format: uuid
        amount:
          type: number
          description: The amount of the reward to redeem. (Per product if applicable)
          example: 1
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````