Skip to main content
POST
/
v1
/
billing.setup_payment
Typescript (SDK)
import { Autumn } from 'autumn-js'

const autumn = new Autumn()

const result = await autumn.billing.setupPayment({
  customerId: "cus_123",
  successUrl: "https://example.com/account/billing",
});
{
  "customer_id": "cus_123",
  "payment_url": "https://checkout.stripe.com/..."
}

Body Parameters

Response

{
  "customer_id": "cus_123",
  "payment_url": "https://checkout.stripe.com/..."
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

x-api-version
string
default:2.1
required

Body

application/json
customer_id
string
required

The ID of the customer

success_url
string

URL to redirect to after successful payment setup. Must start with either http:// or https://

customer_data
CustomerData · object

Customer details to set when creating a customer

checkout_session_params
object

Additional parameters for the checkout session

Response

200 - application/json

OK

customer_id
string
required

The ID of the customer

url
string
required

URL to the payment setup page