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
string
required
Bearer token using your API key. Format:
Bearer cs_live_your_key.string
required
Must be
application/json.Path parameters
string
required
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.string
default:"link"
Delivery mode for the update session. The only supported value is
link.string
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.integer
default:"60"
Link lifetime in minutes. Accepted values are
30 through 1440.array[string]
default:"[\"CARD\", \"PAY_BY_BANK\"]"
Payment methods the donor may choose on the hosted page. Accepted values are
CARD and PAY_BY_BANK.Response
201 - created
string
Unique ID for the payment method update session.
string
Hosted CharityStack URL for the donor. This URL includes the session token.
string
ISO 8601 timestamp when the link expires.
object
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: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:
The
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.