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

# Get a customer by ID

> Retrieve a specific customer by their unique ID



## OpenAPI

````yaml https://raw.githubusercontent.com/bushaHQ/openapi/refs/heads/main/openapi-spec.yaml get /v1/customers/{id}
openapi: 3.0.0
info:
  title: Busha API
  contact:
    email: developers@busha.co
  description: >
    ## Introduction

    The **Busha API** is designed to provide businesses with tools for
    borderless financial transactions and operations, enabling modern, global
    money management. It serves as the backbone for facilitating:

    - Creation and management of multi-currency balances

    - Retrieval of real-time cryptocurrency rates

    - Substantial data insights for business owners


    Whether you’re a product-driven fintech or a developer building
    integrations, this API significantly accelerates implementation while
    reducing financial complexities.

    For detailed guides on API integration, visit our [official
    documentation]().



    ## Authentication

    All API requests require a **Bearer Token** for authentication, passed in
    the `Authorization` header.

    Your authorization value is a base64 encoded value of your api key and your
    secret key.

    You can obtain API tokens via your Busha user or business account.
    Authentication is mandatory to ensure secure and authorized interactions
    with the API.

    The API keys from the dashboard provides a base64 encoding of the your
    authorization tokens.


    Your generated Key should look like this:

    `VURtNXhWcHueantkpaiewjo0S044MWsadfojienuoxRTiWDJaeWJaTGxxanZ3Ym10OU1RZnVWajVW=`


    Example Header:

    ``` curl

    Authorization: Bearer
    VURtNXhWcHueantkpaiewjo0S044MWsadfojienuoxRTiWDJaeWJaTGxxanZ3Ym10OU1RZnVWajVW=

    ```


    ## Error Handling

    #Standardized error responses ensure predictable interactions. Errors are
    detailed for easy debugging and understanding:

    | **Error Code** | **HTTP Status Code** | **Description** |

    | --- | --- | --- |

    | `bad_request` | 400 | Invalid input or malformed request |

    | `unauthorized` | 401 | Invalid or missing authentication |

    | `not_found` | 404 | Resource not found |

    | `service_unavailable` | 503 | Server error |


    Basic Error Example:

    ``` json

    {
      "error": {
        "name": "bad_request",
        "message": "Invalid input data"
      }
    }

    ```


    Schema Error Body Example:

    ``` json

    {
      "error": {
        "name": "bad_request",
        "message": "Invalid input data"
      },
      "schema": {
        "reason": "The request body is defined as an object. However, it does not meet the schema requirements of the specification",
        "fix": "Ensure that the object being submitted, matches the schema correctly"
      }
    }

    ```


    Field Error Body Example:

    ``` json

    {
      "error": {
        "name": "bad_request",
        "message": "Invalid input data"
      },
      "fields": {
        "field1": [
          {
            "reason": "The request body is defined as an object. However, it does not meet the schema requirements of the specification",
          },
        ],
        "field2": [
          {
            "reason": "The request body is defined as an object. However, it does not meet the schema requirements of the specification",
          }
        ],
      }
    }

    ```


    ## Pagination

    Pagination uses cursors provided as:

    The API supports **cursor-based pagination** for endpoints with large
    datasets. Pagination uses a `next_cursor` and `previous_cursor` returned in
    the response.

    Example Response Format:

    ``` json

    {
      "current_entries_size": 10,
      "next_cursor": "base64_cursor_value",
      "previous_cursor": "base64_previous_cursor_value"
    }

    ```


    ## Rate Limiting

    Rate limits determine how many API calls can be made in a rolling minute.
    This ensures fair and optimized use of system resources.


    The rate limits allowed by each resource will be provided with the header:

    ```curl

    x-rate-limit 100

    ```

    If this header does not exist, then the rate limit is set at a default 100
    req/min


    Requests exceeding the allocated quota will receive a `429 Too Many
    Requests` response.


    ##  Common Parameters

    Common parameters enhance consistency across endpoints:
      | **Parameter Name** | **Location** | **Description** | **Example** |
      | --- | --- | --- | --- |
      | `X-BU-PROFILE-ID` | Header | User profile identifier | `BUS_qwejinoiuiqw93ejjw` |
      | `id` | Path | Unique NanoID identifier | `dpt_jweqafajsndiun34fd` |
      | `cursor` | Query | Pagination cursor | `base64_cursor_string` |

    #### Paginated Response Example
      ``` json
      {
        "status": "success",
        "message": "Data retrieved",
        "pagination": {
          "next_cursor": "value_for_next_page",
          "current_entries_size": 20
        },
        "data": [...]
      }
      ```
  version: 1.0.0
