Skip to main content
POST
/
external
/
customers
/
external-id
/
{externalId}
/
stripe
/
checkout-sessions
/
setup
Create Stripe setup checkout session for payment method update
curl --request POST \
  --url https://platform.runonatlas.com/external/customers/external-id/{externalId}/stripe/checkout-sessions/setup \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "successUrl": "https://www.example.com/success",
  "email": "[email protected]",
  "name": "John Doe"
}
'
{
  "id": "cs_test_1234567890abcdef",
  "object": "checkout.session",
  "url": "https://checkout.stripe.com/c/pay/cs_test_1234567890abcdef",
  "status": "open",
  "mode": "setup",
  "customer": "cus_1234567890abcdef",
  "success_url": "https://example.com/success",
  "setup_intent": "seti_1234567890abcdef",
  "payment_status": "no_payment_required",
  "created": 1640995200,
  "expires_at": 1641081600,
  "livemode": false,
  "currency": "usd",
  "metadata": {}
}

Authorizations

x-api-key
string
header
required

You can obtain this key from the Atlas dashboard. It must be of type secret

Path Parameters

externalId
string
required

The external ID of the customer (e.g. the customer ID in your system)

Minimum string length: 1
Example:

"external-customer-id-123"

Body

application/json
successUrl
string<uri>
required

The URL to redirect the customer to after successfully updating their payment method

Example:

"https://www.example.com/success"

email
string<email>

The email of the customer

Minimum string length: 1
name
string

The name of the customer

Minimum string length: 1
Example:

"John Doe"

Response

The Stripe setup checkout session that the customer can be redirected to to update their payment method.

Stripe checkout session for payment method setup

id
string
required

The Stripe checkout session ID

Example:

"cs_test_1234567890abcdef"

object
enum<string>
required

The object type

Available options:
checkout.session
Example:

"checkout.session"

url
string<uri> | null
required

The URL to redirect the customer to complete the payment method setup

Example:

"https://checkout.stripe.com/c/pay/cs_test_1234567890abcdef"

status
enum<string>
required

The status of the checkout session

Available options:
open,
complete,
expired
Example:

"open"

mode
enum<string>
required

The mode of the checkout session

Available options:
setup
Example:

"setup"

customer
string | null
required

The Stripe customer ID

Example:

"cus_1234567890abcdef"

success_url
string<uri>
required

The URL to redirect the customer to after successful payment method setup

Example:

"https://example.com/success"

setup_intent
string | null
required

The Stripe setup intent ID

Example:

"seti_1234567890abcdef"

payment_status
enum<string>
required

The payment status of the checkout session

Available options:
unpaid,
paid,
no_payment_required
Example:

"no_payment_required"

created
number
required

Unix timestamp of when the checkout session was created

Example:

1640995200

expires_at
number | null
required

Unix timestamp of when the checkout session expires

Example:

1641081600

livemode
boolean
required

Whether the checkout session is in live mode

Example:

false

currency
string
required

The currency of the checkout session

Example:

"usd"

metadata
object
required

Metadata associated with the checkout session

Example:
{}