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

# Get Transactions

> Retrieves transaction data for a given time period.

<RequestExample>
  ```bash Get Transactions theme={"system"}
  curl -X GET \
    'https://api.appcharge.com/reporting/financial-data/transactions?startDate=2025-05-26T00:00:00Z&endDate=2025-07-24T23:59:59Z&limit=100&sortDirection=asc' \
    -H 'x-publisher-token: <x-publisher-token>'
  ```
</RequestExample>

<ResponseExample>
  ```json Get Transactions theme={"system"}
  {
    "totalCount": 245,
    "nextCursor": "eyJpZCI6IjY0YzkidQ==",
    "nextPageQuery": "?startDate=2025-05-26T00:00:00Z&endDate=2025-07-24T23:59:59Z&limit=100&sortDirection=asc&cursor=eyJpZCI6IjY0YzkidQ==",
    "results": [
      {
        "orderId": "ac_order_98f3pb4",
        "purchaseId": "pr-1234-5678-9012-34567",
        "publisherTransactionId": "ca-9832-custom",
        "timestamp": "2025-05-26T14:30:00.000Z",
        "customerDetails": {
          "id": "jane-doe",
          "email": "jan.doe@example.com"
        },
        "geolocation": {
          "countryCode2": "US",
          "region": "CA",
          "ipAddress": "192.168.1.10",
          "zipCode": "94107"
        },
        "offerDetails": {
          "offerId": "offer_7890",
          "offerName": "Gem Pack",
          "type": "Bundle",
          "products": [
            {
              "name": "Gems",
              "sku": "gems_100",
              "quantity": 100
            }
          ]
        },
        "transactionDetails": {
          "id": "64c9f6a12e1b4a3d9c7a5f1ef",
          "type": "paid",
          "amount": 999,
          "amountUsd": 999,
          "totalTaxAmount": 90,
          "totalTaxAmountUsd": 90,
          "currencyExchangeCostUsd": 15,
          "chargebackFeeUsd": 0,
          "transactionFeeUsd": 35,
          "publisherNetAmountUsd": 859,
          "currencyCode": "USD",
          "currencySymbol": "$",
          "paymentMethod": "credit_card"
        }
      },
      {
        "orderId": "6981ddaac658821c7960ca0b",
        "purchaseId": "pr_9a9aaea0318d409ebb9afdc37df37a62",
        "publisherTransactionId": "123456789012",
        "timestamp": "2026-02-03T11:41:42.155Z",
        "customerDetails": {
          "id": "jim-jardashian",
          "email": "jim.jardashian@example.com"
        },
        "geolocation": {
          "countryCode2": "US",
          "region": "NY",
          "ipAddress": "192.168.1.11",
          "zipCode": "10025"
        },
        "offerDetails": {
          "offerId": "692ed6a00dffce88151a9575",
          "offerName": "Treasure Pack",
          "type": "Bundle",
          "products": [
            {
              "name": "Coins",
              "sku": "coins_555",
              "quantity": 55
            }
          ]
        },
        "transactionDetails": {
          "id": "6981def652cf42968c4ba2d3c",
          "type": "refund",
          "amount": -500,
          "amountUsd": -500,
          "totalTaxAmount": -76,
          "totalTaxAmountUsd": -76,
          "currencyExchangeCostUsd": 0,
          "chargebackFeeUsd": 0,
          "transactionFeeUsd": 55,
          "publisherNetAmountUsd": -424,
          "currencyCode": "USD",
          "currencySymbol": "$",
          "paymentMethod": "Credit Card"
        }
      }
    ]
  }
  ```

  ```json 400 - Date validation error theme={"system"}
  {
    "statusCode": 400,
    "error": "Bad Request",
    "message": [
      {
        "validationErrorNumber": 1,
        "error": "endDate must be after startDate"
      }
    ],
    "requestUrl": "/reporting/financial-data/transactions?startDate=2025-07-24T00:00:00Z&endDate=2025-05-26T23:59:59Z"
  }
  ```

  ```json 400 - Invalid sort direction theme={"system"}
  {
    "statusCode": 400,
    "error": "Bad Request",
    "message": [
      {
        "validationErrorNumber": 1,
        "error": "sortDirection must be either \"asc\" or \"desc\""
      }
    ],
    "requestUrl": "/reporting/financial-data/transactions?startDate=2025-05-26T00:00:00Z&endDate=2025-07-24T23:59:59Z&sortDirection=invalid"
  }
  ```

  ```json 401 - Missing publisher token theme={"system"}
  {
    "statusCode": 401,
    "error": "Unauthorized",
    "message": [
      {
        "validationErrorNumber": 1,
        "error": "Publisher token is required"
      }
    ],
    "requestUrl": "/reporting/financial-data/transactions?startDate=2025-05-26T00:00:00Z&endDate=2025-07-24T23:59:59Z"
  }
  ```

  ```json 401 - Invalid publisher token theme={"system"}
  {
    "statusCode": 401,
    "error": "Unauthorized",
    "message": [
      {
        "validationErrorNumber": 1,
        "error": "Publisher not found"
      }
    ],
    "requestUrl": "/reporting/financial-data/transactions?startDate=2025-05-26T00:00:00Z&endDate=2025-07-24T23:59:59Z"
  }
  ```

  ```json 500 - Server error theme={"system"}
  {
    "statusCode": 500,
    "error": "Internal Server Error",
    "message": [
      {
        "validationErrorNumber": 1,
        "error": "Failed to get transactions"
      }
    ],
    "requestUrl": "/reporting/financial-data/transactions?startDate=2025-05-26T00:00:00Z&endDate=2025-07-24T23:59:59Z"
  }
  ```
