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

# Retrieve current customer

> Retrieve the current customer.

If the user is authenticated, retrieve the customer's current tab.

For unauthenticated requests, retrieve a predicted currency and tab limit based on the user's location.

<div class="flex items-baseline border-b pb-2.5 border-gray-100 dark:border-gray-800 w-full">
  <h4 class="flex-1 mb-0">Required Scopes</h4>
</div>

`capi:read` - Read access to Customer API resources


## OpenAPI

````yaml GET /customers/me
openapi: 3.1.0
info:
  title: FastAPI
  version: '2025-04-01'
servers:
  - url: /capi
security: []
paths:
  /customers/me:
    get:
      tags:
        - Customer
      summary: Retrieve the current customer.
      description: >-
        Retrieve the current customer.


        If the user is authenticated, retrieve the customer's current tab.


        For unauthenticated requests, retrieve a predicted currency and tab
        limit based on the user's location.
      operationId: retrieve-customer
      parameters:
        - name: x-api-version
          in: header
          required: false
          schema:
            type: string
            format: date
            title: Customer API version
            description: The version of the Customer API you are using.
            default: '2025-04-01'
          description: The version of the Customer API you are using.
          examples:
            default:
              value: '2025-04-01'
        - name: x-supertab-client-id
          in: header
          required: true
          schema:
            title: Client Id
            type: string
            format: tagged_id
            examples:
              - live_client.4df706b5-297a-49c5-a4cd-2a10eca12ff9
              - test_client.4df706b5-297a-49c5-a4cd-2a10eca12ff9
          description: >-
            Your Client ID with Supertab. Used to identify the website on which
            Customer is making a Purchase.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Customer'
        '401':
          content:
            application/json:
              schema:
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        description: A codename for the error
                      message:
                        type: string
                        description: A human-readable error message
                type: object
                title: Unauthorized
              example:
                error:
                  message: Invalid authentication credentials
                  code: invalid_credentials
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        description: A codename for the error
                      message:
                        type: string
                        description: A human-readable error message
                type: object
                title: Forbidden
              example:
                error:
                  message: >-
                    The Bearer token does not match the x-supertab-client-id
                    header | Missing or invalid x-supertab-client-id | Invalid
                    subject type {request_subject_type} found,
                    {expected_token_type} expected | Forbidden
                  code: >-
                    client_id_mismatch | missing_or_invalid_x_supertab_client_id
                    | invalid_subject_type | forbidden
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        description: A codename for the error
                      message:
                        type: string
                        description: A human-readable error message
                type: object
                title: Not Found
              example:
                error:
                  message: User not found
                  code: user_not_found
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                properties:
                  error:
                    type: array
                    description: >-
                      A general error code and message accompanied by the list
                      of attributes that failed validation
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          description: A short generic error code
                        message:
                          type: string
                          description: A human-readable error message
                        errors:
                          type: array
                          description: A list of attributes that failed validation
                          items:
                            type: object
                            properties:
                              attribute:
                                type: string
                                description: >-
                                  The path to the attribute that failed
                                  validation
                              code:
                                type: string
                                description: >-
                                  An error code of this attribute's specific
                                  validation error
                              message:
                                type: string
                                description: >-
                                  A human-readable error message of this
                                  attribute's specific validation error
                type: object
                title: Validation Error
              example:
                error:
                  - code: validation_error
                    message: Validation Error
                    errors:
                      - attribute: query -> subject
                        code: missing
                        message: field required
      security:
        - oauth:
            - capi:read
