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

# Tokenize card

> Converts card data into a token, to be sent in `card.cardToken` when creating the charge.



## OpenAPI

````yaml /openapi.yaml post /card-token
openapi: 3.0.3
info:
  title: Fincle API
  version: 1.0.0
  description: >-
    Fincle payments API: charges by Pix, credit card and boleto, subscriptions,
    transactions, refunds, infractions, notifications and transfers.
servers:
  - url: https://api.fincle.com.br
    description: Production server
security: []
tags:
  - name: Authentication
    description: Issuance of the access token from the API key.
  - name: Charges
    description: Creation of charges by Pix, credit card and boleto.
  - name: Subscriptions
    description: Recurring billing on credit card.
  - name: Transactions
    description: Retrieval and refund of transactions.
  - name: Refunds
    description: Refund requests submitted by payers.
  - name: Infractions and MED
    description: Pix infraction reports and the amounts blocked as a result.
  - name: Webhooks
    description: Registration of notification endpoints and tracking of deliveries.
  - name: Balance and transfers
    description: Balance, statement, fees and transfer of the amounts received.
paths:
  /card-token:
    post:
      tags:
        - Charges
      summary: Tokenize card
      description: >-
        Converts card data into a token, to be sent in `card.cardToken` when
        creating the charge.
      operationId: createCardToken
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                number:
                  allOf:
                    - type: string
                    - type: string
                holderName:
                  type: string
                  minLength: 2
                expirationMonth:
                  anyOf:
                    - type: string
                      pattern: ^(0?[1-9]|1[0-2])$
                    - type: number
                      minimum: 1
                      maximum: 12
                expirationYear:
                  anyOf:
                    - type: string
                      pattern: ^\d{2}$
                    - type: string
                      pattern: ^\d{4}$
                    - type: number
                      minimum: 0
                      maximum: 99
                    - type: number
                      minimum: 2020
                      maximum: 2100
                cvv:
                  type: string
                  pattern: ^\d{3,4}$
              required:
                - number
                - holderName
                - expirationMonth
                - expirationYear
                - cvv
              additionalProperties: false
            example:
              number: '4111111111111111'
              holderName: HELENA M ANDRADE
              expirationMonth: '08'
              expirationYear: '2029'
              cvv: '123'
      responses:
        '200':
          description: Request processed successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  token:
                    type: string
                required:
                  - success
                  - token
                additionalProperties: false
              example:
                success: true
                token: tok_9f2c1a7b4d6e
        '400':
          description: Request rejected due to a validation failure or a business rule.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
                required:
                  - success
                  - message
              example:
                success: false
                message: Documento inválido para o tipo selecionado
        '401':
          description: Access token missing, invalid or expired.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
                required:
                  - success
                  - message
              example:
                success: false
                message: Não autorizado
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

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