Subscription Payments

Create a setup intent

Changed on

Creates an unconfirmed, card-only setup intent for the account's payment customer and returns its id, client secret and the publishable key of the payment system account it was created in.

Adding a card is a three-step flow:

  • Call this endpoint to create the setup intent.
  • In the browser, initialise the payment system's client library with 'publishableKey', collect the card and confirm the setup intent with 'clientSecret'.
  • Call the add payment method endpoint with 'setupIntentId' and 'clientSecret' as the payment information.
post/subscriptions/paymentmethods/setup-intent

Request

  • Base URL
    https://api.smokeball.com
  • URL
    https://api.smokeball.com/subscriptions/paymentmethods/setup-intent
  • Auth
    API key in header x-api-key and API key in header Authorization

Response

When request is successful. Returns a 'SetupIntentResponse' object.

setupIntentIdstring nullable

The Stripe setup intent id.

clientSecretstring nullable

The Stripe setup intent client secret.

publishableKeystring nullable

The Stripe publishable key for the account the setup intent was created in. Use it to initialise Stripe.js.

Example response

{
  "setupIntentId": "seti_1234567890",
  "clientSecret": "seti_1234567890_secret_5678901234",
  "publishableKey": "pk_test_1234567890"
}

Changes