servers:
  - url: https://api.sandbox.busha.so
    description: Sandbox Environment
  - url: https://api.busha.io
    description: Production Environment
security: []
tags:
  - name: Balances
    description: Handles account balances across different currencies.
    x-displayName: Balances
  - name: Bills
    description: Lorem Ipsum
    x-displayName: Bills
  - name: Cards
    description: Lorem Ipsum
    x-displayName: Cards
  - name: Cashback
    description: Main tag for cashback service endpoints
    x-displayName: Cashback
  - name: Currencies
    description: >
      Endpoints to manage supported currencies, their properties, and network
      details.
    x-displayName: Currencies
  - name: Customers
    x-internal: false
    description: Handle customer requests and responses
    x-displayName: Customers
  - name: Files
    description: Provides APIs to handle files upload
    x-displayName: Files
  - name: Mandate
    x-displayName: Mandate
  - name: Miscellaneous
    description: Provides auxiliary APIs to complement and enhance other services.
    x-displayName: Miscellaneous
  - name: News
    description: News article endpoints
    x-displayName: News
  - name: Pairs
    description: Access trading pair information and rates
    x-displayName: Pairs
  - name: PaymentLinks
    description: Payment Links
    x-displayName: PaymentLinks
  - name: PaymentRequests
    description: Payment request
    x-displayName: PaymentRequests
  - name: Pledges
    description: Customer-authorized pledge lifecycle APIs
    x-displayName: Pledges
  - name: PriceAlerts
    description: Price alert management endpoints
    x-displayName: PriceAlerts
  - name: Quotes
    description: Handle quotes requests and responses
    x-displayName: Quotes
  - name: Recipients
    x-displayName: Recipients
  - name: Transactions
    x-displayName: Transactions
  - name: Transfers
    x-displayName: Transfers
  - name: Widget
    description: Widget operations
    x-displayName: Widget
paths:
  /v1/customers/{id}:
    get:
      tags:
        - Customers
      summary: Get a customer by ID
      description: Retrieve a specific customer by their unique ID
      operationId: getCustomerByID
      parameters:
        - $ref: '#/components/parameters/PathParamNanoID'
        - $ref: '#/components/parameters/ProfileHeader'
      responses:
        '200':
          $ref: '#/components/responses/CustomerResponse'
        4XX:
          $ref: '#/components/responses/CustomerError4XX'
        5XX:
          $ref: '#/components/responses/CustomerError5XX'
      security:
        - Auth:
            - customers:read
            - api:read
