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

# Export Loyalty Card Transactions with campaign ID

> Export transactions that are associated with point movements on a loyalty card.

| **Field** | **Definition** | **Example Export** |
|:---|:---|:---|
| id | Unique transaction ID assigned by Voucherify. | vtx_0cb7811f1c07765800 |
| type | Transaction type. | - `POINTS_EXPIRATION` <br /> - `POINTS_ADDITION` <br /> - `POINTS_REMOVAL` <br /> - `POINTS_TRANSFER_OUT` <br /> - `POINTS_ACCRUAL` <br /> - `POINTS_REFUND` <br /> - `POINTS_REDEMPTION` |
| source_id | Custom source ID of the transaction if one was included originally. | source_id_custom |
| reason | Contains the reason for the transaction if one was included originally. |  |
| balance | The loyalty card balance after the transaction. |  |
| amount | The amount of loyalty points being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. |  |
| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z  |
| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |
| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |
| source|  Channel through which the transaction was initiated. | - `API` <br /> - `voucherify-web-ui` <br /> - `Automation` |
| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |
| related_transaction_id | Unique transaction ID related to a receiver/donor card in the case of a points transfer from/to another card. | vtx_0c9afe802593b34b80 |



## OpenAPI

````yaml /openapi/loyalties.json post /v1/loyalties/{campaignId}/members/{memberId}/transactions/export
openapi: 3.0.1
info:
  title: Voucherify API - Loyalties
  version: v2018-08-01
  description: >-
    Voucherify promotion engine REST API. Please see
    https://docs.voucherify.io/docs for more details.
  contact:
    name: Voucherify Team
    url: https://www.voucherify.io/contact-support
    email: support@voucherify.io
  termsOfService: https://www.voucherify.io/legal/subscription-agreement
  license:
    name: MIT
    url: https://github.com/voucherifyio/voucherify-js-sdk/blob/main/LICENSE
servers:
  - url: https://{cluster}.voucherify.io
    description: Base URL
    variables:
      cluster:
        default: api
        enum:
          - api
          - us1.api
          - as1.api
          - download
          - us1.download
          - as1.download
security: []
paths:
  /v1/loyalties/{campaignId}/members/{memberId}/transactions/export:
    parameters:
      - schema:
          $ref: '#/components/schemas/ParameterCampaignId'
        name: campaignId
        in: path
        required: true
        description: >-
          A unique identifier of the loyalty campaign containing the voucher
          whose transactions you would like to export.
      - schema:
          $ref: '#/components/schemas/ParameterMemberId'
        name: memberId
        in: path
        required: true
        description: >-
          A unique code identifying the loyalty card that you are looking to
          export transaction data for.
    post:
      tags:
        - Loyalties
      summary: Export Loyalty Card Transactions with campaign ID
      description: >-
        Export transactions that are associated with point movements on a
        loyalty card.


        | **Field** | **Definition** | **Example Export** |

        |:---|:---|:---|

        | id | Unique transaction ID assigned by Voucherify. |
        vtx_0cb7811f1c07765800 |

        | type | Transaction type. | - `POINTS_EXPIRATION` <br /> -
        `POINTS_ADDITION` <br /> - `POINTS_REMOVAL` <br /> -
        `POINTS_TRANSFER_OUT` <br /> - `POINTS_ACCRUAL` <br /> - `POINTS_REFUND`
        <br /> - `POINTS_REDEMPTION` |

        | source_id | Custom source ID of the transaction if one was included
        originally. | source_id_custom |

        | reason | Contains the reason for the transaction if one was included
        originally. |  |

        | balance | The loyalty card balance after the transaction. |  |

        | amount | The amount of loyalty points being allocated during the
        transaction. This value can either be negative or positive depending on
        the nature of the transaction. |  |

        | created_at | Timestamp in ISO 8601 format representing the date and
        time when the transaction was created. | 2022-03-09T09:16:32.521Z  |

        | voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |

        | campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |

        | source|  Channel through which the transaction was initiated. | -
        `API` <br /> - `voucherify-web-ui` <br /> - `Automation` |

        | details | More detailed information stored in the form of a JSON. |
        Provides more details related to the transaction in the form of an
        object. |

        | related_transaction_id | Unique transaction ID related to a
        receiver/donor card in the case of a points transfer from/to another
        card. | vtx_0c9afe802593b34b80 |
      operationId: export-loyalty-card-transactions-1
      parameters: []
      requestBody:
        description: Specify the parameters and filters for the transaction export.
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/LoyaltiesMembersTransactionsExportCreateRequestBody
            examples:
              Example:
                value:
                  parameters:
                    order: '-created_at'
                    fields:
                      - id
                      - type
                      - source_id
                      - reason
                      - balance
                      - amount
                      - created_at
                      - voucher_id
                      - campaign_id
                      - details
                      - related_transaction_id
        required: true
      responses:
        '200':
          description: Returns an export object.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/LoyaltiesMembersTransactionsExportCreateResponseBody
              examples:
                Example:
                  value:
                    id: exp_8Fwd6Z8NS67ZH314KRtm5xXE
                    object: export
                    created_at: '2023-03-21T13:50:43.286Z'
                    status: SCHEDULED
                    channel: API
                    exported_object: voucher_transactions
                    parameters:
                      order: '-created_at'
                      fields:
                        - id
                        - type
                        - source_id
                        - reason
                        - balance
                        - amount
                        - created_at
                        - voucher_id
                        - campaign_id
                        - details
                        - related_transaction_id
                      filters:
                        voucher_id:
                          conditions:
                            $in:
                              - LOYALTY-CARD-2IAoDNF
                    result: null
                    user_id: null
                No request body:
                  value:
                    id: exp_ExEE5A6OIK4tssuNswr5O6SU
                    object: export
                    created_at: '2023-03-21T13:34:57.034Z'
                    status: SCHEDULED
                    channel: API
                    exported_object: voucher_transactions
                    parameters:
                      filters:
                        voucher_id:
                          conditions:
                            $in:
                              - HRwc0oHz
                    result: null
                    user_id: null
        '404':
          description: >-
            Returns an error if the voucher code does not exist or has been
            deleted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                Not Found:
                  value:
                    code: 404
                    key: not_found
                    message: Resource not found
                    details: Cannot find voucher with id IrKORhS
                    request_id: v-0a96cd820301c0483a
                    resource_id: IrKORhS
                    resource_type: voucher
      security:
        - X-App-Id: []
          X-App-Token: []
        - X-Voucherify-OAuth:
            - api
            - loyalties
