Skip to content

Stripe: Update a source

Stripe sources.postSourcesSource: arguments, response, policy and SDK examples.

← Sources operations · Get started

Operation stripe.postsourcessource

Provider route: POST /v1/sources/{source}. Alter supplies the connection’s credentials and routing.

Install @alter-ai/sdk @alter-ai/stripe with npm, or alter-sdk-stripe with pip. Supply your connected customer’s grant ID and the arguments described below.

import { App } from "@alter-ai/sdk";
import { StripeIntegration } from "@alter-ai/stripe";
async function execute(input: Parameters<StripeIntegration["sources"]["postSourcesSource"]>[0]) {
const app = new App({ apiKey: process.env.ALTER_API_KEY! });
try {
const provider = new StripeIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! });
const call = await provider.sources.postSourcesSource(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from alter_sdk_stripe import StripeIntegration
async def execute(arguments):
async with App(api_key=os.environ["ALTER_API_KEY"]) as app:
provider = StripeIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]})
call = await provider.sources.post_sources_source(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.sourcestringRequired within parentMaximum length: 5000
headersobjectOptionalAdditional keys: not allowed
headers.Idempotency-KeystringOptionalMinimum length: 1
Maximum length: 255
bodyobjectOptionalAdditional keys: not allowed
body.amountintegerOptionalAmount associated with the source.
body.expandarrayOptionalSpecifies which fields in the response should be expanded.
body.expand[]stringEach itemMaximum length: 5000
body.mandateModelOptionalExpand Create a source — request body — body mandate
body.metadataJSONOptionalSet 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. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
body.metadata (anyOf 1)objectAlternativeAdditional keys: see wildcard field
body.metadata (anyOf 1).*stringAdditional keys
body.metadata (anyOf 2)stringAlternativeOne of:
body.ownerModelOptionalExpand Create a source — request body — body owner
body.source_orderModelOptionalExpand Create a source — request body — body source order

Referenced models: Create a source — request body — body mandate, Create a source — request body — body owner, Create a source — request body — body source order

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$ModelRootExpand Create a source — response body

Referenced models: Create a source — response body

24 more schemas are linked from the tables above, on the schema pages.

Create a source — request body — body mandate
FieldTypePresenceDescription and constraints
$objectRootInformation about a mandate possibility attached to a source object (generally for bank debits) as well as its acceptance status.
acceptanceModelOptionalExpand Create a source — request body — body mandate acceptance
amountJSONOptional
amount (anyOf 1)integerAlternative
amount (anyOf 2)stringAlternativeOne of:
currencystringOptionalFormat: currency
intervalstringOptionalOne of: one_time, scheduled, variable
Maximum length: 5000
notification_methodstringOptionalOne of: deprecated_none, email, manual, none, stripe_email
Maximum length: 5000

Referenced models: Create a source — request body — body mandate acceptance

Create a source — request body — body owner
FieldTypePresenceDescription and constraints
$objectRootInformation about the owner of the payment instrument that may be used or required by particular source types.
addressobjectOptional
address.citystringOptionalMaximum length: 5000
address.countrystringOptionalMaximum length: 5000
address.line1stringOptionalMaximum length: 5000
address.line2stringOptionalMaximum length: 5000
address.postal_codestringOptionalMaximum length: 5000
address.statestringOptionalMaximum length: 5000
emailstringOptional
namestringOptionalMaximum length: 5000
phonestringOptionalMaximum length: 5000
Create a source — request body — body source order
FieldTypePresenceDescription and constraints
$objectRootInformation about the items and shipping associated with the source. Required for transactional credit (for example Klarna) sources before you can charge it.
itemsarrayOptional
items[]objectEach item
items[].amountintegerOptional
items[].currencystringOptionalFormat: currency
items[].descriptionstringOptionalMaximum length: 1000
items[].parentstringOptionalMaximum length: 5000
items[].quantityintegerOptional
items[].typestringOptionalOne of: discount, shipping, sku, tax
Maximum length: 5000
shippingModelOptionalExpand Create a source — request body — body source order shipping

Referenced models: Create a source — request body — body source order shipping

Create a source — response body — code verification
FieldTypePresenceDescription and constraints
$objectRoot
attempts_remainingJSONRequired within parent
attempts_remaining (anyOf 1)integerAlternativeThe number of attempts remaining to authenticate the source object with a verification code.
attempts_remaining (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
statusstringRequired within parentThe status of the code verification, either `pending` (awaiting verification, `attempts_remaining` should be greater than 0), `succeeded` (successful verification) or `failed` (failed verification, cannot be verified anymore as `attempts_remaining` should be 0).
Maximum length: 5000
Create a source — response body — source order
FieldTypePresenceDescription and constraints
$objectRoot
amountJSONRequired within parent
amount (anyOf 1)integerAlternativeA positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount for the order.
amount (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
currencystringRequired within parentThree-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
emailstringOptionalThe email address of the customer placing the order.
Maximum length: 5000
itemsJSONOptional
items (anyOf 1)arrayAlternativeList of items constituting the order.
items (anyOf 1)[]ModelEach itemExpand Create a source — response body — source order items List of items constituting the order item
items (anyOf 2)nullAlternative
shippingModelOptionalExpand Create a source — response body — source order shipping

Referenced models: Create a source — response body — source order shipping, Create a source — response body — source order items List of items constituting the order item

Create a source — response body — owner value address, email, name, phone, verified address, verified email, verified name, verified phone
FieldTypePresenceDescription and constraints
$objectRoot
addressJSONOptional
address (anyOf 1)JSONAlternativeOwner's address.
address (anyOf 1) (anyOf 1)ModelAlternativeExpand Create a Location — response body — address
address (anyOf 2)nullAlternative
emailJSONOptional
email (anyOf 1)stringAlternativeOwner's email address.
Maximum length: 5000
email (anyOf 2)nullAlternative
nameJSONOptional
name (anyOf 1)stringAlternativeOwner's full name.
Maximum length: 5000
name (anyOf 2)nullAlternative
phoneJSONOptional
phone (anyOf 1)stringAlternativeOwner's phone number (including extension).
Maximum length: 5000
phone (anyOf 2)nullAlternative
verified_addressJSONOptional
verified_address (anyOf 1)JSONAlternativeVerified owner's address. Verified values are verified or provided by the payment method directly (and if supported) at the time of authorization or settlement. They cannot be set or mutated.
verified_address (anyOf 1) (anyOf 1)ModelAlternativeExpand Create a Location — response body — address
verified_address (anyOf 2)nullAlternative
verified_emailJSONOptional
verified_email (anyOf 1)stringAlternativeVerified owner's email address. Verified values are verified or provided by the payment method directly (and if supported) at the time of authorization or settlement. They cannot be set or mutated.
Maximum length: 5000
verified_email (anyOf 2)nullAlternative
verified_nameJSONOptional
verified_name (anyOf 1)stringAlternativeVerified owner's full name. Verified values are verified or provided by the payment method directly (and if supported) at the time of authorization or settlement. They cannot be set or mutated.
Maximum length: 5000
verified_name (anyOf 2)nullAlternative
verified_phoneJSONOptional
verified_phone (anyOf 1)stringAlternativeVerified owner's phone number (including extension). Verified values are verified or provided by the payment method directly (and if supported) at the time of authorization or settlement. They cannot be set or mutated.
Maximum length: 5000
verified_phone (anyOf 2)nullAlternative

Referenced models: Create a Location — response body — address

Create a source — response body — redirect
FieldTypePresenceDescription and constraints
$objectRoot
failure_reasonJSONOptional
failure_reason (anyOf 1)stringAlternativeThe failure reason for the redirect, either `user_abort` (the customer aborted or dropped out of the redirect flow), `declined` (the authentication failed or the transaction was declined), or `processing_error` (the redirect failed due to a technical error). Present only if the redirect status is `failed`.
Maximum length: 5000
failure_reason (anyOf 2)nullAlternative
return_urlstringRequired within parentThe URL you provide to redirect the customer to after they authenticated their payment.
Maximum length: 5000
statusstringRequired within parentThe status of the redirect, either `pending` (ready to be used by your customer to authenticate the transaction), `succeeded` (successful authentication, cannot be reused) or `not_required` (redirect should not be used) or `failed` (failed authentication, cannot be reused).
Maximum length: 5000
urlstringRequired within parentThe URL provided to you to redirect a customer to as part of a `redirect` authentication flow.
Maximum length: 2048
Create a source — response body — eps
FieldTypePresenceDescription and constraints
$objectRoot
referenceJSONOptional
reference (anyOf 1)stringAlternative
reference (anyOf 2)nullAlternative
statement_descriptorJSONOptional
statement_descriptor (anyOf 1)stringAlternative
statement_descriptor (anyOf 2)nullAlternative

SDK function policy ID: stripe.postsourcessource. Catalog operation: PostSourcesSource. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.

Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.

Pinned headers: {"Stripe-Version": "2026-09-30.endive"}

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.