Open Context Protocol is live! 🚀 Read the launch post
getBalanceHistory

getBalanceHistory

List all balance transactions

Details

  • Method: GET
  • Path: /v1/balance/history
  • Operation ID: GetBalanceHistory

Parameters

{
  "created": {
    "description": "Only return transactions that were created during the given date interval.",
    "required": false,
    "location": "query",
    "type": "string"
  },
  "currency": {
    "description": "Only return transactions in a certain currency. Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).",
    "required": false,
    "location": "query",
    "type": "string",
    "format": "currency"
  },
  "ending_before": {
    "description": "A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.",
    "required": false,
    "location": "query",
    "type": "string"
  },
  "expand": {
    "description": "Specifies which fields in the response should be expanded.",
    "required": false,
    "location": "query",
    "type": "array"
  },
  "limit": {
    "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.",
    "required": false,
    "location": "query",
    "type": "integer"
  },
  "payout": {
    "description": "For automatic Stripe payouts only, only returns transactions that were paid out on the specified payout ID.",
    "required": false,
    "location": "query",
    "type": "string"
  },
  "source": {
    "description": "Only returns the original transaction.",
    "required": false,
    "location": "query",
    "type": "string"
  },
  "starting_after": {
    "description": "A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.",
    "required": false,
    "location": "query",
    "type": "string"
  },
  "type": {
    "description": "Only returns transactions of the given type. One of: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_outbound`, `obligation_reversal_inbound`, `payment`, `payment_failure_refund`, `payment_network_reserve_hold`, `payment_network_reserve_release`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `payout_minimum_balance_hold`, `payout_minimum_balance_release`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `stripe_balance_payment_debit`, `stripe_balance_payment_debit_reversal`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`.",
    "required": false,
    "location": "query",
    "type": "string"
  }
}

Response Schema

