Subscription Payments
Create a payment method session
Changed onCreates a hosted page where the user enters a card for the account, and returns its url. Once the user completes it, the card is also set as the default payment method for the specified subscription.
Adding a card:
- Call this endpoint and redirect the user to 'url'.
- The user enters a card and is redirected to 'successUrl', or to 'cancelUrl' if they leave.
- The card is added asynchronously once the user completes the page. Poll the payment methods endpoint to see it.
post/subscriptions/{subscriptionId}/paymentmethods/sessions
Request
- Base URLhttps://api.smokeball.com
- URLhttps://api.smokeball.com/subscriptions/{subscriptionId}/paymentmethods/sessions
- AuthAPI key in header x-api-key and API key in header Authorization
Path parameters
subscriptionIdstring required
The unique identifier of the subscription
Request body
Example request
{
"successUrl": "https://app.smokeball.com/billing/payment-methods?added=true",
"cancelUrl": "https://app.smokeball.com/billing/payment-methods",
"isDefault": true,
"chargeImmediately": true
}Response
When request is successful. Returns a 'PaymentMethodSessionResponse' object.
Example response
{
"url": "https://checkout.stripe.com/c/pay/cs_test_1234567890",
"expiresAt": "2026-10-27T01:00:00Z"
}Changes
- info
endpoint added
- info