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

# Get billing details

> Read a customer's billing details from their Stripe customer.

Returns the customer's name, email, address, tax IDs, tax exemption and invoice fields as their Stripe customer holds them, with `taxLocation`, Stripe Tax's view of where they are. `billingDetails` is `null` until the customer has a Stripe customer.

Needs the **Customers** permission at Read.

```bash cURL theme={"system"}
curl "https://api.integrateledger.com/v1/customers/billing-details?customerId=acme" \
  -H "Authorization: Bearer $LEDGER_API_KEY"
```

```json 200 theme={"system"}
{
  "customerId": "acme",
  "billingDetails": null
}
```


## OpenAPI

````yaml openapi.json GET /v1/customers/billing-details
openapi: 3.1.0
info:
  title: Ledger API
  version: 0.1.0
servers:
  - url: https://api.integrateledger.com
    description: Hosted Ledger API
security: []
paths:
  /v1/customers/billing-details:
    get:
      tags:
        - Customers
      summary: Get a customer's billing details
      description: >-
        Reads the customer's billing details from its Stripe customer: name,
        email, address, tax IDs, tax exemption and invoice fields, with Stripe
        Tax's view of its location. billingDetails is null until the customer
        has a Stripe customer.
      operationId: getCustomerBillingDetails
      parameters:
        - schema:
            type: string
            minLength: 1
            maxLength: 255
            description: Your ID for the customer, such as your user ID.
          required: true
          description: Your ID for the customer, such as your user ID.
          name: customerId
          in: query
      responses:
        '200':
          description: The customer's billing details, as Stripe holds them
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingDetailsResponse'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerError'
        '401':
          description: Missing or invalid Ledger API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerError'
        '403':
          $ref: '#/components/responses/InsufficientPermissions'
        '404':
          description: >-
            No such customer (customer_not_found), or its Stripe customer was
            deleted (stripe_customer_not_found)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerError'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          description: >-
            Unexpected error in Ledger. It has been logged with the request ID;
            retry, or quote request_id when reporting it.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalError'
        '502':
          description: >-
            No Stripe connection for this environment or its key is invalid
            (stripe_not_configured), or Stripe unavailable
            (stripe_request_failed; retry)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerError'
      security:
        - ApiKey: []
      x-codeSamples:
        - lang: python
          label: Python SDK
          source: |-
            import os
            from integrateledger import ledger

            client = ledger(api_key=os.environ["LEDGER_API_KEY"])
            client.get_customer_billing_details(customer_id="user_123")
        - lang: bash
          label: cURL
          source: >-
            curl --request GET
            'https://api.integrateledger.com/v1/customers/billing-details?customerId=user_123'
            \
              -H "Authorization: Bearer $LEDGER_API_KEY"
        - lang: typescript
          label: TypeScript SDK
          source: >-
            import ledger from "integrateledger";


            const client = new ledger({ apiKey: process.env.LEDGER_API_KEY ?? ""
            });

            await client.getCustomerBillingDetails({ customerId: "user_123" });
