Open Context Protocol is live! ๐Ÿš€ Read the launch post
getSetupIntentsIntent

getSetupIntentsIntent

Retrieve a SetupIntent

Details

  • Method: GET
  • Path: /v1/setup_intents/{intent}
  • Operation ID: GetSetupIntentsIntent

Parameters

{
  "client_secret": {
    "description": "The client secret of the SetupIntent. We require this string if you use a publishable key to retrieve the SetupIntent.",
    "required": false,
    "location": "query",
    "type": "string"
  },
  "expand": {
    "description": "Specifies which fields in the response should be expanded.",
    "required": false,
    "location": "query",
    "type": "array"
  },
  "intent": {
    "description": "",
    "required": true,
    "location": "path",
    "type": "string"
  }
}

Response Schema

{
  "description": "A SetupIntent guides you through the process of setting up and saving a customer's payment credentials for future payments.\nFor example, you can use a SetupIntent to set up and save your customer's card without immediately collecting a payment.\nLater, you can use [PaymentIntents](https://api.stripe.com#payment_intents) to drive the payment flow.\n\nCreate a SetupIntent when you're ready to collect your customer's payment credentials.\nDon't maintain long-lived, unconfirmed SetupIntents because they might not be valid.\nThe SetupIntent transitions through multiple [statuses](https://docs.stripe.com/payments/intents#intent-statuses) as it guides\nyou through the setup process.\n\nSuccessful SetupIntents result in payment credentials that are optimized for future payments.\nFor example, cardholders in [certain regions](https://stripe.com/guides/strong-customer-authentication) might need to be run through\n[Strong Customer Authentication](https://docs.stripe.com/strong-customer-authentication) during payment method collection\nto streamline later [off-session payments](https://docs.stripe.com/payments/setup-intents).\nIf you use the SetupIntent with a [Customer](https://api.stripe.com#setup_intent_object-customer),\nit automatically attaches the resulting payment method to that Customer after successful setup.\nWe recommend using SetupIntents or [setup_future_usage](https://api.stripe.com#payment_intent_object-setup_future_usage) on\nPaymentIntents to save payment methods to prevent saving invalid or unoptimized payment methods.\n\nBy using SetupIntents, you can reduce friction for your customers, even as regulations change over time.\n\nRelated guide: [Setup Intents API](https://docs.stripe.com/payments/setup-intents)",
  "properties": {
    "application": {
      "anyOf": [
        {
          "maxLength": 5000,
          "type": "string"
        },
        {
          "$ref": "#/components/schemas/application"
        }
      ],
      "description": "ID of the Connect application that created the SetupIntent.",
      "nullable": true,
      "x-expansionResources": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/application"
          }
        ]
      }
    },
    "attach_to_self": {
      "description": "If present, the SetupIntent's payment method will be attached to the in-context Stripe Account.\n\nIt can only be used for this Stripe Accountโ€™s own money movement flows like InboundTransfer and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer.",
      "type": "boolean"
    },
    "automatic_payment_methods": {
      "anyOf": [
        {
          "$ref": "#/components/schemas/payment_flows_automatic_payment_methods_setup_intent"
        }
      ],
      "description": "Settings for dynamic payment methods compatible with this Setup Intent",
      "nullable": true
    },
    "cancellation_reason": {
      "description": "Reason for cancellation of this SetupIntent, one of `abandoned`, `requested_by_customer`, or `duplicate`.",
      "enum": [
        "abandoned",
        "duplicate",
        "requested_by_customer"
      ],
      "nullable": true,
      "type": "string"
    },
    "client_secret": {
      "description": "The client secret of this SetupIntent. Used for client-side retrieval using a publishable key.\n\nThe client secret can be used to complete payment setup from your frontend. It should not be stored, logged, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret.",
      "maxLength": 5000,
      "nullable": true,
      "type": "string"
    },
    "created": {
      "description": "Time at which the object was created. Measured in seconds since the Unix epoch.",
      "format": "unix-time",
      "type": "integer"
    },
    "customer": {
      "anyOf": [
        {
          "maxLength": 5000,
          "type": "string"
        },
        {
          "$ref": "#/components/schemas/customer"
        },
        {
          "$ref": "#/components/schemas/deleted_customer"
        }
      ],
      "description": "ID of the Customer this SetupIntent belongs to, if one exists.\n\nIf present, the SetupIntent's payment method will be attached to the Customer on successful setup. Payment methods attached to other Customers cannot be used with this SetupIntent.",
      "nullable": true,
      "x-expansionResources": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/customer"
          },
          {
            "$ref": "#/components/schemas/deleted_customer"
          }
        ]
      }
    },
    "customer_account": {
      "description": "ID of the Account this SetupIntent belongs to, if one exists.\n\nIf present, the SetupIntent's payment method will be attached to the Account on successful setup. Payment methods attached to other Accounts cannot be used with this SetupIntent.",
      "maxLength": 5000,
      "nullable": true,
      "type": "string"
    },
    "description": {
      "description": "An arbitrary string attached to the object. Often useful for displaying to users.",
      "maxLength": 5000,
      "nullable": true,
      "type": "string"
    },
    "excluded_payment_method_types": {
      "description": "Payment method types that are excluded from this SetupIntent.",
      "items": {
        "enum": [
          "acss_debit",
          "affirm",
          "afterpay_clearpay",
          "alipay",
          "alma",
          "amazon_pay",
          "au_becs_debit",
          "bacs_debit",
          "bancontact",
          "billie",
          "blik",
          "boleto",
          "card",
          "cashapp",
          "crypto",
          "customer_balance",
          "eps",
          "fpx",
          "giropay",
          "grabpay",
          "ideal",
          "kakao_pay",
          "klarna",
          "konbini",
          "kr_card",
          "mb_way",
          "mobilepay",
          "multibanco",
          "naver_pay",
          "nz_bank_account",
          "oxxo",
          "p24",
          "pay_by_bank",
          "payco",
          "paynow",
          "paypal",
          "payto",
          "pix",
          "promptpay",
          "revolut_pay",
          "samsung_pay",
          "satispay",
          "sepa_debit",
          "sofort",
          "swish",
          "twint",
          "us_bank_account",
          "wechat_pay",
          "zip"
        ],
        "type": "string",
        "x-stripeBypassValidation": true
      },
      "nullable": true,
      "type": "array"
    },
    "flow_directions": {
      "description": "Indicates the directions of money movement for which this payment method is intended to be used.\n\nInclude `inbound` if you intend to use the payment method as the origin to pull funds from. Include `outbound` if you intend to use the payment method as the destination to send funds to. You can include both if you intend to use the payment method for both purposes.",
      "items": {
        "enum": [
          "inbound",
          "outbound"
        ],
        "type": "string"
      },
      "nullable": true,
      "type": "array"
    },
    "id": {
      "description": "Unique identifier for the object.",
      "maxLength": 5000,
      "type": "string"
    },
    "last_setup_error": {
      "anyOf": [
        {
          "$ref": "#/components/schemas/api_errors"
        }
      ],
      "description": "The error encountered in the previous SetupIntent confirmation.",
      "nullable": true
    },
    "latest_attempt": {
      "anyOf": [
        {
          "maxLength": 5000,
          "type": "string"
        },
        {
          "$ref": "#/components/schemas/setup_attempt"
        }
      ],
      "description": "The most recent SetupAttempt for this SetupIntent.",
      "nullable": true,
      "x-expansionResources": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/setup_attempt"
          }
        ]
      }
    },
    "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"
    },
    "mandate": {
      "anyOf": [
        {
          "maxLength": 5000,
          "type": "string"
        },
        {
          "$ref": "#/components/schemas/mandate"
        }
      ],
      "description": "ID of the multi use Mandate generated by the SetupIntent.",
      "nullable": true,
      "x-expansionResources": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/mandate"
          }
        ]
      }
    },
    "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": {
      "anyOf": [
        {
          "$ref": "#/components/schemas/setup_intent_next_action"
        }
      ],
      "description": "If present, this property tells you what actions you need to take in order for your customer to continue payment setup.",
      "nullable": true
    },
    "object": {
      "description": "String representing the object's type. Objects of the same type share the same value.",
      "enum": [
        "setup_intent"
      ],
      "type": "string"
    },
    "on_behalf_of": {
      "anyOf": [
        {
          "maxLength": 5000,
          "type": "string"
        },
        {
          "$ref": "#/components/schemas/account"
        }
      ],
      "description": "The account (if any) for which the setup is intended.",
      "nullable": true,
      "x-expansionResources": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/account"
          }
        ]
      }
    },
    "payment_method": {
      "anyOf": [
        {
          "maxLength": 5000,
          "type": "string"
        },
        {
          "$ref": "#/components/schemas/payment_method"
        }
      ],
      "description": "ID of the payment method used with this SetupIntent. If the payment method is `card_present` and isn't a digital wallet, then the [generated_card](https://docs.stripe.com/api/setup_attempts/object#setup_attempt_object-payment_method_details-card_present-generated_card) associated with the `latest_attempt` is attached to the Customer instead.",
      "nullable": true,
      "x-expansionResources": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/payment_method"
          }
        ]
      }
    },
    "payment_method_configuration_details": {
      "anyOf": [
        {
          "$ref": "#/components/schemas/payment_method_config_biz_payment_method_configuration_details"
        }
      ],
      "description": "Information about the [payment method configuration](https://docs.stripe.com/api/payment_method_configurations) used for this Setup Intent.",
      "nullable": true
    },
    "payment_method_options": {
      "anyOf": [
        {
          "$ref": "#/components/schemas/setup_intent_payment_method_options"
        }
      ],
      "description": "Payment method-specific configuration for this SetupIntent.",
      "nullable": true
    },
    "payment_method_types": {
      "description": "The list of payment method types (e.g. card) that this SetupIntent is allowed to set up. A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type).",
      "items": {
        "maxLength": 5000,
        "type": "string"
      },
      "type": "array"
    },
    "single_use_mandate": {
      "anyOf": [
        {
          "maxLength": 5000,
          "type": "string"
        },
        {
          "$ref": "#/components/schemas/mandate"
        }
      ],
      "description": "ID of the single_use Mandate generated by the SetupIntent.",
      "nullable": true,
      "x-expansionResources": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/mandate"
          }
        ]
      }
    },
    "status": {
      "description": "[Status](https://docs.stripe.com/payments/intents#intent-statuses) of this SetupIntent, one of `requires_payment_method`, `requires_confirmation`, `requires_action`, `processing`, `canceled`, or `succeeded`.",
      "enum": [
        "canceled",
        "processing",
        "requires_action",
        "requires_confirmation",
        "requires_payment_method",
        "succeeded"
      ],
      "type": "string"
    },
    "usage": {
      "description": "Indicates how the payment method is intended to be used in the future.\n\nUse `on_session` if you intend to only reuse the payment method when the customer is in your checkout flow. Use `off_session` if your customer may or may not be in your checkout flow. If not provided, this value defaults to `off_session`.",
      "maxLength": 5000,
      "type": "string"
    }
  },
  "required": [
    "created",
    "id",
    "livemode",
    "object",
    "payment_method_types",
    "status",
    "usage"
  ],
  "title": "SetupIntent",
  "type": "object",
  "x-expandableFields": [
    "application",
    "automatic_payment_methods",
    "customer",
    "last_setup_error",
    "latest_attempt",
    "mandate",
    "next_action",
    "on_behalf_of",
    "payment_method",
    "payment_method_configuration_details",
    "payment_method_options",
    "single_use_mandate"
  ],
  "x-resourceId": "setup_intent"
}

Usage

from ocp_agent import OCPAgent

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

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