POST /v1/subscriptions/{id}/payment-method-update-link endpoint creates a short-lived hosted page where a donor can update only the payment method for an active subscription. This endpoint requires the subscriptions:write permission on your API key.
Use this endpoint when your integration has authenticated the donor in your own app and you want CharityStack to securely collect the new card or bank account details.
Request
Headers
Bearer token using your API key. Format:
Bearer cs_live_your_key.Must be
application/json.Path parameters
The unique identifier of the active subscription to update.
Request body
All body fields are optional. If you omit the body, CharityStack creates a 60-minute link that allows card and bank updates.Delivery mode for the update session. The only supported value is
link.HTTPS URL where the hosted page can send the donor after success or cancellation.
http://localhost, http://127.0.0.1, and http://[::1] are accepted for local development only. CharityStack stores the URL origin at link creation and validates it before rendering the return button.Link lifetime in minutes. Accepted values are
30 through 1440.Payment methods the donor may choose on the hosted page. Accepted values are
CARD and PAY_BY_BANK.Response
201 - created
Unique ID for the payment method update session.
Hosted CharityStack URL for the donor. This URL includes the session token.
ISO 8601 timestamp when the link expires.
Safe summary of the subscription attached to the update session.
Examples
Sample response
Hosted update flow
The donor opens the returned hosted URL and chooses one of the allowed payment methods. The hosted page collects payment details with the payment processor’s client-side tools:| Processor | Method | Collection flow |
|---|---|---|
STRIPE | CARD | Stripe Elements creates and confirms a SetupIntent. |
STRIPE | PAY_BY_BANK | Stripe hosted bank account collection links a US bank account and confirms the SetupIntent when instant verification succeeds. |
FINIX | CARD | Finix hosted tokenization fields return a Finix token, which CharityStack uses to create the payment instrument. |
FINIX | PAY_BY_BANK | Plaid Link returns a Plaid public token and selected account ID. CharityStack exchanges the token with Plaid Auth and creates the Finix bank payment instrument server-side. |
The hosted page never renders raw bank account or routing number inputs. The Public API also never receives raw card numbers, raw bank account numbers, or raw routing numbers.
Completion and webhooks
When the donor successfully saves a new payment method, CharityStack updates the subscription payment fields and marks the update session asCOMPLETED. The link cannot be reused after completion.
Completion emits two webhook events:
| Event | Purpose |
|---|---|
subscription.payment_method_updated | Dedicated payment-method update event with a safe summary payload. |
subscription.updated | Backward-compatible subscription update event for existing webhook consumers. |
subscription.payment_method_updated payload excludes provider identifiers such as payment instrument IDs, buyer/customer IDs, Stripe account IDs, Stripe SetupIntent IDs, and Finix instrument IDs.
Response codes
| Code | Meaning |
|---|---|
201 | Hosted update link created. |
400 | Invalid request body, unsupported payment method, invalid returnUrl, invalid expiresInMinutes, or unsupported delivery. |
401 | Missing or invalid API key. |
403 | Missing subscriptions:write permission or subscription belongs to another merchant account. |
404 | Subscription not found. |
409 | Subscription is not active. |