components:
  schemas:
    BillingDetailsResponse:
      type: object
      properties:
        customerId:
          type: string
        billingDetails:
          allOf:
            - $ref: '#/components/schemas/BillingDetails'
            - description: >-
                Read from the customer's Stripe customer. Null when the customer
                has no Stripe customer yet.
      required:
        - customerId
        - billingDetails
    CustomerError:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
          description: >-
            What went wrong and what to do about it, for a person or an agent to
            read. Every Ledger error has one. The wording can change: branch on
            `error`, not on this text.
          example: >-
            No customer "user_123" exists in this environment. Create it with
            POST /v1/customers, or check that the API key is for the right
            environment.
        issues:
          type: array
          items:
            type: object
            properties:
              path:
                type: string
              message:
                type: string
            required:
              - path
              - message
          description: >-
            With `invalid_request`: each field that failed validation and why.
            `path` is empty for the body itself, such as an unknown field.
      required:
        - error
    InternalError:
      type: object
      properties:
        error:
          type: string
          example: internal_error
        message:
          type: string
          description: >-
            What went wrong and what to do about it, for a person or an agent to
            read. Every Ledger error has one. The wording can change: branch on
            `error`, not on this text.
          example: >-
            No customer "user_123" exists in this environment. Create it with
            POST /v1/customers, or check that the API key is for the right
            environment.
        request_id:
          type:
            - string
            - 'null'
      required:
        - error
        - request_id
    BillingDetails:
      type: object
      properties:
        stripeCustomerId:
          type: string
        name:
          type:
            - string
            - 'null'
        email:
          type:
            - string
            - 'null'
        address:
          $ref: '#/components/schemas/BillingAddressRead'
        taxIds:
          type: array
          items:
            $ref: '#/components/schemas/TaxId'
        taxExempt:
          type: string
          enum:
            - none
            - exempt
            - reverse
        taxLocation:
          type:
            - string
            - 'null'
          enum:
            - supported
            - not_collecting
            - unrecognized_location
            - failed
            - null
          description: >-
            Whether Stripe Tax can locate the customer: supported (it can tax
            them), not_collecting (located where you aren't registered),
            unrecognized_location (the address isn't enough) or failed. Null
            when Stripe didn't say.
        invoiceCustomFields:
          type: array
          items:
            $ref: '#/components/schemas/InvoiceCustomField'
        invoiceFooter:
          type:
            - string
            - 'null'
      required:
        - stripeCustomerId
        - name
        - email
        - address
        - taxIds
        - taxExempt
        - taxLocation
        - invoiceCustomFields
        - invoiceFooter
      description: The billing details Stripe now holds, when sent.
    InsufficientPermissionsError:
      type: object
      properties:
        error:
          type: string
          example: insufficient_permissions
        message:
          type: string
          description: >-
            What went wrong and what to do about it, for a person or an agent to
            read. Every Ledger error has one. The wording can change: branch on
            `error`, not on this text.
          example: >-
            No customer "user_123" exists in this environment. Create it with
            POST /v1/customers, or check that the API key is for the right
            environment.
        requiredScope:
          type: string
          example: customers:read
      required:
        - error
        - requiredScope
    RateLimitError:
      type: object
      properties:
        error:
          type: string
          example: rate_limited
        message:
          type: string
          description: >-
            What went wrong and what to do about it, for a person or an agent to
            read. Every Ledger error has one. The wording can change: branch on
            `error`, not on this text.
          example: >-
            No customer "user_123" exists in this environment. Create it with
            POST /v1/customers, or check that the API key is for the right
            environment.
      required:
        - error
    BillingAddressRead:
      type:
        - object
        - 'null'
      properties:
        line1:
          type:
            - string
            - 'null'
        line2:
          type:
            - string
            - 'null'
        city:
          type:
            - string
            - 'null'
        state:
          type:
            - string
            - 'null'
        postalCode:
          type:
            - string
            - 'null'
        country:
          type:
            - string
            - 'null'
      required:
        - line1
        - line2
        - city
        - state
        - postalCode
        - country
    TaxId:
      type: object
      properties:
        type:
          type: string
        value:
          type: string
        verification:
          type:
            - object
            - 'null'
          properties:
            status:
              type: string
              enum:
                - pending
                - unavailable
                - unverified
                - verified
            verifiedName:
              type:
                - string
                - 'null'
          required:
            - status
            - verifiedName
          description: >-
            Stripe's check of the ID with the tax authority, for the types
            Stripe verifies (EU VAT, for example). Null for the rest.
      required:
        - type
        - value
        - verification
    InvoiceCustomField:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 40
        value:
          type: string
          minLength: 1
          maxLength: 140
      required:
        - name
        - value
      additionalProperties: false
  responses:
    InsufficientPermissions:
      description: >-
        The API key works but lacks the permission this endpoint needs, named in
        requiredScope. See the API keys guide.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/InsufficientPermissionsError'
    RateLimited:
      description: >-
        Too many requests. Wait Retry-After seconds, then retry. See the rate
        limits guide.
      headers:
        Retry-After:
          description: Seconds until a request is allowed again
          schema:
            type: integer
        RateLimit-Limit:
          description: 'The burst: requests allowed at once'
          schema:
            type: integer
        RateLimit-Remaining:
          description: Requests left right now
          schema:
            type: integer
        RateLimit-Reset:
          description: Seconds until the full burst is back
          schema:
            type: integer
        RateLimit-Policy:
          description: >-
            The sustained rate per second and the burst, such as
            200;w=1;burst=1000
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RateLimitError'
  securitySchemes:
    ApiKey:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.