{
  "description": "",
  "properties": {
    "data": {
      "items": {
        "description": "Balance transactions represent funds moving through your Stripe account.\nStripe creates them for every type of transaction that enters or leaves your Stripe account balance.\n\nRelated guide: [Balance transaction types](https://docs.stripe.com/reports/balance-transaction-types)",
        "properties": {
          "amount": {
            "description": "Gross amount of this transaction (in cents (or local equivalent)). A positive value represents funds charged to another party, and a negative value represents funds sent to another party.",
            "type": "integer"
          },
          "available_on": {
            "description": "The date that the transaction's net funds become available in the Stripe balance.",
            "format": "unix-time",
            "type": "integer"
          },
          "balance_type": {
            "description": "The balance that this transaction impacts.",
            "enum": [
              "issuing",
              "payments",
              "refund_and_dispute_prefunding"
            ],
            "type": "string",
            "x-stripeBypassValidation": true
          },
          "created": {
            "description": "Time at which the object was created. Measured in seconds since the Unix epoch.",
            "format": "unix-time",
            "type": "integer"
          },
          "currency": {
            "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).",
            "format": "currency",
            "type": "string"
          },
          "description": {
            "description": "An arbitrary string attached to the object. Often useful for displaying to users.",
            "maxLength": 5000,
            "nullable": true,
            "type": "string"
          },
          "exchange_rate": {
            "description": "If applicable, this transaction uses an exchange rate. If money converts from currency A to currency B, then the `amount` in currency A, multipled by the `exchange_rate`, equals the `amount` in currency B. For example, if you charge a customer 10.00 EUR, the PaymentIntent's `amount` is `1000` and `currency` is `eur`. If this converts to 12.34 USD in your Stripe account, the BalanceTransaction's `amount` is `1234`, its `currency` is `usd`, and the `exchange_rate` is `1.234`.",
            "nullable": true,
            "type": "number"
          },
          "fee": {
            "description": "Fees (in cents (or local equivalent)) paid for this transaction. Represented as a positive integer when assessed.",
            "type": "integer"
          },
          "fee_details": {
            "description": "Detailed breakdown of fees (in cents (or local equivalent)) paid for this transaction.",
            "items": {
              "description": "",
              "properties": {
                "amount": {
                  "description": "Amount of the fee, in cents.",
                  "type": "integer"
                },
                "application": {
                  "description": "ID of the Connect application that earned the fee.",
                  "maxLength": 5000,
                  "nullable": true,
                  "type": "string"
                },
                "currency": {
                  "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).",
                  "format": "currency",
                  "type": "string"
                },
                "description": {
                  "description": "An arbitrary string attached to the object. Often useful for displaying to users.",
                  "maxLength": 5000,
                  "nullable": true,
                  "type": "string"
                },
                "type": {
                  "description": "Type of the fee, one of: `application_fee`, `payment_method_passthrough_fee`, `stripe_fee` or `tax`.",
                  "maxLength": 5000,
                  "type": "string"
                }
              },
              "required": [
                "amount",
                "currency",
                "type"
              ],
              "title": "Fee",
              "type": "object",
              "x-expandableFields": []
            },
            "type": "array"
          },
          "id": {
            "description": "Unique identifier for the object.",
            "maxLength": 5000,
            "type": "string"
          },
          "net": {
            "description": "Net impact to a Stripe balance (in cents (or local equivalent)). A positive value represents incrementing a Stripe balance, and a negative value decrementing a Stripe balance. You can calculate the net impact of a transaction on a balance by `amount` - `fee`",
            "type": "integer"
          },
          "object": {
            "description": "String representing the object's type. Objects of the same type share the same value.",
            "enum": [
              "balance_transaction"
            ],
            "type": "string"
          },
          "reporting_category": {
            "description": "Learn more about how [reporting categories](https://stripe.com/docs/reports/reporting-categories) can help you understand balance transactions from an accounting perspective.",
            "maxLength": 5000,
            "type": "string"
          },
          "source": {
            "anyOf": [
              {
                "maxLength": 5000,
                "type": "string"
              },
              {
                "$ref": "#/components/schemas/application_fee"
              },
              {
                "$ref": "#/components/schemas/charge"
              },
              {
                "$ref": "#/components/schemas/connect_collection_transfer"
              },
              {
                "$ref": "#/components/schemas/customer_cash_balance_transaction"
              },
              {
                "$ref": "#/components/schemas/dispute"
              },
              {
                "$ref": "#/components/schemas/fee_refund"
              },
              {
                "$ref": "#/components/schemas/issuing.authorization"
              },
              {
                "$ref": "#/components/schemas/issuing.dispute"
              },
              {
                "$ref": "#/components/schemas/issuing.transaction"
              },
              {
                "$ref": "#/components/schemas/payout"
              },
              {
                "$ref": "#/components/schemas/refund"
              },
              {
                "$ref": "#/components/schemas/reserve_transaction"
              },
              {
                "$ref": "#/components/schemas/tax_deducted_at_source"
              },
              {
                "$ref": "#/components/schemas/topup"
              },
              {
                "$ref": "#/components/schemas/transfer"
              },
              {
                "$ref": "#/components/schemas/transfer_reversal"
              }
            ],
            "description": "This transaction relates to the Stripe object.",
            "nullable": true,
            "x-expansionResources": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/application_fee"
                },
                {
                  "$ref": "#/components/schemas/charge"
                },
                {
                  "$ref": "#/components/schemas/connect_collection_transfer"
                },
                {
                  "$ref": "#/components/schemas/customer_cash_balance_transaction"
                },
                {
                  "$ref": "#/components/schemas/dispute"
                },
                {
                  "$ref": "#/components/schemas/fee_refund"
                },
                {
                  "$ref": "#/components/schemas/issuing.authorization"
                },
                {
                  "$ref": "#/components/schemas/issuing.dispute"
                },
                {
                  "$ref": "#/components/schemas/issuing.transaction"
                },
                {
                  "$ref": "#/components/schemas/payout"
                },
                {
                  "$ref": "#/components/schemas/refund"
                },
                {
                  "$ref": "#/components/schemas/reserve_transaction"
                },
                {
                  "$ref": "#/components/schemas/tax_deducted_at_source"
                },
                {
                  "$ref": "#/components/schemas/topup"
                },
                {
                  "$ref": "#/components/schemas/transfer"
                },
                {
                  "$ref": "#/components/schemas/transfer_reversal"
                }
              ]
            },
            "x-stripeBypassValidation": true
          },
          "status": {
            "description": "The transaction's net funds status in the Stripe balance, which are either `available` or `pending`.",
            "maxLength": 5000,
            "type": "string"
          },
          "type": {
            "description": "Transaction type: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_outbound`, `obligation_reversal_inbound`, `payment`, `payment_failure_refund`, `payment_network_reserve_hold`, `payment_network_reserve_release`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `payout_minimum_balance_hold`, `payout_minimum_balance_release`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `stripe_balance_payment_debit`, `stripe_balance_payment_debit_reversal`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. Learn more about [balance transaction types and what they represent](https://stripe.com/docs/reports/balance-transaction-types). To classify transactions for accounting purposes, consider `reporting_category` instead.",
            "enum": [
              "adjustment",
              "advance",
              "advance_funding",
              "anticipation_repayment",
              "application_fee",
              "application_fee_refund",
              "charge",
              "climate_order_purchase",
              "climate_order_refund",
              "connect_collection_transfer",
              "contribution",
              "issuing_authorization_hold",
              "issuing_authorization_release",
              "issuing_dispute",
              "issuing_transaction",
              "obligation_outbound",
              "obligation_reversal_inbound",
              "payment",
              "payment_failure_refund",
              "payment_network_reserve_hold",
              "payment_network_reserve_release",
              "payment_refund",
              "payment_reversal",
              "payment_unreconciled",
              "payout",
              "payout_cancel",
              "payout_failure",
              "payout_minimum_balance_hold",
              "payout_minimum_balance_release",
              "refund",
              "refund_failure",
              "reserve_transaction",
              "reserved_funds",
              "stripe_balance_payment_debit",
              "stripe_balance_payment_debit_reversal",
              "stripe_fee",
              "stripe_fx_fee",
              "tax_fee",
              "topup",
              "topup_reversal",
              "transfer",
              "transfer_cancel",
              "transfer_failure",
              "transfer_refund"
            ],
            "type": "string"
          }
        },
        "required": [
          "amount",
          "available_on",
          "created",
          "currency",
          "fee",
          "fee_details",
          "id",
          "net",
          "object",
          "reporting_category",
          "status",
          "type"
        ],
        "title": "BalanceTransaction",
        "type": "object",
        "x-expandableFields": [
          "fee_details",
          "source"
        ],
        "x-resourceId": "balance_transaction"
      },
      "type": "array"
    },
    "has_more": {
      "description": "True if this list has another page of items after this one that can be fetched.",
      "type": "boolean"
    },
    "object": {
      "description": "String representing the object's type. Objects of the same type share the same value. Always has the value `list`.",
      "enum": [
        "list"
      ],
      "type": "string"
    },
    "url": {
      "description": "The URL where this list can be accessed.",
      "maxLength": 5000,
      "pattern": "^/v1/balance_transactions",
      "type": "string"
    }
  },
  "required": [
    "data",
    "has_more",
    "object",
    "url"
  ],
  "title": "BalanceTransactionsList",
  "type": "object",
  "x-expandableFields": [
    "data"
  ]
}

Usage

from ocp_agent import OCPAgent

agent = OCPAgent()
await agent.register_api('stripe')

# Call this tool
result = await agent.call_tool('getBalanceHistory', {
    # Add required parameters here
})