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

# Set the payment method as default

> Use the payment method as default when not selected a payment method



## OpenAPI

````yaml /lago-openapi.yaml put /customers/{external_customer_id}/payment_methods/{lago_id}/set_as_default
openapi: 3.1.0
info:
  title: Nozle Billing API
  description: >-
    Nozle Billing API allows your application to push customer information and
    metrics (events) from your application to the billing engine.
  version: 1.49.0
  license:
    name: AGPLv3
    url: https://github.com/getlago/lago-openapi/blob/main/LICENSE
  contact:
    email: tech@getlago.com
servers:
  - url: https://core.nozle.app/api/v1
    description: Nozle Billing API
security:
  - bearerAuth: []
tags:
  - name: Activity Logs
    description: Everything about Activity logs
    externalDocs:
      description: Find out more
      url: https://getlago.com/docs/api-reference/audit-logs/activity-logs-object
  - name: Analytics
    description: Everything about Analytics
  - name: API Logs
    description: Everything about API logs
    externalDocs:
      description: Find out more
      url: https://getlago.com/docs/api-reference/audit-logs/api-logs-object
  - name: Billable Metrics
    description: Everything about Billable metric collection
    externalDocs:
      description: Find out more
      url: https://getlago.com/docs/api-reference/billable-metrics/object
  - name: Features
    description: Everything about Feature collection
    externalDocs:
      description: Find out more
      url: >-
        https://getlago.com/docs/api-reference/entitlements/features/feature-object
  - name: Entitlements
    description: Everything about Entitlement collection
    externalDocs:
      description: Find out more
      url: >-
        https://getlago.com/docs/api-reference/entitlements/plan-entitlements/plan-entitlement-object
  - name: Billing Entities
    description: Everything about Billing Entities
    externalDocs:
      description: Find out more
      url: https://getlago.com/docs/api-reference/billing-entities/object
  - name: Customers
    description: Everything about Customer collection
    externalDocs:
      description: Find out more
      url: https://getlago.com/docs/api-reference/customers/object
  - name: Plans
    description: Everything about Plan collection
    externalDocs:
      description: Find out more
      url: https://getlago.com/docs/api-reference/plans/object
  - name: Subscriptions
    description: Everything about Subscription collection
    externalDocs:
      description: Find out more
      url: https://getlago.com/docs/api-reference/subscriptions/subscription-object
  - name: Events
    description: Everything about Event collection
    externalDocs:
      description: Find out more
      url: https://getlago.com/docs/api-reference/events/event-object
  - name: Organizations
    description: Everything about Organization collection
    externalDocs:
      description: Find out more
      url: https://getlago.com/docs/api-reference/organizations/organization-object
  - name: Taxes
    description: Everything about Tax collection
    externalDocs:
      description: Find out more
      url: https://getlago.com/docs/api-reference/taxes/tax-object
  - name: Coupons
    description: Everything about Coupon collection
    externalDocs:
      description: Find out more
      url: https://getlago.com/docs/api-reference/coupons/coupon-object
  - name: Add-ons
    description: Everything about Add-on collection
    externalDocs:
      description: Find out more
      url: https://getlago.com/docs/api-reference/add-ons/add-on-object
  - name: Fees
    description: Everything about Fees
    externalDocs:
      description: Find out more
      url: >-
        https://getlago.com/docs/api-reference/invoices/invoice-object#fee-object
  - name: Invoices
    description: Everything about Invoice collection
    externalDocs:
      description: Find out more
      url: https://getlago.com/docs/api-reference/invoices/invoice-object
  - name: Wallets
    description: Everything about Wallet collection
    externalDocs:
      description: Find out more
      url: https://getlago.com/docs/api-reference/wallets/wallet-object
  - name: Credit Notes
    description: Everything about Credit notes collection
    externalDocs:
      description: Find out more
      url: https://getlago.com/docs/api-reference/credit-notes/credit-note-object
  - name: Webhooks
    description: Everything about Webhooks
    externalDocs:
      description: Find out more
      url: >-
        https://getlago.com/docs/api-reference/webhooks/format---signature#1-retrieve-the-public-key
  - name: Webhook Endpoints
    description: Everything about Webhook Endpoints
    externalDocs:
      description: Find out more
      url: >-
        https://getlago.com/docs/api-reference/webhook-endpoints/webhook-endpoint-object
  - name: Payment Receipts
    description: Everything about Payment receipts
    externalDocs:
      description: Find out more
      url: >-
        https://getlago.com/docs/api-reference/payment-receipts/payment-receipt-object
  - name: Payment Requests
    description: Everything about PaymentRequests
    externalDocs:
      description: Find out more
      url: >-
        https://getlago.com/docs/api-reference/payment-requests/payment-request-object
  - name: Payments
    description: Everything about Payments
    externalDocs:
      description: Find out more
      url: https://getlago.com/docs/api-reference/payments/payment-object
  - name: Payment Methods
    description: Everything about Payment Methods
    externalDocs:
      description: Find out more
      url: >-
        https://getlago.com/docs/api-reference/payment-methods/payment-method-object