components:
  schemas:
    Customer:
      properties:
        authenticated:
          type: boolean
          title: Authenticated
          description: >-
            This represents either an authenticated user or location-based
            adjacent details inferred by Supertab
        user:
          anyOf:
            - $ref: '#/components/schemas/User'
            - type: 'null'
          description: >-
            The user data of the authenticated user. This will be `null` for
            unauthenticated users
        tab:
          $ref: '#/components/schemas/Tab'
          description: >-
            The Tab is at the heart of Supertab. It aggregates purchases
            customers make and tracks when they are required to make payment.


            While the Tab powers much of our underlying behaviour you will not
            often directly interact with it.
      type: object
      required:
        - authenticated
        - user
        - tab
      title: Customer
    User:
      properties:
        id:
          type: string
          format: tagged_id
          title: Id
          examples:
            - user.4df706b5-297a-49c5-a4cd-2a10eca12ff9
        email:
          anyOf:
            - type: string
              format: email
            - type: 'null'
          title: Email
        first_name:
          anyOf:
            - type: string
            - type: 'null'
          title: First Name
        last_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Name
        is_guest:
          type: boolean
          title: Is Guest
        guest_email:
          anyOf:
            - type: string
              format: email
            - type: 'null'
          title: Guest Email
      type: object
      required:
        - id
        - email
        - first_name
        - last_name
        - is_guest
        - guest_email
      title: User
    Tab:
      properties:
        test_mode:
          type: boolean
          title: Test Mode
          description: >-
            Is this a test mode tab.


            Test mode tabs grant entitlement as usual but will not result in
            actual charges to customers. Test mode tabs are generated from test
            clients.
        currency:
          $ref: '#/components/schemas/Currency'
          description: >-
            The currency of the tab. All purchases on this tab must be made in
            this currency.
        total:
          $ref: '#/components/schemas/Price'
          description: The current total value of purchases made on this tab
        limit:
          $ref: '#/components/schemas/Price'
          description: >-
            The limit which when reached will require the customer to make
            payment.
        purchases:
          items:
            $ref: '#/components/schemas/Purchase'
          type: array
          title: Purchases
          description: >-
            Details of what this customer has purchased from your merchant
            account.


            The purchases of the user that have been made with the other
            merchants are shown as a single purchase, which accumulates all
            totals into one and has a `null` value instead of a Purchase ID.
      type: object
      required:
        - test_mode
        - currency
        - total
        - limit
        - purchases
      title: Tab
      description: >-
        The Tab is at the heart of Supertab.

        It aggregates purchases customers make and tracks when they are required
        to make payment.


        While the Tab powers much of our underlying behaviour you will not often
        directly interact with it.
    Currency:
      properties:
        code:
          type: string
          title: Code
          description: ISO2417 currency code
          examples:
            - USD
        name:
          type: string
          title: Name
          description: Full name
          examples:
            - US Dollar
        symbol:
          type: string
          title: Symbol
          description: Unicode currency symbol
          examples:
            - $
        base_unit:
          type: integer
          title: Base Unit
          description: >-
            The relationship between the currency's minor and major unit.


            For most currencies including USD & EUR this will be `100`. For
            currencies which do not use decimals (e.g JPY) this will `1`
          examples:
            - 100
      type: object
      required:
        - code
        - name
        - symbol
        - base_unit
      title: Currency
      description: Supertab is available in many currencies.
    Price:
      properties:
        amount:
          type: integer
          title: Amount
          description: Price amount expressed in currency base units
          examples:
            - 50
        currency:
          $ref: '#/components/schemas/Currency'
          description: The price's currency
      type: object
      required:
        - amount
        - currency
      title: Price
      description: An amount of money
    Purchase:
      properties:
        id:
          anyOf:
            - type: string
              format: tagged_id
              examples:
                - purchase.4df706b5-297a-49c5-a4cd-2a10eca12ff9
            - type: 'null'
          title: Id
          description: >-
            When a Purchase has been made with you, shows the ID of the
            Purchase. Otherwise obfuscated and is shown as `null`.
          examples:
            - purchase.cf637646-71a4-430d-aaea-a66f1a48a83c
        offering_id:
          anyOf:
            - type: string
              format: tagged_id
              examples:
                - offering.4df706b5-297a-49c5-a4cd-2a10eca12ff9
            - type: 'null'
          title: Offering Id
          description: >-
            Which offering was purchased, if this purchase resulted from
            purchasing a pre-defined offering.
        onetime_offering_id:
          anyOf:
            - type: string
              format: tagged_id
              examples:
                - onetime_offering.4df706b5-297a-49c5-a4cd-2a10eca12ff9
            - type: 'null'
          title: Onetime Offering Id
          description: >-
            Which one-time offering was purchased, if this purchase resulted
            from purchasing a one-time offering.
        purchased_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Purchased At
          description: The time the purchase completed.
          examples:
            - '2025-01-01T12:00:00Z'
        completed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Completed At
          description: >-
            The time the purchase completed.


            Where Supertab requires a payment this will be null until the
            payment completes.
          examples:
            - '2025-01-01T12:00:00Z'
        description:
          type: string
          title: Description
          description: >-
            A summary of the purchase, usually including the site name and the
            type of a given entitlement.
          examples:
            - The Leek - 24 Hours Time Pass
            - 1 Month Subscription
        price:
          $ref: '#/components/schemas/Price'
        status:
          $ref: '#/components/schemas/PurchaseStatus'
          description: >-
            The status of the purchase.


            Purchases may be pending or completed.


            Only completed purchases grant access, pending purchases are
            purchases which require payment before entitlement is granted
        metadata:
          additionalProperties:
            anyOf:
              - type: number
              - type: boolean
              - type: integer
              - type: string
              - type: 'null'
          type: object
          title: Metadata
          description: >-
            Freeform metadata associated with the purchase.


            This can be used for e.g associating the purchase with a user
            identifier in your system
          default: {}
        entitlement_status:
          anyOf:
            - $ref: '#/components/schemas/EntitlementStatus'
            - type: 'null'
          description: The customer's access (if any) as a result of this purchase
      type: object
      required:
        - id
        - offering_id
        - onetime_offering_id
        - purchased_at
        - completed_at
        - description
        - price
        - status
        - metadata
        - entitlement_status
      title: Purchase
    PurchaseStatus:
      type: string
      enum:
        - completed
        - pending
        - abandoned
      title: PurchaseStatus
      description: |-
        We use this enum to represent the status of a purchase.

        The status can be:
        - completed: the purchase was successfully completed
        - pending: the purchase is pending
        - abandoned: the purchase was abandoned

        The logic to determine the status of a purchase is:
            PAY_LATER on Tab -> purchase.status
            PAY_NOW in a paid Tab -> completed
            PAY_NOW in an unpaid Tab -> pending

            Abandoned purchases are not being set at the moment.
            Purchases are going to be marked as abandoned when new pending
            purchases are added to the tab.
    EntitlementStatus:
      properties:
        content_key:
          type: string
          title: Content Key
          description: The content_key being checked
          examples:
            - site.cf637646-71a4-430d-aaea-a66f1a48a83c
        has_entitlement:
          type: boolean
          title: Has Entitlement
          description: If the customer has access to this content
        expires:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Expires
          description: When the customer's access will expire
        recurs_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Recurs At
          description: >-
            If this access is a result of a subscription, the time the
            subscription will renew unless cancelled by the customer.
      type: object
      required:
        - content_key
        - has_entitlement
        - expires
        - recurs_at
      title: EntitlementStatus
      description: A customer's entitlement status to a given content_key
  securitySchemes:
    oauth:
      type: oauth2
      description: >-
        Supertab OAuth2 flow for CAPI. See
        [Authentication](/customer-api/authentication).
      flows:
        authorizationCode:
          scopes:
            capi:read: Access to view capi
            capi:write: Access to write for capi
          authorizationUrl: https://auth.supertab.co/oauth2/auth
          tokenUrl: https://auth.supertab.co/oauth2/token

````