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

# Set default payment method

> Sets the default payment method for the subscription's customer. The payment method must be a valid Stripe payment method ID attached to the customer.



## OpenAPI

````yaml https://api.salesbricks.com/api/v2/openapi.yaml put /subscriptions/{subscription_id}/payment-methods/default
openapi: 3.0.3
info:
  title: Salesbricks REST API
  version: 2.0.0
  description: API reference for external integrations
servers:
  - url: https://api.salesbricks.com/api/v2
    description: Production
  - url: https://api.staging.salesbricks.com/api/v2
    description: Staging
security:
  - ApiKeyAuth: []
tags:
  - name: Subscriptions
    description: >-
      Operations related to subscription management, including creation,
      updates, and retrieving subscription details. Subscriptions can be
      upgraded to add / remove add-ons by using the POST
      /subscriptions/{subscription_id}/upgrade endpoint and can be recasted for
      replacing the current agreement using the POST
      /subscriptions/{subscription_id}/recast endpoint
  - name: Customers
    description: >-
      Operations related to customer management, including creation, updates,
      and managing customer person objects.
  - name: Invoices
    description: Operations related to subscription's invoicing details.
  - name: Plans
    description: >-
      Operations related to listing and getting plan details including bricks in
      the plan.
  - name: Payment Methods
    description: Operations related to subscription's payment method.
paths:
  /subscriptions/{subscription_id}/payment-methods/default:
    put:
      tags:
        - Payment Methods
      summary: Set default payment method
      description: >-
        Sets the default payment method for the subscription's customer. The
        payment method must be a valid Stripe payment method ID attached to the
        customer.
      operationId: setDefaultPaymentMethod_2
      parameters:
        - in: path
          name: subscription_id
          schema:
            type: string
            pattern: ^([a-zA-Z\d\-]+)$
          required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetDefaultPaymentMethod'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/SetDefaultPaymentMethod'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/SetDefaultPaymentMethod'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SetDefaultPaymentMethodOutput'
          description: ''
components:
  schemas:
    SetDefaultPaymentMethod:
      type: object
      properties:
        payment_method_id:
          type: string
          description: The Stripe payment method ID to set as default
      required:
        - payment_method_id
    SetDefaultPaymentMethodOutput:
      type: object
      properties:
        subscription_id:
          type: string
          format: uuid
          description: The id of the subscription
        default_payment_method_id:
          type: string
          description: 'The default Stripe payment method ID '
      required:
        - default_payment_method_id
        - subscription_id
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-SALESBRICKS-KEY
      description: API key for authentication

````

## Related topics

- [Navigating Salesbricks](/quickstart-guide/navigating-salesbricks.md)
- [Private Integration Setup](/integrations/okta/private-integration.md)
- [Building an Order](/quickstart-guide/building-an-order.md)
