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

# Get a customer by ID



## OpenAPI

````yaml /api-reference/ubb_openapi_inline.json get /customers/{external_customer_id}
openapi: 3.0.1
info:
  title: Usage Based Billing API
  version: 1.0.0
  description: An Orchestrator for Usage Based Billing and Payments
servers:
  - url: https://api-m.sandbox.paypal.com/v1/commerce/billing
security:
  - BearerAuth:
      - read
      - write
tags:
  - name: Alerts
    description: API endpoints for managing subscription alerts
  - name: Events
    description: API endpoints for managing events
  - name: Metrics
    description: API endpoints for metrics and usage data
  - name: Merchant Activation
    description: API endpoint for merchant activation
  - name: Credit Notes
    description: API endpoints for credit notes management
  - name: Customers
    description: API endpoints for customer management
  - name: Invoices
    description: API endpoints for invoice management
  - name: Plans
    description: API endpoints for subscription plans
  - name: Subscriptions
    description: API endpoints for subscriptions
  - name: Wallets
    description: API endpoints for wallet management
  - name: Taxes
    description: API endpoints for tax management
  - name: Billing Entities
    description: API endpoints for billing entities
  - name: Features
    description: API endpoints for managing features and privileges
  - name: Entitlements
    description: API endpoints for managing plan and subscription entitlements