components:
  parameters:
    PathParamNanoID:
      in: path
      name: id
      required: true
      schema:
        type: string
        format: nanoid
        example: bus_123456789
      x-oapi-codegen-extra-tags:
        validate: required|nanoid
    ProfileHeader:
      in: header
      name: X-BU-PROFILE-ID
      required: false
      description: User profile header
      schema:
        type: string
        example: BUS_YOK8tp5Zga01qOKEsqp07
  responses:
    CustomerResponse:
      description: Successful response
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/BaseSchema'
              - type: object
                required:
                  - data
                properties:
                  data:
                    $ref: '#/components/schemas/Customer'
    CustomerError4XX:
      description: Something went wrong in Customer resource
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            default:
              $ref: '#/components/examples/DefaultError'
            not_found_error:
              $ref: '#/components/examples/NotFoundError'
            unauthorized_error:
              $ref: '#/components/examples/UnAuthorizedError'
            request_validation_error:
              $ref: '#/components/examples/RequestValidationError'
            schema_validation_error:
              $ref: '#/components/examples/SchemaValidationError'
    CustomerError5XX:
      description: Server error when processing the customers request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            internal_server_error:
              $ref: '#/components/examples/InternalServerError'
            service_unavailable_error:
              $ref: '#/components/examples/ServiceUnavailableError'
  schemas:
    BaseSchema:
      description: General response Values
      type: object
      required:
        - status
        - message
      properties:
        status:
          type: string
          x-order: 1
          x-go-type: string
          enum:
            - success
            - error
          example: success
        message:
          type: string
          x-order: 2
          example: message for success
    Customer:
      allOf:
        - oneOf:
            - $ref: '#/components/schemas/CustomerCreateIndividual'
            - $ref: '#/components/schemas/CustomerBusinessBase'
        - type: object
          x-order: 1
          required:
            - id
            - status
            - type
            - email
            - country_id
            - business_id
            - has_accepted_terms_of_service
            - display_currency
            - deposit
            - payout
            - phone
            - address
            - level
            - created_at
            - updated_at
          properties:
            id:
              allOf:
                - $ref: '#/components/schemas/NanoID'
              x-order: 1
            business_id:
              allOf:
                - $ref: '#/components/schemas/NanoID'
              x-order: 2
            email:
              allOf:
                - $ref: '#/components/schemas/EmailField'
              x-order: 3
            status:
              type: string
              enum:
                - active
                - inactive
                - submitted
                - in_review
                - rejected
              x-order: 9
            kyc_status:
              type: string
              enum:
                - pending
                - unverified
                - verified
                - expiry_soon
                - expired
              x-order: 9
            country_id:
              $ref: '#/components/schemas/CountryID'
            type:
              allOf:
                - $ref: '#/components/schemas/BusinessCustomerType'
              x-order: 8
            phone:
              allOf:
                - $ref: '#/components/schemas/PhoneField'
              x-order: 8
            address:
              allOf:
                - $ref: '#/components/schemas/Address'
              x-order: 7
            display_currency:
              allOf:
                - $ref: '#/components/schemas/Currency'
              x-order: 7
            deposit:
              type: boolean
              description: User can deposit
              x-order: 8
            payout:
              type: boolean
              description: User can payout
              x-order: 8
            has_accepted_terms_of_service:
              type: boolean
              x-order: 10
            rejection_reasons:
              type: array
              items:
                type: string
              x-order: 11
            requirements_due:
              type: array
              items:
                type: string
              x-order: 12
            future_requirements_due:
              type: array
              items:
                type: string
              x-order: 13
            beneficial_owners:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                  email:
                    $ref: '#/components/schemas/EmailField'
              x-order: 14
            level:
              type: string
              x-order: 15
            created_at:
              type: string
              format: date-time
              x-order: 16
            updated_at:
              type: string
              format: date-time
              x-order: 17
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - name
            - message
          properties:
            name:
              type: string
              x-order: 40
              example: bad_request
            message:
              type: string
              example: Invalid Request
        fields:
          type: object
        schema:
          type: array
          items:
            type: object
      example:
        error:
          name: bad_request
          message: Invalid Request
    CustomerCreateIndividual:
      type: object
      x-order: 2
      required:
        - first_name
        - last_name
      description: Individual name requirements
      properties:
        first_name:
          $ref: '#/components/schemas/NameField'
        middle_name:
          $ref: '#/components/schemas/NullableNameField'
        last_name:
          $ref: '#/components/schemas/NameField'
    CustomerBusinessBase:
      type: object
      required:
        - business_name
        - business_industry
        - business_incorporation_date
      description: Business name requirements
      x-order: 2
      properties:
        business_name:
          type: string
          description: Name of the business
          maxLength: 100
          x-oapi-codegen-extra-tags:
            validate: required|maxlen:100
            filter: trim|lower|ucFirst
        business_industry:
          type: string
          minLength: 16
          maxLength: 24
          description: ID Industry or sector the business operates in
        business_incorporation_date:
          type: string
          format: date
          description: Business incorporation date
    NanoID:
      type: string
      x-order: 2
      example: bus_123456789
      format: nanoid
      description: A valid id
      x-oapi-codegen-extra-tags:
        validate: required|nanoid
    EmailField:
      type: string
      example: bCnW7@example.com
      format: email
      description: A valid email address
      x-oapi-codegen-extra-tags:
        validate: required|email|check_temp_email
        filter: trim|lower
      x-go-type: string
    CountryID:
      type: string
      example: NG
      format: alpha2
      description: A valid country id
      minLength: 2
      maxLength: 2
      x-oapi-codegen-extra-tags:
        validate: alpha2
    BusinessCustomerType:
      type: string
      enum:
        - individual
        - business
    PhoneField:
      type: string
      example: '+2348012345678'
      format: phone
      description: A valid phone number. format `{{calling_code}}{{number}}`
      x-oapi-codegen-extra-tags:
        validate: phone
        filter: phone
        mapstructure: phone_number,omitempty
    Address:
      type: object
      description: Address of the business.
      required:
        - address_line_1
        - country_id
      properties:
        city:
          type: string
          example: Lekki
          x-oapi-codegen-extra-tags:
            mapstructure: city
        state:
          type: string
          example: Lagos
          x-oapi-codegen-extra-tags:
            mapstructure: state
        county:
          type: string
          example: Mombasa
          x-oapi-codegen-extra-tags:
            mapstructure: county
        country_id:
          type: string
          example: NG
          format: alpha2
          description: A valid country id
          x-oapi-codegen-extra-tags:
            validate: alpha2
            mapstructure: country_id
        address_line_1:
          type: string
          example: RT Lawal
          x-oapi-codegen-extra-tags:
            mapstructure: address_line_1
        address_line_2:
          type: string
          example: ''
          x-oapi-codegen-extra-tags:
            mapstructure: address_line_2
        province:
          type: string
          example: province
          x-oapi-codegen-extra-tags:
            mapstructure: province
        postal_code:
          type: string
          example: '12345'
          x-oapi-codegen-extra-tags:
            mapstructure: postal_code
    Currency:
      type: string
      x-order: 20
      example: BTC
      format: string
      maxLength: 10
      minLength: 1
      description: A valid currency
      x-oapi-codegen-extra-tags:
        validate: required|min_len:1|max_len:10
        filter: trim|upper
    NameField:
      type: string
      example: John
      description: A valid name
    NullableNameField:
      type: string
      nullable: true
      description: A field representing a name that can be null or absent.
      example: Smith
  examples:
    DefaultError:
      description: Default error
      value:
        error:
          name: bad_request
          message: Invalid request
    NotFoundError:
      description: Not Found error
      value:
        error:
          name: resource_not_found
          message: Resource Not Found
    UnAuthorizedError:
      description: Unauthorized Error
      value:
        error:
          name: unauthorized
          message: Unauthorized request
    RequestValidationError:
      description: Request Validation error example
      value:
        error:
          name: request_validation
          message: Validation error
        fields:
          field1:
            - reason: One of target and source amount must be set
          field2:
            - reason: One of target and source amount must be set
    SchemaValidationError:
      description: Schema validation error example
      value:
        error:
          name: schema_validation
          message: Error Validating Requests
        schema:
          - reason: >-
              The request body is defined as an object. However, it does not
              meet the schema requirements of the specification
            fix: >-
              Ensure that the object being submitted, matches the schema
              correctly
            schema_validation_error:
              - 'minLength: got 3, want 12'
    InternalServerError:
      description: Internal Server Error
      value:
        error:
          name: internal_server_error
          message: Internal Server Error
    ServiceUnavailableError:
      description: Service Unavailable Error
      value:
        error:
          name: service_unavailable
          message: Service Unavailable
  securitySchemes:
    Auth:
      type: http
      scheme: bearer
      description: Bearer Authentication

````