</ResponseExample>


## OpenAPI

````yaml openapi-get-transactions.json GET /reporting/financial-data/transactions
openapi: 3.0.0
info:
  title: AppCharge API
  version: 1.0.0
servers:
  - url: https://api.appcharge.com
security: []
paths:
  /reporting/financial-data/transactions:
    get:
      summary: Get Transactions
      description: Retrieves transaction data for a given time period.
      operationId: getTransactions
      parameters:
        - in: query
          name: startDate
          required: true
          schema:
            type: string
            format: date-time
            example: '2025-05-26T00:00:00Z'
          description: >-
            Start date of the query in [UTC ISO
            8601](https://en.wikipedia.org/wiki/ISO_8601) format.
        - in: query
          name: endDate
          required: true
          schema:
            type: string
            format: date-time
            example: '2025-07-24T23:59:59Z'
          description: >-
            End date of the query in [UTC ISO
            8601](https://en.wikipedia.org/wiki/ISO_8601) format.
        - in: query
          name: limit
          required: false
          schema:
            type: integer
            default: 10
          description: |-
            Maximum number of transactions to return per page. 

             **Min:** 1 
             **Max:** 10,000
        - in: query
          name: sortDirection
          required: false
          schema:
            type: string
            enum:
              - asc
              - desc
            default: asc
          description: Sort order of the results based on the `timestamp` field.
        - in: header
          name: x-publisher-token
          schema:
            type: string
          required: true
          description: Publisher token.
      responses:
        '200':
          description: Successfully retrieved transactions.
          content:
            application/json:
              schema:
                type: object
                properties:
                  totalCount:
                    type: integer
                    description: Total number of transactions matching the query.
                    example: '245'
                  nextCursor:
                    type: string
                    description: Cursor pointing to the next page of results.
                    example: eyJpZCI6IjY0YzkidQ==
                  nextPageQuery:
                    type: string
                    description: >-
                      Fully-formed query string for fetching the next page of
                      results.
                    example: >-
                      ?startDate=2025-05-26T00:00:00Z&endDate=2025-07-24T23:59:59Z&limit=100&sortDirection=asc&cursor=eyJpZCI6IjY0YzkidQ==
                  results:
                    type: array
                    items:
                      $ref: '#/components/schemas/Transaction'
                    description: List of transaction results returned by the query.
        '400':
          description: Bad request - invalid parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestError'
              examples:
                dateValidation:
                  summary: Date validation error.
                  value:
                    statusCode: 400
                    error: Bad Request
                    message:
                      - validationErrorNumber: 1
                        error: endDate must be after startDate.
                    requestUrl: >-
                      /reporting/financial-data/transactions?startDate=2025-07-24T00:00:00Z&endDate=2025-05-26T23:59:59Z
                invalidSortDirection:
                  summary: Invalid sort direction.
                  value:
                    statusCode: 400
                    error: Bad Request
                    message:
                      - validationErrorNumber: 1
                        error: sortDirection must be either "asc" or "desc".
                    requestUrl: >-
                      /reporting/financial-data/transactions?startDate=2025-05-26T00:00:00Z&endDate=2025-07-24T23:59:59Z&sortDirection=invalid
        '401':
          description: Unauthorized - authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedError'
              examples:
                missingToken:
                  summary: Missing publisher token.
                  value:
                    statusCode: 401
                    error: Unauthorized
                    message:
                      - validationErrorNumber: 1
                        error: Publisher token is required.
                    requestUrl: >-
                      /reporting/financial-data/transactions?startDate=2025-05-26T00:00:00Z&endDate=2025-07-24T23:59:59Z
                invalidToken:
                  summary: Invalid publisher token.
                  value:
                    statusCode: 401
                    error: Unauthorized
                    message:
                      - validationErrorNumber: 1
                        error: Publisher not found.
                    requestUrl: >-
                      /reporting/financial-data/transactions?startDate=2025-05-26T00:00:00Z&endDate=2025-07-24T23:59:59Z
                tokenLookupFailed:
                  summary: Token lookup failed.
                  value:
                    statusCode: 401
                    error: Unauthorized
                    message:
                      - validationErrorNumber: 1
                        error: Failed to authorize publisher token.
                    requestUrl: >-
                      /reporting/financial-data/transactions?startDate=2025-05-26T00:00:00Z&endDate=2025-07-24T23:59:59Z
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerError'
              examples:
                serverError:
                  summary: Server error
                  value:
                    statusCode: 500
                    error: Internal Server Error
                    message:
                      - validationErrorNumber: 1
                        error: Failed to get transactions
                    requestUrl: >-
                      /reporting/financial-data/transactions?startDate=2025-05-26T00:00:00Z&endDate=2025-07-24T23:59:59Z
components:
  schemas:
    Transaction:
      type: object
      properties:
        orderId:
          type: string
          description: Order ID.
          example: ac_order_98f3pb4
        purchaseId:
          type: string
          description: Purchase ID.
          example: pr-1234-5678-9012-34567
        publisherTransactionId:
          type: string
          description: Transaction ID.
          example: ca-9832-custom
        timestamp:
          type: string
          format: date-time
          description: >-
            Transaction timestamp in [UTC ISO
            8601](https://en.wikipedia.org/wiki/ISO_8601) format.
          example: '2025-05-26T14:30:00.000Z'
        customerDetails:
          type: object
          description: Customer information.
          properties:
            id:
              type: string
              description: Customer ID.
              example: jane-doe
            email:
              type: string
              description: Customer email address.
              example: jan.doe@example.com
        geolocation:
          type: object
          description: Geolocation information.
          properties:
            countryCode2:
              type: string
              description: >-
                Two-letter country code in [ISO-3166
                alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
                format. Required if `playerIp` is not provided. Example: `US`.
              example: US
            playerIp:
              type: string
              description: >-
                Player IP address in [IPv4](https://en.wikipedia.org/wiki/IPv4)
                format.  Required if `countryCode2` is not provided. Example:
                `192.0.2.1`.
            region:
              type: string
              description: Region or state.
              example: CA
            ipAddress:
              type: string
              description: IP address.
              example: 192.168.1.10
            zipCode:
              type: string
              description: Postal code.
              example: '94107'
        offerDetails:
          type: object
          description: Offer information.
          properties:
            offerId:
              type: string
              description: Offer ID.
              example: offer_7890
            offerName:
              type: string
              description: Offer name.
              example: Gem Pack
            type:
              type: string
              description: Offer type.
              example: Bundle
            products:
              type: array
              description: List of products in the offer.
              items:
                type: object
                properties:
                  name:
                    type: string
                    description: Product name.
                    example: Gems
                  sku:
                    type: string
                    description: Product SKU.
                    example: gems_100
                  quantity:
                    type: number
                    description: Product quantity.
                    example: 100
        transactionDetails:
          type: object
          description: Transaction information.
          properties:
            id:
              type: string
              description: Transaction ID.
              example: 64c9f6a12e1b4a3d9c7a5f1ef
            type:
              type: string
              description: Transaction type.
              enum:
                - paid
                - refund
                - dispute_funds_withdrawn
                - dispute_funds_reinstated
              example: paid
            amount:
              type: number
              description: >-
                Transaction amount in the local currency's smallest unit. For
                example, if the amount is $9.99, the API returns `999`, not
                `9.99`. For currencies with no subunit, such as JPY, the value
                represents the full unit. See [Supported
                Currencies](/../../merchant-of-record/finance/supported-currencies)
                for per-currency decimal rules.
              example: 999
            amountUsd:
              type: number
              description: >-
                Transaction amount in USD cents. For example, `999` means $9.99,
                not $999.
              example: 999
            totalTaxAmount:
              type: number
              description: >-
                Total tax amount in the local currency's smallest unit. For
                example, if the tax is $0.90, the API returns `90`, not `0.90`.
                For currencies with no subunit, such as JPY, the value
                represents the full unit. See [Supported
                Currencies](/../../merchant-of-record/finance/supported-currencies)
                for per-currency decimal rules.
              example: 90
            totalTaxAmountUsd:
              type: number
              description: Total tax amount in USD cents.
              example: 90
            currencyExchangeCostUsd:
              type: number
              description: Currency exchange cost in USD cents.
              example: 15
            chargebackFeeUsd:
              type: number
              description: Chargeback fee in USD cents.
              example: 0
            transactionFeeUsd:
              type: number
              description: Transaction fee in USD cents.
              example: 35
            publisherNetAmountUsd:
              type: number
              description: Publisher net amount in USD cents.
              example: 859
            currencyCode:
              type: string
              description: >-
                Currency code in [ISO
                4217](https://en.wikipedia.org/wiki/ISO_4217) format.
              example: USD
            currencySymbol:
              type: string
              description: Currency symbol.
              example: $
            paymentMethod:
              type: string
              description: Payment method used.
              example: credit_card
    BadRequestError:
      type: object
      properties:
        statusCode:
          type: integer
          description: HTTP status code.
          example: 400
        error:
          type: string
          description: Error type.
          example: Bad Request
        message:
          type: array
          description: Array of error messages.
          items:
            type: object
            properties:
              validationErrorNumber:
                type: integer
                description: Error number.
                example: 1
              error:
                type: string
                description: Error message.
                example: endDate must be after startDate.
        requestUrl:
          type: string
          description: The request URL that caused the error.
          example: >-
            /reporting/financial-data/transactions?startDate=2025-07-24T00:00:00Z&endDate=2025-05-26T23:59:59Z
    UnauthorizedError:
      type: object
      properties:
        statusCode:
          type: integer
          description: HTTP status code.
          example: 401
        error:
          type: string
          description: Error type.
          example: Unauthorized
        message:
          type: array
          description: Array of error messages.
          items:
            type: object
            properties:
              validationErrorNumber:
                type: integer
                description: Error number.
                example: 1
              error:
                type: string
                description: Error message.
                example: Publisher token is required.
        requestUrl:
          type: string
          description: The request URL that caused the error.
          example: >-
            /reporting/financial-data/transactions?startDate=2025-05-26T00:00:00Z&endDate=2025-07-24T23:59:59Z
    InternalServerError:
      type: object
      properties:
        statusCode:
          type: integer
          description: HTTP status code.
          example: 500
        error:
          type: string
          description: Error type.
          example: Internal Server Error
        message:
          type: array
          description: Array of error messages.
          items:
            type: object
            properties:
              validationErrorNumber:
                type: integer
                description: Error number.
                example: 1
              error:
                type: string
                description: Error message.
                example: Failed to get transactions.
        requestUrl:
          type: string
          description: The request URL that caused the error.
          example: >-
            /reporting/financial-data/transactions?startDate=2025-05-26T00:00:00Z&endDate=2025-07-24T23:59:59Z

````