paths:
  /customers/{external_customer_id}:
    get:
      tags:
        - Customers
      summary: Get a customer by ID
      operationId: GetCustomerById
      parameters:
        - $ref: '#/components/parameters/external_customer_id'
      responses:
        '200':
          description: Customer retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerWithId'
              example:
                name: TechStart Solutions
                external_id: 5eb02857-a71e-4ea2-bcf9-1753826282
                email: finance@techstart.io
                address:
                  line1: 123 Innovation Way
                  line2: Suite 400
                  city: San Francisco
                  state: CA
                  postal_code: '94087'
                  country: US
                phone: +1 (555) 789-1234
                payment_method_token: 6ta69628uw121251c
                payment_method_type: CARD
                metadata:
                  - key: Purchase Order
                    value: PO-2023-4521
                    display_in_invoice: true
                  - key: Sales Region
                    value: West Coast
                    display_in_invoice: false
                id: f772b19c-c5c2-426d-8871-346a6cd094c5
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  parameters:
    external_customer_id:
      name: external_customer_id
      in: path
      required: true
      description: The unique external identifier of the customer
      schema:
        type: string
      example: 9c402857-a71e-4ea2-bcf9-57d3a41bc6ba
  schemas:
    CustomerWithId:
      allOf:
        - $ref: '#/components/schemas/Customer'
        - type: object
          properties:
            id:
              type: string
    Customer:
      title: Customer
      description: >-
        A customer represents an individual or organization that can be billed
        for services. It includes personal information, contact details, and
        metadata.
      type: object
      required:
        - name
        - email
        - external_id
      properties:
        name:
          type: string
          nullable: false
          minLength: 1
          maxLength: 512
          description: Full name of the customer
          example: John Doe
        external_id:
          type: string
          minLength: 1
          maxLength: 64
          description: >-
            External identifier for the customer. Must contain only alphanumeric
            characters, underscores, and hyphens.
          pattern: ^[a-zA-Z0-9_-]*$
          example: ext_cust_12345
        email:
          $ref: '#/components/schemas/EmailAddress'
        billing_entity_code:
          $ref: '#/components/schemas/BillingEntityCode'
        address:
          $ref: '#/components/schemas/Address'
        phone:
          type: string
          format: phone
          description: >-
            Primary phone number of the customer, including country code if
            available.
          example: +1-234-567-8900
        payment_method_token:
          allOf:
            - $ref: '#/components/schemas/PaymentMethodToken'
          description: >-
            Token representing the customer's saved payment method in PayPal
            Vault.
          example: 03t59758xv4247939
        payment_method_type:
          $ref: '#/components/schemas/PaymentMethodType'
        taxes:
          type: array
          description: List of tax entities configured for the customer.
          items:
            $ref: '#/components/schemas/TaxResponse'
        metadata:
          type: array
          items:
            $ref: '#/components/schemas/CustomerMetadata'
    Error:
      type: object
      properties:
        name:
          type: string
        debug_id:
          type: string
        message:
          type: string
        details:
          type: array
          items:
            $ref: '#/components/schemas/ErrorDetail'
    EmailAddress:
      type: string
      description: The internationalized email address.
      minLength: 3
      maxLength: 254
      pattern: ^.+@[^"\-].+$
      example: abc@test.com
    BillingEntityCode:
      type: string
      description: >-
        Unique code used to identify the billing entity. Must contain only
        alphanumeric characters, underscores, and hyphens.
      pattern: ^[a-zA-Z0-9_-]*$
      example: acme_inc
    Address:
      description: Address of the customer or party.
      type: object
      properties:
        line1:
          type: string
          nullable: false
          minLength: 1
          maxLength: 254
          description: First line of the address.
          example: 123 Main St
        line2:
          type: string
          minLength: 1
          maxLength: 512
          description: >-
            Second line of the address (optional). This can include apartment,
            suite, or unit numbers.
          example: Apt 4B
        city:
          type: string
          nullable: false
          minLength: 1
          maxLength: 512
          description: City of the customer or party.
          example: New York
        state:
          type: string
          nullable: false
          minLength: 1
          maxLength: 512
          description: State or region of the customer or party.
          example: NY
        postal_code:
          type: string
          nullable: false
          minLength: 1
          maxLength: 512
          description: >-
            Postal or ZIP code of the customer or party. Typically required for
            countries with a postal code or an equivalent.
          example: '10001'
        country:
          type: string
          nullable: false
          pattern: ^[A-Z]{2}$
          minLength: 2
          maxLength: 2
          description: >-
            Country of the customer or party. Use ISO 3166-1 alpha-2 country
            codes.
          example: US
    PaymentMethodToken:
      type: string
      minLength: 1
      maxLength: 36
      description: Token representing the customer's saved payment method in PayPal Vault.
      example: pm_visa_4242
    PaymentMethodType:
      type: string
      description: Type of payment method used (e.g., CARD, ACH_DEBIT)
      enum:
        - CARD
        - PAYPAL
        - ACH_DEBIT
        - APPLE_PAY
      x-enum-varnames:
        - CARD
        - PAYPAL
        - ACH_DEBIT
        - APPLE_PAY
      x-enum-description:
        - Payment made using a Credit or Debit card.
        - Payment made using PayPal.
        - Payment made using Automated Clearing House (ACH) transfer.
        - Payment made using Apple Pay.
      example: CARD
    TaxResponse:
      description: >-
        Represents a customizable tax rate that can be applied to invoices and
        fees
      type: object
      allOf:
        - $ref: '#/components/schemas/TaxBase'
        - type: object
          properties:
            code:
              $ref: '#/components/schemas/TaxCode'
            id:
              type: string
              format: uuid
              description: Unique identifier of the tax
              example: 1a901a90-1a90-1a90-1a90-1a901a901a90
            created_at:
              allOf:
                - $ref: '#/components/schemas/DateTimeWithZone'
                - description: >-
                    The effective start date of the subscription; can be past,
                    current, or future. Date must be provided in ISO 8601 format
                  example: '2025-06-01T00:00:00Z'
    CustomerMetadata:
      type: object
      description: >-
        Set of key-value pairs that you can attach to a customer. This can be
        useful for storing additional information about the customer in a
        structured format
      required:
        - key
        - value
        - display_in_invoice
      properties:
        key:
          type: string
          example: Purchase Order
          description: The metadata object key
          maxLength: 20
        value:
          type: string
          example: '123456789'
          description: The metadata object value
          maxLength: 100
        display_in_invoice:
          type: boolean
          example: true
          description: >-
            Determines whether the item or information should be displayed in
            the invoice. If set to true, the item or information will be
            included and visible in the generated invoice. If set to false, the
            item or information will be excluded and not displayed in the
            invoice.
    ErrorDetail:
      type: object
      properties:
        field:
          type: string
        value:
          type: string
        location:
          type: string
        issue:
          type: string
        description:
          type: string
    TaxBase:
      description: Base schema for tax request/response objects
      type: object
      required:
        - name
      properties:
        name:
          type: string
          description: Name of the tax
          example: TVA
        rate:
          type: string
          pattern: >-
            ^(?!0+(?:\.0+)?$)(?:0?\.\d{1,2}|[1-9]\d?(?:\.\d{1,2})?|100(?:\.0{1,2})?)$
          description: >-
            The percentage rate of the tax applied to transactions. A decimal
            amount from 0.01 to 100.00 inclusive, always with exactly two
            decimal places, no leading zeros except 0.xx.
          example: '20.00'
        description:
          type: string
          description: Detailed description of the tax for internal reference
          example: French standard VAT
    TaxCode:
      type: string
      description: >-
        Unique code used to identify the tax. Must contain only alphanumeric
        characters, underscores, and hyphens.
      pattern: ^[a-zA-Z0-9_-]*$
      example: standard_vat
    DateTimeWithZone:
      type: string
      format: date-time
      description: Date and time in ISO 8601 format.
      example: '2023-10-01T12:00:00Z'
  responses:
    Forbidden:
      description: Authorization failed due to insufficient permissions.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            name: NOT_AUTHORIZED
            message: Authorization failed due to insufficient permissions.
            debug_id: 565f78f101498
            details:
              - issue: PERMISSION_DENIED
                description: >-
                  You do not have permission to access or perform operations on
                  this resource.
    NotFound:
      description: Resource Not Found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    InternalServerError:
      description: Internal Server Error - An unexpected error occurred
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            name: INTERNAL_SERVER_ERROR
            message: An internal server error has occurred.
            debug_id: 90957fca61718
  securitySchemes:
    BearerAuth:
      type: oauth2
      description: >-
        Use the /v1/oauth2/token endpoint to obtain an access token and pass it
        as a Bearer token in the Authorization header.
      flows:
        clientCredentials:
          tokenUrl: https://api-m.sandbox.paypal.com/v1/oauth2/token
          scopes:
            read: Read access
            write: Write access

````