> ## 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 Voucher Transactions

> Export transactions that are associated with credit movements on a gift card or loyalty card.

| **Field** | **Definition** | **Example Export** |
|:---|:---|:---|
| id | Unique transaction ID. | vtx_0cb7811f1c07765800 |
| type | Transaction type. | - `CREDITS_REMOVAL` <br /> - `CREDITS_ADDITION` <br /> - `CREDITS_REFUND` <br /> - `CREDITS_REDEMPTION` <br /> - `POINTS_ACCRUAL` <br /> - `POINTS_REDEMPTION`<br /> - `POINTS_REFUND`<br /> - `POINTS_ADDITION`<br /> - `POINTS_REMOVAL`<br /> - `POINTS_EXPIRATION`<br /> - `POINTS_TRANSFER_IN`<br /> - `POINTS_TRANSFER_OUT` |
| source_id | Unique transaction source ID. | 8638 |
| reason | Contains the reason for the transaction if one was included originally. |  |
| balance | The gift card or loyalty card balance after the transaction. |  |
| amount | The amount of gift card or loyalty card credits 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 |
| 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/vouchers.json post /v1/vouchers/{code}/transactions/export
openapi: 3.0.1
info:
  title: Voucherify API - Vouchers
  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/vouchers/{code}/transactions/export:
    parameters:
      - schema:
          $ref: '#/components/schemas/ParameterCode'
        example: GIFT-CARD-1
        name: code
        in: path
        required: true
        description: >-
          A **code** that identifies the voucher or a unique voucher ID assigned
          by Voucherify, i.e. `v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u`.
    post:
      tags:
        - Vouchers
      summary: Export Voucher Transactions
      description: >-
        Export transactions that are associated with credit movements on a gift
        card or loyalty card.


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

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

        | id | Unique transaction ID. | vtx_0cb7811f1c07765800 |

        | type | Transaction type. | - `CREDITS_REMOVAL` <br /> -
        `CREDITS_ADDITION` <br /> - `CREDITS_REFUND` <br /> -
        `CREDITS_REDEMPTION` <br /> - `POINTS_ACCRUAL` <br /> -
        `POINTS_REDEMPTION`<br /> - `POINTS_REFUND`<br /> - `POINTS_ADDITION`<br
        /> - `POINTS_REMOVAL`<br /> - `POINTS_EXPIRATION`<br /> -
        `POINTS_TRANSFER_IN`<br /> - `POINTS_TRANSFER_OUT` |

        | source_id | Unique transaction source ID. | 8638 |

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

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

        | amount | The amount of gift card or loyalty card credits 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 |

        | 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-voucher-transactions
      parameters: []
      requestBody:
        description: Specify the parameters for the camapign transaction export.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VouchersTransactionsExportCreateRequestBody'
            examples:
              Example:
                value:
                  parameters:
                    order: '-created_at'
                    fields:
                      - id
                      - type
                      - source_id
                      - reason
                      - balance
                      - amount
                      - created_at
                      - voucher_id
                      - campaign_id
                      - details
                      - source
        required: true
      responses:
        '200':
          description: Returns an export object.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/VouchersTransactionsExportCreateResponseBody
              examples:
                Example:
                  value:
                    id: exp_ARi2UbRjgfrHQJoVcKFrBUgA
                    object: export
                    created_at: '2023-05-16T08:30:21.496Z'
                    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
                        - source
                      filters:
                        voucher_id:
                          conditions:
                            $in:
                              - HRwc0oHz
                    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
            - vouchers