components:
  schemas:
    ParameterCampaignId:
      type: string
      example: camp_rRsfatlwN7unSeUIJDCYedal
    ParameterMemberId:
      type: string
      example: MmFAzfDe
    LoyaltiesMembersTransactionsExportCreateRequestBody:
      title: Loyalties Members Transactions Export Create Request Body
      description: >-
        Request body schema for **POST**
        `v1/loyalties/members/{memberId}/transactions/export` and for **POST**
        `v1/loyalties/{campaignId}/members/{memberId}/transactions/export`.
      type: object
      properties:
        parameters:
          type: object
          properties:
            order:
              description: >-
                How the export is filtered, where the dash - preceding a sorting
                option means sorting in a descending order.
              allOf:
                - $ref: '#/components/schemas/ExportVoucherTransactionsOrder'
            fields:
              type: array
              description: >-
                Array of strings containing the data in the export. These fields
                define the headers in the CSV file.
              items:
                $ref: '#/components/schemas/ExportVoucherTransactionsFields'
            filters:
              description: Filter conditions.
              allOf:
                - $ref: '#/components/schemas/ExportVoucherTransactionsFilters'
          description: >-
            List of available fields and filters that can be exported with an
            order along with the sorting order of the returned data.
    LoyaltiesMembersTransactionsExportCreateResponseBody:
      title: Loyalties Members Transactions Export Create Response Body
      description: >-
        Response body schema for **POST**
        `v1/loyalties/members/{memberId}/transactions/export` and for **POST**
        `v1/loyalties/{campaignId}/members/{memberId}/transactions/export`.
      allOf:
        - $ref: '#/components/schemas/ExportVoucherTransactionsScheduled'
    Error:
      title: Error Object
      type: object
      description: Error details
      properties:
        code:
          type: integer
          description: Error's HTTP status code.
        key:
          type: string
          description: Short string describing the kind of error which occurred.
        message:
          type: string
          description: A human-readable message providing a short description of the error.
        details:
          type: string
          description: A human-readable message providing more details about the error.
        request_id:
          type: string
          example: v-0a885062c80375740f
          description: >-
            This ID is useful when troubleshooting and/or finding the root cause
            of an error response by our support team.
        resource_id:
          type: string
          description: >-
            Unique resource ID that can be used in another endpoint to get more
            details.
          example: rf_0c5d710a87c8a31f86
        resource_type:
          type: string
          description: The resource type.
          example: voucher
        error:
          type: object
          description: Includes additional information about the error.
          properties:
            message:
              type: string
              description: The message configured by the user in a validation rule.
      required:
        - code
        - message
    ExportVoucherTransactionsOrder:
      title: Export Voucher Transactions Order
      type: string
      enum:
        - '-created_at'
        - created_at
    ExportVoucherTransactionsFields:
      title: Export Voucher Transactions Fields
      type: string
      enum:
        - id
        - campaign_id
        - voucher_id
        - type
        - source_id
        - reason
        - source
        - balance
        - amount
        - related_transaction_id
        - created_at
        - details
    ExportVoucherTransactionsFilters:
      title: Export Voucher Transactions Filters
      type: object
      properties:
        junction:
          $ref: '#/components/schemas/Junction'
        created_at:
          $ref: '#/components/schemas/FieldConditions'
        voucher_id:
          $ref: '#/components/schemas/FieldConditions'
        campaign_id:
          $ref: '#/components/schemas/FieldConditions'
    ExportVoucherTransactionsScheduled:
      title: Export Vouchers Transactions Scheduled
      type: object
      allOf:
        - $ref: '#/components/schemas/ExportScheduledBase'
        - $ref: '#/components/schemas/ExportVoucherTransactionsBase'
    Junction:
      title: Junction
      description: >-
        Logical Operator Between Filters. Filter by conditions set on the
        `junction` parameter indicating how the `conditions` should be accounted
        for in the query. An `AND` is an all-inclusive logical operator, meaning
        the `AND` operator displays a record if **ALL** the conditions separated
        by AND are TRUE, while  an `OR` operator displays a record if **ANY** of
        the conditions separated by OR is TRUE.
      enum:
        - and
        - or
      type: string
    FieldConditions:
      title: Field Conditions
      type: object
      properties:
        conditions:
          description: >-
            Data filters used to narrow down the data records to be returned in
            the result.
          allOf:
            - $ref: '#/components/schemas/FiltersCondition'
    ExportScheduledBase:
      title: Export Scheduled Base
      type: object
      properties:
        id:
          type: string
          description: Unique export ID.
        object:
          type: string
          default: export
          enum:
            - export
          description: >-
            The type of object being represented. This object stores information
            about the export.
        created_at:
          type: string
          format: date-time
          description: >-
            Timestamp representing the date and time when the export was
            scheduled in ISO 8601 format.
        status:
          type: string
          description: >-
            Status of the export. Informs you whether the export has already
            been completed, i.e. indicates whether the file containing the
            exported data has been generated.
          default: SCHEDULED
          enum:
            - SCHEDULED
        channel:
          type: string
          description: The channel through which the export was triggered.
        result:
          type: object
          nullable: true
          default: null
          description: Contains the URL of the CSV file.
        user_id:
          type: string
          description: >-
            Identifies the specific user who initiated the export through the
            Voucherify Dashboard; returned when the channel value is WEBSITE.
      required:
        - id
        - object
        - created_at
        - status
        - result
        - user_id
    ExportVoucherTransactionsBase:
      title: Export Vouchers Transactions
      type: object
      properties:
        exported_object:
          type: string
          default: voucher_transactions
          enum:
            - voucher_transactions
          description: The type of object to be exported.
        parameters:
          type: object
          properties:
            order:
              description: >-
                How the export is filtered, where the dash - preceding a sorting
                option means sorting in a descending order.
              allOf:
                - $ref: '#/components/schemas/ExportVoucherTransactionsOrder'
            fields:
              type: array
              description: >-
                Array of strings containing the data in the export. These fields
                define the headers in the CSV file.
              items:
                $ref: '#/components/schemas/ExportVoucherTransactionsFields'
            filters:
              description: Filter conditions.
              allOf:
                - $ref: '#/components/schemas/ExportVoucherTransactionsFilters'
          description: >-
            List of available fields and filters that can be exported with an
            order along with the sorting order of the returned data.
      required:
        - exported_object
    FiltersCondition:
      title: Filters Condition
      type: object
      properties:
        $in:
          $ref: '#/components/schemas/Any'
        $not_in:
          $ref: '#/components/schemas/Any'
        $is:
          $ref: '#/components/schemas/Any'
        $is_days_ago:
          $ref: '#/components/schemas/Any'
        $is_days_in_future:
          $ref: '#/components/schemas/Any'
        $is_not:
          $ref: '#/components/schemas/Any'
        $has_value:
          $ref: '#/components/schemas/Any'
        $is_unknown:
          $ref: '#/components/schemas/Any'
        $contains:
          $ref: '#/components/schemas/Any'
        $not_contain:
          $ref: '#/components/schemas/Any'
        $starts_with:
          $ref: '#/components/schemas/Any'
        $ends_with:
          $ref: '#/components/schemas/Any'
        $more_than:
          $ref: '#/components/schemas/Any'
        $less_than:
          $ref: '#/components/schemas/Any'
        $more_than_ago:
          $ref: '#/components/schemas/Any'
        $less_than_ago:
          $ref: '#/components/schemas/Any'
        $more_than_future:
          $ref: '#/components/schemas/Any'
        $less_than_future:
          $ref: '#/components/schemas/Any'
        $more_than_equal:
          $ref: '#/components/schemas/Any'
        $less_than_equal:
          $ref: '#/components/schemas/Any'
        $after:
          $ref: '#/components/schemas/Any'
        $before:
          $ref: '#/components/schemas/Any'
        $count:
          $ref: '#/components/schemas/Any'
        $count_less:
          $ref: '#/components/schemas/Any'
        $count_more:
          $ref: '#/components/schemas/Any'
    Any:
      title: Any
      type: array
      items:
        oneOf:
          - title: string
            type: string
          - title: string - date
            type: string
            format: date
          - title: string - date-time
            type: string
            format: date-time
          - title: number
            type: number
          - title: object
            type: object
  securitySchemes:
    X-App-Id:
      type: apiKey
      name: X-App-Id
      in: header
    X-App-Token:
      type: apiKey
      name: X-App-Token
      in: header
    X-Voucherify-OAuth:
      type: oauth2
      flows:
        implicit:
          authorizationUrl: https://api.voucherify.io/v1/oauth/token
          scopes:
            api: Gives access to whole server-side API.
            vouchers: >-
              Gives access to all endpoints and methods starting with
              `v1/vouchers`.
            client_api: Gives access to whole client-side API.
            client_vouchers: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/vouchers`.
            promotions: >-
              Gives access to all endpoints and methods starting with
              `/v1/promotions`.
            client_promotions: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/promotions`
            campaigns: >-
              Gives access to all endpoints and methods starting with
              `v1/campaigns`.
            client_publish: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/publish`.
            exports: >-
              Gives access to all endpoints and methods starting with
              `/v1/exports`.
            publications: >-
              Gives access to all endpoints and methods starting with
              `/v1/publications`.
            client_validate: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/validate`.
            validations: >-
              Gives access to all endpoints and methods starting with
              `/v1/validations`.
            client_validations: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/validations`.
            qualifications: >-
              Gives access to all endpoints and methods starting with
              `/v1/qualifications`.
            client_qualifications: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/qualifications`.
            client_redeem: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/redeem
            redemptions: >-
              Gives access to all endpoints and methods starting with
              `/v1/redemptions`.
            client_redemptions: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/redemptions`
            customers: >-
              Gives access to all endpoints and methods starting with
              `/v1/customers`.
            client_customers: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/customers`.
            orders: >-
              Gives access to all endpoints and methods starting with
              `/v1/orders`.
            products: >-
              Gives access to all endpoints and methods starting with
              `/v1/products`.
            skus: >-
              Gives access to all endpoints and methods starting with
              `/v1/SKUs`.
            validation-rules: >-
              Gives access to all endpoints and methods starting with
              `/v1/validation-rules`.
            validation-rules-assignments: >-
              Gives access to all endpoints and methods starting with
              `/v1/validation-rules-assignments
            segments: >-
              Gives access to all endpoints and methods starting with
              `/v1/segments`.
            events: >-
              Gives access to all endpoints and methods starting with
              `/v1/events`.
            client_events: >-
              Gives access to all endpoints and methods starting with
              `client/v1/events`.
            rewards: >-
              Gives access to all endpoints and methods starting with
              `/v1/rewards`.
            assets: >-
              Gives access to all endpoints and methods starting with
              `/v1/assets`.
            task-results: >-
              Gives access to all endpoints and methods starting with
              `/v1/task-results`.
            loyalties: >-
              Gives access to all endpoints and methods starting with
              `/v1/loyalties`.
            client_consents: >-
              Gives access to all endpoints and methods starting with
              `client/v1/consents`.
            consents: >-
              Gives access to all endpoints and methods starting with
              `/v1/consents`.
            async-actions: >-
              Gives access to all endpoints and methods starting with
              `/v1/async-actions`.
            product-collections: >-
              Gives access to all endpoints and methods starting with
              `/v1/product-collections`.
            categories: >-
              Gives access to all endpoints and methods starting with
              `/v1/categories`.
            metadata-schemas: >-
              Gives access to all endpoints and methods starting with
              `/v1/metadata-schemas`.
            locations: >-
              Gives access to all endpoints and methods starting with
              `/v1/locations`.
            referrals: >-
              Gives access to all endpoints and methods starting with
              `/v1/referrals`.
            trash-bin: >-
              Gives access to all endpoints and methods starting with
              `/v1/trash-bin`.
            templates: >-
              Gives access to all endpoints and methods starting with
              `/v1/templates`.

````