> ## Documentation Index
> Fetch the complete documentation index at: https://docs.runonatlas.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Stripe setup checkout session for payment method update

> Creates a new Stripe setup checkout session to update the payment method for a customer by external ID (e.g. the customer ID in your system). You must have a valid Stripe account connected to your Atlas merchant to use this endpoint. Redirect the customer to the URL returned in the response to update their payment method.



## OpenAPI

````yaml https://platform.runonatlas.com/external/schema post /external/customers/external-id/{externalId}/stripe/checkout-sessions/setup
openapi: 3.0.0
info:
  title: Atlas API
  version: 1.0.0
servers:
  - url: https://platform.runonatlas.com
security: []
paths:
  /external/customers/external-id/{externalId}/stripe/checkout-sessions/setup:
    post:
      tags:
        - Customers
      summary: Create Stripe setup checkout session for payment method update
      description: >-
        Creates a new Stripe setup checkout session to update the payment method
        for a customer by external ID (e.g. the customer ID in your system). You
        must have a valid Stripe account connected to your Atlas merchant to use
        this endpoint. Redirect the customer to the URL returned in the response
        to update their payment method.
      parameters:
        - schema:
            type: string
            minLength: 1
            description: >-
              The external ID of the customer (e.g. the customer ID in your
              system)
            example: external-customer-id-123
          required: true
          description: >-
            The external ID of the customer (e.g. the customer ID in your
            system)
          name: externalId
          in: path
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                email:
                  type: string
                  minLength: 1
                  format: email
                  description: The email of the customer
                  example: john.doe@example.com
                name:
                  type: string
                  minLength: 1
                  description: The name of the customer
                  example: John Doe
                successUrl:
                  type: string
                  format: uri
                  description: >-
                    The URL to redirect the customer to after successfully
                    updating their payment method
                  example: https://www.example.com/success
              required:
                - successUrl
              additionalProperties: false
      responses:
        '201':
          description: >-
            The Stripe setup checkout session that the customer can be
            redirected to to update their payment method.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: The Stripe checkout session ID
                    example: cs_test_1234567890abcdef
                  object:
                    type: string
                    enum:
                      - checkout.session
                    description: The object type
                    example: checkout.session
                  url:
                    type: string
                    nullable: true
                    format: uri
                    description: >-
                      The URL to redirect the customer to complete the payment
                      method setup
                    example: https://checkout.stripe.com/c/pay/cs_test_1234567890abcdef
                  status:
                    type: string
                    enum:
                      - open
                      - complete
                      - expired
                    description: The status of the checkout session
                    example: open
                  mode:
                    type: string
                    enum:
                      - setup
                    description: The mode of the checkout session
                    example: setup
                  customer:
                    type: string
                    nullable: true
                    description: The Stripe customer ID
                    example: cus_1234567890abcdef
                  success_url:
                    type: string
                    format: uri
                    description: >-
                      The URL to redirect the customer to after successful
                      payment method setup
                    example: https://example.com/success
                  setup_intent:
                    type: string
                    nullable: true
                    description: The Stripe setup intent ID
                    example: seti_1234567890abcdef
                  payment_status:
                    type: string
                    enum:
                      - unpaid
                      - paid
                      - no_payment_required
                    description: The payment status of the checkout session
                    example: no_payment_required
                  created:
                    type: number
                    description: Unix timestamp of when the checkout session was created
                    example: 1640995200
                  expires_at:
                    type: number
                    nullable: true
                    description: Unix timestamp of when the checkout session expires
                    example: 1641081600
                  livemode:
                    type: boolean
                    description: Whether the checkout session is in live mode
                    example: false
                  currency:
                    type: string
                    description: The currency of the checkout session
                    example: usd
                  metadata:
                    type: object
                    additionalProperties:
                      type: string
                    description: Metadata associated with the checkout session
                    example: {}
                required:
                  - id
                  - object
                  - url
                  - status
                  - mode
                  - customer
                  - success_url
                  - setup_intent
                  - payment_status
                  - created
                  - expires_at
                  - livemode
                  - currency
                  - metadata
                description: Stripe checkout session for payment method setup
                example:
                  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: {}
        '400':
          description: >-
            There is an issue with the request data or a Stripe API error
            occurred. See the response for more details.
        '401':
          description: >-
            Invalid API key provided or Stripe is not configured for this
            account.
        '404':
          description: Customer not found.
        '503':
          description: Payment service temporarily unavailable. Please try again later.
      security:
        - apiKeyAuth: []
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      name: x-api-key
      in: header
      description: >-
        You can obtain this key from the Atlas dashboard. It must be of type
        `secret`

````