components:
  schemas:
    ParameterCode:
      type: string
      example: 2CpRCE2c
    VouchersTransactionsExportCreateRequestBody:
      description: Request body schema for **POST** `v1/vouchers/transactions/export`.
      type: object
      title: Vouchers Transactions Export Create Request Body
      properties:
        parameters:
          description: Contains the parameters that define the data to be exported.
          allOf:
            - $ref: '#/components/schemas/VoucherTransactionsExportParameters'
    VouchersTransactionsExportCreateResponseBody:
      type: object
      title: Vouchers Transactions Export Create Response Body
      description: >-
        Response body schema for **POST**
        `v1/vouchers/{code}/transactions/export`.
      allOf:
        - $ref: '#/components/schemas/VoucherTransactionsExport'
    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
    VoucherTransactionsExportParameters:
      description: >-
        List of available fields and filters that can be exported with a gift
        card or loyalty card transactions export along with the sorting order of
        the returned data.
      title: Export Transactions
      type: object
      properties:
        order:
          type: string
          description: >-
            How the export is filtered, where the dash `-` preceding a sorting
            option means sorting in a descending order.
          enum:
            - '-created_at'
            - created_at
        fields:
          type: array
          description: >-
            Array of strings containing the data in the export. These fields
            define the headers in the CSV file. The array can be a combination
            of any of the following available fields:


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

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

            | id | Unique transaction ID. | vtx_0cb7811f1c07765800 |

            | type | Transaction type. | - `CREDITS_REMOVAL` <br /> -
            `CREDITS_ADDITION` <br /> - `CREDITS_REFUND` <br /> -
            `CREDITS_REDEMPTION` <br /> - `POINTS_ACCRUAL` <br /> -
            `POINTS_REDEMPTION`<br /> - `POINTS_REFUND`<br /> -
            `POINTS_ADDITION`<br /> - `POINTS_REMOVAL`<br /> -
            `POINTS_EXPIRATION`<br /> - `POINTS_TRANSFER_IN`<br /> -
            `POINTS_TRANSFER_OUT` |

            | source_id | Unique transaction source ID. | 8638 |

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

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

            | amount | The amount of gift card or loyalty card credits 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 |

            | 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 |
          items:
            type: string
            enum:
              - id
              - type
              - source_id
              - reason
              - balance
              - amount
              - created_at
              - voucher_id
              - campaign_id
              - source
              - details
              - related_transaction_id
    VoucherTransactionsExport:
      title: Voucher Transactions Export
      type: object
      description: >-
        This is an object representing an export. 

         Using this endpoint, you can export voucher transactions as a CSV file. This functionality works asynchronously and comes down to the following steps: create an export object and return its id so you can track its status, trigger a CSV file generation, change the status to SCHEDULED when the generation is over, store the file in S3 and change the status to DONE. Now you can download it.

        With parameters you can select which fields will be exported. An export
        request will almost always result in a single file being generated by
        the system. However, when your volume of data is large, the system may
        split the results into multiple chunks.
      properties:
        id:
          type: string
          description: Unique export ID.
          example: exp_FFfp9o7daWuJqJCKp5xqqli4
        object:
          type: string
          default: export
          description: >-
            The type of object being represented. This object stores information
            about the `export`.
          enum:
            - export
        created_at:
          type: string
          example: '2022-04-28T11:23:20.922Z'
          description: >-
            Timestamp representing the date and time when the export was
            scheduled in ISO 8601 format.
          format: date-time
        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.
          default: API
        exported_object:
          type: string
          description: The type of exported object.
          default: voucher_transactions
          enum:
            - voucher_transactions
        parameters:
          $ref: '#/components/schemas/VoucherTransactionsFilters'
        result:
          type: object
          nullable: true
          description: Contains the URL of the CSV file.
          required:
            - url
          properties:
            url:
              type: string
              description: >-
                URL of the CSV file location. It contains the `token` used for
                authorization in the [Download
                export](/api-reference/exports/download-export) method.
        user_id:
          type: string
          nullable: true
          description: >-
            Identifies the specific user who initiated the export through the
            Voucherify Dashboard; returned when the `channel` value is
            `WEBSITE`.
          example: user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH
      required:
        - id
        - object
        - created_at
        - status
        - channel
        - exported_object
        - parameters
        - result
        - user_id
    VoucherTransactionsFilters:
      description: >-
        List of available fields and filters that can be exported with gift card
        or loyalty card transactions along with the sorting order of the
        returned data.
      title: Voucher Transactions
      type: object
      properties:
        order:
          type: string
          description: >-
            How the export is filtered, where the dash `-` preceding a sorting
            option means sorting in a descending order.
          enum:
            - '-created_at'
            - created_at
        fields:
          type: array
          description: >-
            Array of strings containing the data in the export. These fields
            define the headers in the CSV file. The array can be a combination
            of any of the following available fields:


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

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

            | id | Unique transaction ID. | vtx_0cb7811f1c07765800 |

            | type | Transaction type. | - `CREDITS_REMOVAL` <br /> -
            `CREDITS_ADDITION` <br /> - `CREDITS_REFUND` <br /> -
            `CREDITS_REDEMPTION` <br /> - `POINTS_ACCRUAL`<br /> -
            `POINTS_REDEMPTION`<br /> - `POINTS_REFUND`<br /> -
            `POINTS_ADDITION`<br /> - `POINTS_REMOVAL`<br /> -
            `POINTS_EXPIRATION`<br /> - `POINTS_TRANSFER_IN`<br /> -
            `POINTS_TRANSFER_OUT` |

            | source_id | Unique transaction source ID. | 8638 |

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

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

            | amount | The amount of gift card or loyalty card credits 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 |

            | 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 |
          items:
            type: string
            enum:
              - id
              - type
              - source_id
              - reason
              - balance
              - amount
              - created_at
              - voucher_id
              - campaign_id
              - source
              - details
              - related_transaction_id
        filters:
          $ref: '#/components/schemas/VoucherTransactionsExportFilterConditions'
      required:
        - filters
    VoucherTransactionsExportFilterConditions:
      description: Filter condition.
      title: Filter by voucher ID
      type: object
      required:
        - voucher_id
      properties:
        voucher_id:
          type: object
          required:
            - conditions
          description: >-
            Data filters used to narrow down the data records to be returned in
            the result.
          properties:
            conditions:
              type: object
              required:
                - $in
              description: >-
                Data filters used to narrow down the data records to be returned
                in the result.
              properties:
                $in:
                  type: array
                  minItems: 1
                  maxItems: 1
                  items:
                    type: string
                    minLength: 1
                    maxLength: 1
  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`.

````