externalDocs:
  description: Lago Github
  url: https://github.com/getlago
paths:
  /customers/{external_customer_id}/payment_methods/{lago_id}/set_as_default:
    parameters:
      - name: lago_id
        in: path
        description: The payment method unique identifier, created by Lago.
        required: true
        schema:
          type: string
          format: uuid
          example: 5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba
      - $ref: '#/components/parameters/external_customer_id_path'
    put:
      tags:
        - Payment Methods
      summary: Set the payment method as default
      description: Use the payment method as default when not selected a payment method
      operationId: paymentMethodSetAsDefault
      responses:
        '200':
          description: >-
            Return a 200 status to indicate that the data was received
            successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentMethod'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    external_customer_id_path:
      name: external_customer_id
      in: path
      description: >-
        The customer external unique identifier (provided by your own
        application)
      required: true
      schema:
        type: string
        example: 5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba
  schemas:
    PaymentMethod:
      type: object
      required:
        - payment_method
      properties:
        payment_method:
          $ref: '#/components/schemas/PaymentMethodObject'
    PaymentMethodObject:
      type: object
      required:
        - lago_id
        - is_default
        - payment_provider_type
        - provider_method_id
        - created_at
      properties:
        lago_id:
          type: string
          format: uuid
          description: The unique identifier of the payment method, created by Lago.
          example: 4cf085a7-c196-4f07-a543-97c50ec6e8b2
        is_default:
          type: boolean
          description: >-
            Indicates whether this payment method is the default one for the
            customer.
          example: true
        payment_provider_code:
          type:
            - string
            - 'null'
          description: Code of the payment provider associated with this payment method.
          example: stripe_prod
        payment_provider_name:
          type:
            - string
            - 'null'
          description: Human-readable name of the payment provider.
          example: Stripe
        payment_provider_type:
          type: string
          description: The type of the payment provider.
          enum:
            - adyen
            - cashfree
            - gocardless
            - stripe
            - flutterwave
            - moneyhash
          example: stripe
        provider_method_id:
          type: string
          description: Unique identifier of the payment method within the payment provider.
          example: pm_1N8ZQX2eZvKYlo2CkL9Y8XYZ
        created_at:
          type: string
          format: date-time
          description: Timestamp when the payment method was created in Lago's database.
          example: '2025-01-21T00:10:29Z'
    ApiErrorUnauthorized:
      type: object
      required:
        - status
        - error
      properties:
        status:
          type: integer
          format: int32
          example: 401
        error:
          type: string
          example: Unauthorized
    ApiErrorNotFound:
      type: object
      required:
        - status
        - error
        - code
      properties:
        status:
          type: integer
          format: int32
          example: 404
        error:
          type: string
          example: Not Found
        code:
          type: string
          example: object_not_found
  responses:
    Unauthorized:
      description: Unauthorized error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorUnauthorized'
    NotFound:
      description: Not Found error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorNotFound'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````