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

# Customer transactions

> Get transactions of a customer. By default it returns the transactions of the last 3 months.



## OpenAPI

````yaml GET /customers/{id}/transactions
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/{id}/transactions:
    get:
      description: >-
        Get transactions of a customer. By default it returns the transactions
        of the last 3 months.
      parameters:
        - in: path
          name: id
          description: The customer unique identifier in your system
          required: true
          schema:
            type: string
        - in: query
          name: year
          description: The year to filter transactions
          schema:
            type: number
            minimum: 2020
        - in: query
          name: brand_id
          description: The brand id to filter transactions
          schema:
            type: string
        - in: query
          name: reward_id
          description: The reward id to filter transactions
          schema:
            type: string
            format: uuid
        - in: query
          name: type
          description: The transaction type to filter transactions
          schema:
            type: string
            enum:
              - ACCUMULATION
              - REDEMPTION
              - EXPIRATION
              - MIGRATION
              - TRANSFER
              - REVERSAL
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Transaction'
        '404':
          description: Customer not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Transaction:
      type: object
      properties:
        id:
          type: string
          description: The transaction internal unique identifier
          format: uuid
        brand_id:
          type: string
          description: The brand id of the transaction
          nullable: true
        event_id:
          type: string
          description: The id of the event the created the transaction
          format: uuid
          nullable: true
        campaign_id:
          type: string
          description: The id of the campaign that created the transaction
          format: uuid
          nullable: true
        channel_id:
          type: string
          description: The id of the channel that created the transaction
          format: uuid
          nullable: true
        store_id:
          type: string
          description: The id of the store that created the transaction
          format: uuid
          nullable: true
        funded_by:
          type: string
          description: Who funded the rewards used in this transaction
          nullable: true
          example: MARKETING
        event_type:
          type: string
          description: The type of the event that created the transaction
          example: PURCHASE
        reward_type:
          type: string
          description: The type of the reward used in the transaction
          enum:
            - POINTS
            - DISCOUNT
            - GIFT_CARD
            - PRODUCT
        reward_id:
          type: string
          description: The reward id of the transaction
          format: uuid
        amount:
          type: number
          description: The amount of the transaction
        cost:
          type: number
          description: The cost of the rewards used in the transaction
          nullable: true
        details:
          type: string
          description: The explanation of why transaction was created
        type:
          type: string
          description: The type of the transaction
          enum:
            - ACCUMULATION
            - REDEMPTION
            - EXPIRATION
            - MIGRATION
            - TRANSFER
            - REVERSAL
        receiver_id:
          type: string
          description: The receiver id of the transaction
        sender_id:
          type: string
          description: The sender id of the transaction
        created_at:
          type: string
          description: The date when the transaction was created
          format: date-time
        issued_at:
          type: string
          description: The date when the transaction was issued
          format: date-time
        attributes:
          type: object
          description: The attributes of the transaction
          required:
            - line
          properties:
            line:
              $ref: '#/components/schemas/Line'
              description: The line used to create the transaction
              nullable: true
            campaign_name:
              type: string
              description: The name of the campaign that created the transaction
        metadata:
          type: object
          description: The metadata of the transaction
    Error:
      required:
        - error
        - details
      type: object
      properties:
        error:
          type: string
        details:
          type: string
    Line:
      type: object
      properties:
        amount:
          type: number
          description: The amount of the line
        reward_id:
          type: string
          description: The reward id of the line
          format: uuid
        campaign_id:
          type: string
          description: The campaign id of the line
          format: uuid
          nullable: true
        brand_id:
          type: string
          description: The id of the brand that originated the line
          format: uuid
          nullable: true
        issued_at:
          type: string
          description: The date when the line was issued
          format: date-time
        expiration_date:
          type: string
          description: The expiration date of the line
          format: date-time
        reservation_expires_at:
          type: string
          description: The reservation expiration date of the line
          format: date-time
          nullable: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````