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

# Tokenize card data for a session (iframe / allowed origins only)



## OpenAPI

````yaml /openapi.json post /api/v1/elements/tokenize
openapi: 3.0.0
info:
  title: Axra Public API
  description: Merchant and third-party developer API surface
  version: '2026-04-15'
  contact: {}
servers:
  - url: http://localhost:3001
    description: Local development
  - url: https://staging-api.useaxra.com
    description: Staging
  - url: https://api.useaxra.com
    description: Production
security: []
tags: []
paths:
  /api/v1/elements/tokenize:
    post:
      tags:
        - Elements
      summary: Tokenize card data for a session (iframe / allowed origins only)
      operationId: ElementsController_tokenize
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TokenizeElementsDto'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    $ref: '#/components/schemas/ElementsTokenResponseDto'
                required:
                  - success
                  - data
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpErrorEnvelopeDto'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpErrorEnvelopeDto'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpErrorEnvelopeDto'
        '422':
          description: Unprocessable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpErrorEnvelopeDto'
        '429':
          description: Too many requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpErrorEnvelopeDto'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpErrorEnvelopeDto'
components:
  schemas:
    TokenizeElementsDto:
      type: object
      properties:
        sessionId:
          type: string
          description: Session id returned from POST /elements/session
          example: es_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
        number:
          type: string
          example: '4242424242424242'
        expMonth:
          type: number
          example: 12
          minimum: 1
          maximum: 12
        expYear:
          type: number
          example: 2030
          minimum: 2024
          maximum: 2100
        cvc:
          type: string
          example: '123'
      required:
        - sessionId
        - number
        - expMonth
        - expYear
        - cvc
    ElementsTokenResponseDto:
      type: object
      properties:
        id:
          type: string
        last4:
          type: string
        brand:
          type: string
        expiresInSeconds:
          type: number
      required:
        - id
        - last4
        - brand
        - expiresInSeconds
    HttpErrorEnvelopeDto:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          $ref: '#/components/schemas/HttpErrorBodyDto'
      required:
        - success
        - error
    HttpErrorBodyDto:
      type: object
      properties:
        code:
          type: string
          example: VALIDATION_ERROR
        message:
          type: string
          example: email must be an email
        statusCode:
          type: number
          example: 400
        errors:
          type: object
          description: >-
            Optional per-field validation messages (when present on the source
            exception)
          additionalProperties:
            type: array
            items:
              type: string
      required:
        - code
        - message
        - statusCode

````