Open Context Protocol is live! 🚀 Read the launch post

getCharges

List all charges

Details

  • Method: GET
  • Path: /v1/charges
  • Operation ID: GetCharges

Parameters

{
  "created": {
    "description": "Only return charges that were created during the given date interval.",
    "required": false,
    "location": "query",
    "type": "string"
  },
  "customer": {
    "description": "Only return charges for the customer specified by this customer ID.",
    "required": false,
    "location": "query",
    "type": "string"
  },
  "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"
  },
  "payment_intent": {
    "description": "Only return charges that were created by the PaymentIntent specified by this PaymentIntent ID.",
    "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"
  },
  "transfer_group": {
    "description": "Only return charges for this transfer group, limited to 100.",
    "required": false,
    "location": "query",
    "type": "string"
  }
}

Response Schema

{
  "description": "",
  "properties": {
    "data": {
      "items": {
        "description": "The `Charge` object represents a single attempt to move money into your Stripe account.\nPaymentIntent confirmation is the most common way to create Charges, but [Account Debits](https://docs.stripe.com/connect/account-debits) may also create Charges.\nSome legacy payment flows create Charges directly, which is not recommended for new integrations.",
        "properties": {
          "amount": {
            "description": "Amount intended to be collected by this payment. A positive integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](https://docs.stripe.com/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99).",
            "type": "integer"
          },
          "amount_captured": {
            "description": "Amount in cents (or local equivalent) captured (can be less than the amount attribute on the charge if a partial capture was made).",
            "type": "integer"
          },
          "amount_refunded": {
            "description": "Amount in cents (or local equivalent) refunded (can be less than the amount attribute on the charge if a partial refund was issued).",
            "type": "integer"
          },
          "application": {
            "anyOf": [
              {
                "maxLength": 5000,
                "type": "string"
              },
              {
                "$ref": "#/components/schemas/application"
              }
            ],
            "description": "ID of the Connect application that created the charge.",
            "nullable": true,
            "x-expansionResources": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/application"
                }
              ]
            }
          },
          "application_fee": {
            "anyOf": [
              {
                "maxLength": 5000,
                "type": "string"
              },
              {
                "$ref": "#/components/schemas/application_fee"
              }
            ],
            "description": "The application fee (if any) for the charge. [See the Connect documentation](https://docs.stripe.com/connect/direct-charges#collect-fees) for details.",
            "nullable": true,
            "x-expansionResources": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/application_fee"
                }
              ]
            }
          },
          "application_fee_amount": {
            "description": "The amount of the application fee (if any) requested for the charge. [See the Connect documentation](https://docs.stripe.com/connect/direct-charges#collect-fees) for details.",
            "nullable": true,
            "type": "integer"
          },
          "balance_transaction": {
            "anyOf": [
              {
                "maxLength": 5000,
                "type": "string"
              },
              {
                "$ref": "#/components/schemas/balance_transaction"
              }
            ],
            "description": "ID of the balance transaction that describes the impact of this charge on your account balance (not including refunds or disputes).",
            "nullable": true,
            "x-expansionResources": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/balance_transaction"
                }
              ]
            }
          },
          "billing_details": {
            "description": "",
            "properties": {
              "address": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/address"
                  }
                ],
                "description": "Billing address.",
                "nullable": true
              },
              "email": {
                "description": "Email address.",
                "maxLength": 5000,
                "nullable": true,
                "type": "string"
              },
              "name": {
                "description": "Full name.",
                "maxLength": 5000,
                "nullable": true,
                "type": "string"
              },
              "phone": {
                "description": "Billing phone number (including extension).",
                "maxLength": 5000,
                "nullable": true,
                "type": "string"
              },
              "tax_id": {
                "description": "Taxpayer identification number. Used only for transactions between LATAM buyers and non-LATAM sellers.",
                "maxLength": 5000,
                "nullable": true,
                "type": "string"
              }
            },
            "title": "billing_details",
            "type": "object",
            "x-expandableFields": [
              "address"
            ]
          },
          "calculated_statement_descriptor": {
            "description": "The full statement descriptor that is passed to card networks, and that is displayed on your customers' credit card and bank statements. Allows you to see what the statement descriptor looks like after the static and dynamic portions are combined. This value only exists for card payments.",
            "maxLength": 5000,
            "nullable": true,
            "type": "string"
          },
          "captured": {
            "description": "If the charge was created without capturing, this Boolean represents whether it is still uncaptured or has since been captured.",
            "type": "boolean"
          },
          "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"
          },
          "customer": {
            "anyOf": [
              {
                "maxLength": 5000,
                "type": "string"
              },
              {
                "$ref": "#/components/schemas/customer"
              },
              {
                "$ref": "#/components/schemas/deleted_customer"
              }
            ],
            "description": "ID of the customer this charge is for if one exists.",
            "nullable": true,
            "x-expansionResources": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/customer"
                },
                {
                  "$ref": "#/components/schemas/deleted_customer"
                }
              ]
            }
          },
          "description": {
            "description": "An arbitrary string attached to the object. Often useful for displaying to users.",
            "maxLength": 40000,
            "nullable": true,
            "type": "string"
          },
          "disputed": {
            "description": "Whether the charge has been disputed.",
            "type": "boolean"
          },
          "failure_balance_transaction": {
            "anyOf": [
              {
                "maxLength": 5000,
                "type": "string"
              },
              {
                "$ref": "#/components/schemas/balance_transaction"
              }
            ],
            "description": "ID of the balance transaction that describes the reversal of the balance on your account due to payment failure.",
            "nullable": true,
            "x-expansionResources": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/balance_transaction"
                }
              ]
            }
          },
          "failure_code": {
            "description": "Error code explaining reason for charge failure if available (see [the errors section](https://docs.stripe.com/error-codes) for a list of codes).",
            "maxLength": 5000,
            "nullable": true,
            "type": "string"
          },
          "failure_message": {
            "description": "Message to user further explaining reason for charge failure if available.",
            "maxLength": 5000,
            "nullable": true,
            "type": "string"
          },
          "fraud_details": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/charge_fraud_details"
              }
            ],
            "description": "Information on fraud assessments for the charge.",
            "nullable": true
          },
          "id": {
            "description": "Unique identifier for the object.",
            "maxLength": 5000,
            "type": "string"
          },
          "livemode": {
            "description": "Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.",
            "type": "boolean"
          },
          "metadata": {
            "additionalProperties": {
              "maxLength": 500,
              "type": "string"
            },
            "description": "Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.",
            "type": "object"
          },
          "object": {
            "description": "String representing the object's type. Objects of the same type share the same value.",
            "enum": [
              "charge"
            ],
            "type": "string"
          },
          "on_behalf_of": {
            "anyOf": [
              {
                "maxLength": 5000,
                "type": "string"
              },
              {
                "$ref": "#/components/schemas/account"
              }
            ],
            "description": "The account (if any) the charge was made on behalf of without triggering an automatic transfer. See the [Connect documentation](https://docs.stripe.com/connect/separate-charges-and-transfers) for details.",
            "nullable": true,
            "x-expansionResources": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/account"
                }
              ]
            }
          },
          "outcome": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/charge_outcome"
              }
            ],
            "description": "Details about whether the payment was accepted, and why. See [understanding declines](https://docs.stripe.com/declines) for details.",
            "nullable": true
          },
          "paid": {
            "description": "`true` if the charge succeeded, or was successfully authorized for later capture.",
            "type": "boolean"
          },
          "payment_intent": {
            "anyOf": [
              {
                "maxLength": 5000,
                "type": "string"
              },
              {
                "$ref": "#/components/schemas/payment_intent"
              }
            ],
            "description": "ID of the PaymentIntent associated with this charge, if one exists.",
            "nullable": true,
            "x-expansionResources": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/payment_intent"
                }
              ]
            }
          },
          "payment_method": {
            "description": "ID of the payment method used in this charge.",
            "maxLength": 5000,
            "nullable": true,
            "type": "string"
          },
          "payment_method_details": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/payment_method_details"
              }
            ],
            "description": "Details about the payment method at the time of the transaction.",
            "nullable": true
          },
          "presentment_details": {
            "description": "",
            "properties": {
              "presentment_amount": {
                "description": "Amount intended to be collected by this payment, denominated in `presentment_currency`.",
                "type": "integer"
              },
              "presentment_currency": {
                "description": "Currency presented to the customer during payment.",
                "maxLength": 5000,
                "type": "string"
              }
            },
            "required": [
              "presentment_amount",
              "presentment_currency"
            ],
            "title": "PaymentFlowsPaymentIntentPresentmentDetails",
            "type": "object",
            "x-expandableFields": []
          },
          "radar_options": {
            "description": "Options to configure Radar. See [Radar Session](https://docs.stripe.com/radar/radar-session) for more information.",
            "properties": {
              "session": {
                "description": "A [Radar Session](https://docs.stripe.com/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments.",
                "maxLength": 5000,
                "type": "string"
              }
            },
            "title": "RadarRadarOptions",
            "type": "object",
            "x-expandableFields": []
          },
          "receipt_email": {
            "description": "This is the email address that the receipt for this charge was sent to.",
            "maxLength": 5000,
            "nullable": true,
            "type": "string"
          },
          "receipt_number": {
            "description": "This is the transaction number that appears on email receipts sent for this charge. This attribute will be `null` until a receipt has been sent.",
            "maxLength": 5000,
            "nullable": true,
            "type": "string"
          },
          "receipt_url": {
            "description": "This is the URL to view the receipt for this charge. The receipt is kept up-to-date to the latest state of the charge, including any refunds. If the charge is for an Invoice, the receipt will be stylized as an Invoice receipt.",
            "maxLength": 5000,
            "nullable": true,
            "type": "string"
          },
          "refunded": {
            "description": "Whether the charge has been fully refunded. If the charge is only partially refunded, this attribute will still be false.",
            "type": "boolean"
          },
          "refunds": {
            "description": "A list of refunds that have been applied to the charge.",
            "nullable": true,
            "properties": {
              "data": {
                "description": "Details about each object.",
                "items": {
                  "description": "Refund objects allow you to refund a previously created charge that isn't\nrefunded yet. Funds are refunded to the credit or debit card that's\ninitially charged.\n\nRelated guide: [Refunds](https://docs.stripe.com/refunds)",
                  "properties": {
                    "amount": {
                      "description": "Amount, in cents (or local equivalent).",
                      "type": "integer"
                    },
                    "balance_transaction": {
                      "anyOf": [
                        {
                          "maxLength": 5000,
                          "type": "string"
                        },
                        {
                          "$ref": "#/components/schemas/balance_transaction"
                        }
                      ],
                      "description": "Balance transaction that describes the impact on your account balance.",
                      "nullable": true,
                      "x-expansionResources": {
                        "oneOf": [
                          {
                            "$ref": "#/components/schemas/balance_transaction"
                          }
                        ]
                      }
                    },
                    "charge": {
                      "anyOf": [
                        {
                          "maxLength": 5000,
                          "type": "string"
                        },
                        {
                          "$ref": "#/components/schemas/charge"
                        }
                      ],
                      "description": "ID of the charge that's refunded.",
                      "nullable": true,
                      "x-expansionResources": {
                        "oneOf": [
                          {
                            "$ref": "#/components/schemas/charge"
                          }
                        ]
                      }
                    },
                    "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. You can use this for displaying to users (available on non-card refunds only).",
                      "maxLength": 5000,
                      "type": "string"
                    },
                    "destination_details": {
                      "description": "",
                      "properties": {
                        "affirm": {
                          "description": "",
                          "properties": {},
                          "title": "destination_details_unimplemented",
                          "type": "object",
                          "x-expandableFields": []
                        },
                        "afterpay_clearpay": {
                          "description": "",
                          "properties": {},
                          "title": "destination_details_unimplemented",
                          "type": "object",
                          "x-expandableFields": []
                        },
                        "alipay": {
                          "description": "",
                          "properties": {},
                          "title": "destination_details_unimplemented",
                          "type": "object",
                          "x-expandableFields": []
                        },
                        "alma": {
                          "description": "",
                          "properties": {},
                          "title": "destination_details_unimplemented",
                          "type": "object",
                          "x-expandableFields": []
                        },
                        "amazon_pay": {
                          "description": "",
                          "properties": {},
                          "title": "destination_details_unimplemented",
                          "type": "object",
                          "x-expandableFields": []
                        },
                        "au_bank_transfer": {
                          "description": "",
                          "properties": {},
                          "title": "destination_details_unimplemented",
                          "type": "object",
                          "x-expandableFields": []
                        },
                        "blik": {
                          "description": "",
                          "properties": {
                            "network_decline_code": {
                              "description": "For refunds declined by the network, a decline code provided by the network which indicates the reason the refund failed.",
                              "maxLength": 5000,
                              "nullable": true,
                              "type": "string"
                            },
                            "reference": {
                              "description": "The reference assigned to the refund.",
                              "maxLength": 5000,
                              "nullable": true,
                              "type": "string"
                            },
                            "reference_status": {
                              "description": "Status of the reference on the refund. This can be `pending`, `available` or `unavailable`.",
                              "maxLength": 5000,
                              "nullable": true,
                              "type": "string"
                            }
                          },
                          "title": "refund_destination_details_blik",
                          "type": "object",
                          "x-expandableFields": []
                        },
                        "br_bank_transfer": {
                          "description": "",
                          "properties": {
                            "reference": {
                              "description": "The reference assigned to the refund.",
                              "maxLength": 5000,
                              "nullable": true,
                              "type": "string"
                            },
                            "reference_status": {
                              "description": "Status of the reference on the refund. This can be `pending`, `available` or `unavailable`.",
                              "maxLength": 5000,
                              "nullable": true,
                              "type": "string"
                            }
                          },
                          "title": "refund_destination_details_br_bank_transfer",
                          "type": "object",
                          "x-expandableFields": []
                        },
                        "card": {
                          "description": "",
                          "properties": {
                            "reference": {
                              "description": "Value of the reference number assigned to the refund.",
                              "maxLength": 5000,
                              "type": "string"
                            },
                            "reference_status": {
                              "description": "Status of the reference number on the refund. This can be `pending`, `available` or `unavailable`.",
                              "maxLength": 5000,
                              "type": "string"
                            },
                            "reference_type": {
                              "description": "Type of the reference number assigned to the refund.",
                              "maxLength": 5000,
                              "type": "string"
                            },
                            "type": {
                              "description": "The type of refund. This can be `refund`, `reversal`, or `pending`.",
                              "enum": [
                                "pending",
                                "refund",
                                "reversal"
                              ],
                              "type": "string"
                            }
                          },
                          "required": [
                            "type"
                          ],
                          "title": "refund_destination_details_card",
                          "type": "object",
                          "x-expandableFields": []
                        },
                        "cashapp": {
                          "description": "",
                          "properties": {},
                          "title": "destination_details_unimplemented",
                          "type": "object",
                          "x-expandableFields": []
                        },
                        "crypto": {
                          "description": "",
                          "properties": {
                            "reference": {
                              "description": "The transaction hash of the refund.",
                              "maxLength": 5000,
                              "nullable": true,
                              "type": "string"
                            }
                          },
                          "title": "refund_destination_details_crypto",
                          "type": "object",
                          "x-expandableFields": []
                        },
                        "customer_cash_balance": {
                          "description": "",
                          "properties": {},
                          "title": "destination_details_unimplemented",
                          "type": "object",
                          "x-expandableFields": []
                        },
                        "eps": {
                          "description": "",
                          "properties": {},
                          "title": "destination_details_unimplemented",
                          "type": "object",
                          "x-expandableFields": []
                        },
                        "eu_bank_transfer": {
                          "description": "",
                          "properties": {
                            "reference": {
                              "description": "The reference assigned to the refund.",
                              "maxLength": 5000,
                              "nullable": true,
                              "type": "string"
                            },
                            "reference_status": {
                              "description": "Status of the reference on the refund. This can be `pending`, `available` or `unavailable`.",
                              "maxLength": 5000,
                              "nullable": true,
                              "type": "string"
                            }
                          },
                          "title": "refund_destination_details_eu_bank_transfer",
                          "type": "object",
                          "x-expandableFields": []
                        },
                        "gb_bank_transfer": {
                          "description": "",
                          "properties": {
                            "reference": {
                              "description": "The reference assigned to the refund.",
                              "maxLength": 5000,
                              "nullable": true,
                              "type": "string"
                            },
                            "reference_status": {
                              "description": "Status of the reference on the refund. This can be `pending`, `available` or `unavailable`.",
                              "maxLength": 5000,
                              "nullable": true,
                              "type": "string"
                            }
                          },
                          "title": "refund_destination_details_gb_bank_transfer",
                          "type": "object",
                          "x-expandableFields": []
                        },
                        "giropay": {
                          "description": "",
                          "properties": {},
                          "title": "destination_details_unimplemented",
                          "type": "object",
                          "x-expandableFields": []
                        },
                        "grabpay": {
                          "description": "",
                          "properties": {},
                          "title": "destination_details_unimplemented",
                          "type": "object",
                          "x-expandableFields": []
                        },
                        "jp_bank_transfer": {
                          "description": "",
                          "properties": {
                            "reference": {
                              "description": "The reference assigned to the refund.",
                              "maxLength": 5000,
                              "nullable": true,
                              "type": "string"
                            },
                            "reference_status": {
                              "description": "Status of the reference on the refund. This can be `pending`, `available` or `unavailable`.",
                              "maxLength": 5000,
                              "nullable": true,
                              "type": "string"
                            }
                          },
                          "title": "refund_destination_details_jp_bank_transfer",
                          "type": "object",
                          "x-expandableFields": []
                        },
                        "klarna": {
                          "description": "",
                          "properties": {},
                          "title": "destination_details_unimplemented",
                          "type": "object",
                          "x-expandableFields": []
                        },
                        "mb_way": {
                          "description": "",
                          "properties": {
                            "reference": {
                              "description": "The reference assigned to the refund.",
                              "maxLength": 5000,
                              "nullable": true,
                              "type": "string"
                            },
                            "reference_status": {
                              "description": "Status of the reference on the refund. This can be `pending`, `available` or `unavailable`.",
                              "maxLength": 5000,
                              "nullable": true,
                              "type": "string"
                            }
                          },
                          "title": "refund_destination_details_mb_way",
                          "type": "object",
                          "x-expandableFields": []
                        },
                        "multibanco": {
                          "description": "",
                          "properties": {
                            "reference": {
                              "description": "The reference assigned to the refund.",
                              "maxLength": 5000,
                              "nullable": true,
                              "type": "string"
                            },
                            "reference_status": {
                              "description": "Status of the reference on the refund. This can be `pending`, `available` or `unavailable`.",
                              "maxLength": 5000,
                              "nullable": true,
                              "type": "string"
                            }
                          },
                          "title": "refund_destination_details_multibanco",
                          "type": "object",
                          "x-expandableFields": []
                        },
                        "mx_bank_transfer": {
                          "description": "",
                          "properties": {
                            "reference": {
                              "description": "The reference assigned to the refund.",
                              "maxLength": 5000,
                              "nullable": true,
                              "type": "string"
                            },
                            "reference_status": {
                              "description": "Status of the reference on the refund. This can be `pending`, `available` or `unavailable`.",
                              "maxLength": 5000,
                              "nullable": true,
                              "type": "string"
                            }
                          },
                          "title": "refund_destination_details_mx_bank_transfer",
                          "type": "object",
                          "x-expandableFields": []
                        },
                        "nz_bank_transfer": {
                          "description": "",
                          "properties": {},
                          "title": "destination_details_unimplemented",
                          "type": "object",
                          "x-expandableFields": []
                        },
                        "p24": {
                          "description": "",
                          "properties": {
                            "reference": {
                              "description": "The reference assigned to the refund.",
                              "maxLength": 5000,
                              "nullable": true,
                              "type": "string"
                            },
                            "reference_status": {
                              "description": "Status of the reference on the refund. This can be `pending`, `available` or `unavailable`.",
                              "maxLength": 5000,
                              "nullable": true,
                              "type": "string"
                            }
                          },
                          "title": "refund_destination_details_p24",
                          "type": "object",
                          "x-expandableFields": []
                        },
                        "paynow": {
                          "description": "",
                          "properties": {},
                          "title": "destination_details_unimplemented",
                          "type": "object",
                          "x-expandableFields": []
                        },
                        "paypal": {
                          "description": "",
                          "properties": {
                            "network_decline_code": {
                              "description": "For refunds declined by the network, a decline code provided by the network which indicates the reason the refund failed.",
                              "maxLength": 5000,
                              "nullable": true,
                              "type": "string"
                            }
                          },
                          "title": "refund_destination_details_paypal",
                          "type": "object",
                          "x-expandableFields": []
                        },
                        "pix": {
                          "description": "",
                          "properties": {},
                          "title": "destination_details_unimplemented",
                          "type": "object",
                          "x-expandableFields": []
                        },
                        "revolut": {
                          "description": "",
                          "properties": {},
                          "title": "destination_details_unimplemented",
                          "type": "object",
                          "x-expandableFields": []
                        },
                        "sofort": {
                          "description": "",
                          "properties": {},
                          "title": "destination_details_unimplemented",
                          "type": "object",
                          "x-expandableFields": []
                        },
                        "swish": {
                          "description": "",
                          "properties": {
                            "network_decline_code": {
                              "description": "For refunds declined by the network, a decline code provided by the network which indicates the reason the refund failed.",
                              "maxLength": 5000,
                              "nullable": true,
                              "type": "string"
                            },
                            "reference": {
                              "description": "The reference assigned to the refund.",
                              "maxLength": 5000,
                              "nullable": true,
                              "type": "string"
                            },
                            "reference_status": {
                              "description": "Status of the reference on the refund. This can be `pending`, `available` or `unavailable`.",
                              "maxLength": 5000,
                              "nullable": true,
                              "type": "string"
                            }
                          },
                          "title": "refund_destination_details_swish",
                          "type": "object",
                          "x-expandableFields": []
                        },
                        "th_bank_transfer": {
                          "description": "",
                          "properties": {
                            "reference": {
                              "description": "The reference assigned to the refund.",
                              "maxLength": 5000,
                              "nullable": true,
                              "type": "string"
                            },
                            "reference_status": {
                              "description": "Status of the reference on the refund. This can be `pending`, `available` or `unavailable`.",
                              "maxLength": 5000,
                              "nullable": true,
                              "type": "string"
                            }
                          },
                          "title": "refund_destination_details_th_bank_transfer",
                          "type": "object",
                          "x-expandableFields": []
                        },
                        "twint": {
                          "description": "",
                          "properties": {},
                          "title": "destination_details_unimplemented",
                          "type": "object",
                          "x-expandableFields": []
                        },
                        "type": {
                          "description": "The type of transaction-specific details of the payment method used in the refund (e.g., `card`). An additional hash is included on `destination_details` with a name matching this value. It contains information specific to the refund transaction.",
                          "maxLength": 5000,
                          "type": "string"
                        },
                        "us_bank_transfer": {
                          "description": "",
                          "properties": {
                            "reference": {
                              "description": "The reference assigned to the refund.",
                              "maxLength": 5000,
                              "nullable": true,
                              "type": "string"
                            },
                            "reference_status": {
                              "description": "Status of the reference on the refund. This can be `pending`, `available` or `unavailable`.",
                              "maxLength": 5000,
                              "nullable": true,
                              "type": "string"
                            }
                          },
                          "title": "refund_destination_details_us_bank_transfer",
                          "type": "object",
                          "x-expandableFields": []
                        },
                        "wechat_pay": {
                          "description": "",
                          "properties": {},
                          "title": "destination_details_unimplemented",
                          "type": "object",
                          "x-expandableFields": []
                        },
                        "zip": {
                          "description": "",
                          "properties": {},
                          "title": "destination_details_unimplemented",
                          "type": "object",
                          "x-expandableFields": []
                        }
                      },
                      "required": [
                        "type"
                      ],
                      "title": "refund_destination_details",
                      "type": "object",
                      "x-expandableFields": [
                        "affirm",
                        "afterpay_clearpay",
                        "alipay",
                        "alma",
                        "amazon_pay",
                        "au_bank_transfer",
                        "blik",
                        "br_bank_transfer",
                        "card",
                        "cashapp",
                        "crypto",
                        "customer_cash_balance",
                        "eps",
                        "eu_bank_transfer",
                        "gb_bank_transfer",
                        "giropay",
                        "grabpay",
                        "jp_bank_transfer",
                        "klarna",
                        "mb_way",
                        "multibanco",
                        "mx_bank_transfer",
                        "nz_bank_transfer",
                        "p24",
                        "paynow",
                        "paypal",
                        "pix",
                        "revolut",
                        "sofort",
                        "swish",
                        "th_bank_transfer",
                        "twint",
                        "us_bank_transfer",
                        "wechat_pay",
                        "zip"
                      ]
                    },
                    "failure_balance_transaction": {
                      "anyOf": [
                        {
                          "maxLength": 5000,
                          "type": "string"
                        },
                        {
                          "$ref": "#/components/schemas/balance_transaction"
                        }
                      ],
                      "description": "After the refund fails, this balance transaction describes the adjustment made on your account balance that reverses the initial balance transaction.",
                      "x-expansionResources": {
                        "oneOf": [
                          {
                            "$ref": "#/components/schemas/balance_transaction"
                          }
                        ]
                      }
                    },
                    "failure_reason": {
                      "description": "Provides the reason for the refund failure. Possible values are: `lost_or_stolen_card`, `expired_or_canceled_card`, `charge_for_pending_refund_disputed`, `insufficient_funds`, `declined`, `merchant_request`, or `unknown`.",
                      "maxLength": 5000,
                      "type": "string"
                    },
                    "id": {
                      "description": "Unique identifier for the object.",
                      "maxLength": 5000,
                      "type": "string"
                    },
                    "instructions_email": {
                      "description": "For payment methods without native refund support (for example, Konbini, PromptPay), provide an email address for the customer to receive refund instructions.",
                      "maxLength": 5000,
                      "type": "string"
                    },
                    "metadata": {
                      "additionalProperties": {
                        "maxLength": 500,
                        "type": "string"
                      },
                      "description": "Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.",
                      "nullable": true,
                      "type": "object"
                    },
                    "next_action": {
                      "description": "",
                      "properties": {
                        "display_details": {
                          "description": "",
                          "properties": {
                            "email_sent": {
                              "description": "",
                              "properties": {
                                "email_sent_at": {
                                  "description": "The timestamp when the email was sent.",
                                  "format": "unix-time",
                                  "type": "integer"
                                },
                                "email_sent_to": {
                                  "description": "The recipient's email address.",
                                  "maxLength": 5000,
                                  "type": "string"
                                }
                              },
                              "required": [
                                "email_sent_at",
                                "email_sent_to"
                              ],
                              "title": "EmailSent",
                              "type": "object",
                              "x-expandableFields": []
                            },
                            "expires_at": {
                              "description": "The expiry timestamp.",
                              "format": "unix-time",
                              "type": "integer"
                            }
                          },
                          "required": [
                            "email_sent",
                            "expires_at"
                          ],
                          "title": "RefundNextActionDisplayDetails",
                          "type": "object",
                          "x-expandableFields": [
                            "email_sent"
                          ]
                        },
                        "type": {
                          "description": "Type of the next action to perform.",
                          "maxLength": 5000,
                          "type": "string"
                        }
                      },
                      "required": [
                        "type"
                      ],
                      "title": "RefundNextAction",
                      "type": "object",
                      "x-expandableFields": [
                        "display_details"
                      ]
                    },
                    "object": {
                      "description": "String representing the object's type. Objects of the same type share the same value.",
                      "enum": [
                        "refund"
                      ],
                      "type": "string"
                    },
                    "payment_intent": {
                      "anyOf": [
                        {
                          "maxLength": 5000,
                          "type": "string"
                        },
                        {
                          "$ref": "#/components/schemas/payment_intent"
                        }
                      ],
                      "description": "ID of the PaymentIntent that's refunded.",
                      "nullable": true,
                      "x-expansionResources": {
                        "oneOf": [
                          {
                            "$ref": "#/components/schemas/payment_intent"
                          }
                        ]
                      }
                    },
                    "pending_reason": {
                      "description": "Provides the reason for why the refund is pending. Possible values are: `processing`, `insufficient_funds`, or `charge_pending`.",
                      "enum": [
                        "charge_pending",
                        "insufficient_funds",
                        "processing"
                      ],
                      "type": "string"
                    },
                    "presentment_details": {
                      "description": "",
                      "properties": {
                        "presentment_amount": {
                          "description": "Amount intended to be collected by this payment, denominated in `presentment_currency`.",
                          "type": "integer"
                        },
                        "presentment_currency": {
                          "description": "Currency presented to the customer during payment.",
                          "maxLength": 5000,
                          "type": "string"
                        }
                      },
                      "required": [
                        "presentment_amount",
                        "presentment_currency"
                      ],
                      "title": "PaymentFlowsPaymentIntentPresentmentDetails",
                      "type": "object",
                      "x-expandableFields": []
                    },
                    "reason": {
                      "description": "Reason for the refund, which is either user-provided (`duplicate`, `fraudulent`, or `requested_by_customer`) or generated by Stripe internally (`expired_uncaptured_charge`).",
                      "enum": [
                        "duplicate",
                        "expired_uncaptured_charge",
                        "fraudulent",
                        "requested_by_customer"
                      ],
                      "nullable": true,
                      "type": "string",
                      "x-stripeBypassValidation": true
                    },
                    "receipt_number": {
                      "description": "This is the transaction number that appears on email receipts sent for this refund.",
                      "maxLength": 5000,
                      "nullable": true,
                      "type": "string"
                    },
                    "source_transfer_reversal": {
                      "anyOf": [
                        {
                          "maxLength": 5000,
                          "type": "string"
                        },
                        {
                          "$ref": "#/components/schemas/transfer_reversal"
                        }
                      ],
                      "description": "The transfer reversal that's associated with the refund. Only present if the charge came from another Stripe account.",
                      "nullable": true,
                      "x-expansionResources": {
                        "oneOf": [
                          {
                            "$ref": "#/components/schemas/transfer_reversal"
                          }
                        ]
                      }
                    },
                    "status": {
                      "description": "Status of the refund. This can be `pending`, `requires_action`, `succeeded`, `failed`, or `canceled`. Learn more about [failed refunds](https://docs.stripe.com/refunds#failed-refunds).",
                      "maxLength": 5000,
                      "nullable": true,
                      "type": "string"
                    },
                    "transfer_reversal": {
                      "anyOf": [
                        {
                          "maxLength": 5000,
                          "type": "string"
                        },
                        {
                          "$ref": "#/components/schemas/transfer_reversal"
                        }
                      ],
                      "description": "This refers to the transfer reversal object if the accompanying transfer reverses. This is only applicable if the charge was created using the destination parameter.",
                      "nullable": true,
                      "x-expansionResources": {
                        "oneOf": [
                          {
                            "$ref": "#/components/schemas/transfer_reversal"
                          }
                        ]
                      }
                    }
                  },
                  "required": [
                    "amount",
                    "created",
                    "currency",
                    "id",
                    "object"
                  ],
                  "title": "Refund",
                  "type": "object",
                  "x-expandableFields": [
                    "balance_transaction",
                    "charge",
                    "destination_details",
                    "failure_balance_transaction",
                    "next_action",
                    "payment_intent",
                    "presentment_details",
                    "source_transfer_reversal",
                    "transfer_reversal"
                  ],
                  "x-resourceId": "refund"
                },
                "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,
                "type": "string"
              }
            },
            "required": [
              "data",
              "has_more",
              "object",
              "url"
            ],
            "title": "RefundList",
            "type": "object",
            "x-expandableFields": [
              "data"
            ]
          },
          "review": {
            "anyOf": [
              {
                "maxLength": 5000,
                "type": "string"
              },
              {
                "$ref": "#/components/schemas/review"
              }
            ],
            "description": "ID of the review associated with this charge if one exists.",
            "nullable": true,
            "x-expansionResources": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/review"
                }
              ]
            }
          },
          "shipping": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/shipping"
              }
            ],
            "description": "Shipping information for the charge.",
            "nullable": true
          },
          "source_transfer": {
            "anyOf": [
              {
                "maxLength": 5000,
                "type": "string"
              },
              {
                "$ref": "#/components/schemas/transfer"
              }
            ],
            "description": "The transfer ID which created this charge. Only present if the charge came from another Stripe account. [See the Connect documentation](https://docs.stripe.com/connect/destination-charges) for details.",
            "nullable": true,
            "x-expansionResources": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/transfer"
                }
              ]
            }
          },
          "statement_descriptor": {
            "description": "For a non-card charge, text that appears on the customer's statement as the statement descriptor. This value overrides the account's default statement descriptor. For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors).\n\nFor a card charge, this value is ignored unless you don't specify a `statement_descriptor_suffix`, in which case this value is used as the suffix.",
            "maxLength": 5000,
            "nullable": true,
            "type": "string"
          },
          "statement_descriptor_suffix": {
            "description": "Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. If the account has no prefix value, the suffix is concatenated to the account's statement descriptor.",
            "maxLength": 5000,
            "nullable": true,
            "type": "string"
          },
          "status": {
            "description": "The status of the payment is either `succeeded`, `pending`, or `failed`.",
            "enum": [
              "failed",
              "pending",
              "succeeded"
            ],
            "type": "string"
          },
          "transfer": {
            "anyOf": [
              {
                "maxLength": 5000,
                "type": "string"
              },
              {
                "$ref": "#/components/schemas/transfer"
              }
            ],
            "description": "ID of the transfer to the `destination` account (only applicable if the charge was created using the `destination` parameter).",
            "x-expansionResources": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/transfer"
                }
              ]
            }
          },
          "transfer_data": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/charge_transfer_data"
              }
            ],
            "description": "An optional dictionary including the account to automatically transfer to as part of a destination charge. [See the Connect documentation](https://docs.stripe.com/connect/destination-charges) for details.",
            "nullable": true
          },
          "transfer_group": {
            "description": "A string that identifies this transaction as part of a group. See the [Connect documentation](https://docs.stripe.com/connect/separate-charges-and-transfers#transfer-options) for details.",
            "maxLength": 5000,
            "nullable": true,
            "type": "string"
          }
        },
        "required": [
          "amount",
          "amount_captured",
          "amount_refunded",
          "billing_details",
          "captured",
          "created",
          "currency",
          "disputed",
          "id",
          "livemode",
          "metadata",
          "object",
          "paid",
          "refunded",
          "status"
        ],
        "title": "Charge",
        "type": "object",
        "x-expandableFields": [
          "application",
          "application_fee",
          "balance_transaction",
          "billing_details",
          "customer",
          "failure_balance_transaction",
          "fraud_details",
          "on_behalf_of",
          "outcome",
          "payment_intent",
          "payment_method_details",
          "presentment_details",
          "radar_options",
          "refunds",
          "review",
          "shipping",
          "source_transfer",
          "transfer",
          "transfer_data"
        ],
        "x-resourceId": "charge"
      },
      "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/charges",
      "type": "string"
    }
  },
  "required": [
    "data",
    "has_more",
    "object",
    "url"
  ],
  "title": "ChargeList",
  "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('getCharges', {
    # Add required parameters here
})