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

# Get Token by reference

> Get created tokens by aggregated reference



## OpenAPI

````yaml /openapi.yml get /api/v2/tokens
openapi: 3.0.3
info:
  title: Gateway API
  version: v2
  contact:
    name: Support
    email: support@paybyrd.com
  license:
    name: Copyright © Paybyrd
  termsOfService: https://paybyrd.com/en/privacy
servers:
  - url: https://gateway.paybyrd.com
    description: Production
security:
  - authByApiKey: []
paths:
  /api/v2/tokens:
    get:
      tags:
        - Tokenization
      summary: Get Token by reference
      description: Get created tokens by aggregated reference
      operationId: api-tokenize-get
      parameters:
        - name: customReference
          in: query
          description: The token reference sent in the moment of creation.
          schema:
            type: string
          required: true
        - name: isExpired
          in: query
          description: >-
            The indicator if expired tokens should be returned. The default is
            false.
          schema:
            type: boolean
          required: false
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                Result:
                  $ref: '#/components/examples/CustomTokenResponseExample'
              schema:
                $ref: '#/components/schemas/CustomReferenceTokenResponse'
      deprecated: false
components:
  examples:
    CustomTokenResponseExample:
      value:
        data:
          - tokenId: 512f2ebd-0256-423d-9d6f-433606c15f41
            customReference: Wallet123
            alias: MyPersonalCard1
            brand: MASTER
            expiration: 12/25
            maskedCardNumber: 514968******8886
        success: true
        errorCode: ''
        pagination:
          pageNumber: 1
          pageSize: 10
          total: 1
          totalAvailable: 0
  schemas:
    CustomReferenceTokenResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/TokenResponse'
        pagination:
          $ref: '#/components/schemas/PagedResponseModel'
        success:
          type: boolean
          description: Show the success of the query
          example: true
        errorCode:
          type: string
          description: In case of failure, the error message is filled here.
          example: true
    TokenResponse:
      type: object
      properties:
        tokenId:
          type: string
          description: The id of the token
          example: 5d3491c3-8978-4ff5-8d74-31b0b0499b01
        customReference:
          type: string
          description: >-
            The aggregated reference of the token (can be a walletId,
            customerId, etc...)
          example: Wallet123
        alias:
          type: string
          description: The Alias sent in the CardTokenizeRequest
          example: PersonalCard
        brand:
          type: string
          description: The brand of the card
          example: MASTER
        maskedCardNumber:
          type: string
          description: The masked card number
          example: 514968******8886
    PagedResponseModel:
      type: object
      properties:
        pageNumber:
          type: integer
          description: Number of the current page
          example: 1
        pageSize:
          type: integer
          description: Page size of current pagination
          example: 2
        total:
          type: integer
          description: Number of total items in this paged collection
          example: 100
        totalAvailable:
          type: integer
          description: Number of total available items in this paged collection
          example: 100
  securitySchemes:
    authByApiKey:
      type: apiKey
      in: header
      name: x-api-key

````