> For the complete documentation index, see [llms.txt](https://docs.barte.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.barte.com/api-reference/tokenizacao-de-cartao-one-buy-click/criar-token-do-cartao.md).

# Criar Token do Cartão

## Criar Card Token

> Cria um token seguro para um cartão de crédito, permitindo armazenamento seguro e reutilização dos dados do cartão sem expor informações sensíveis. ⚠️ IMPORTANTE: Criar card token com CVV falso retornará status PENDING e causará erro na criação da cobrança.

```json
{"openapi":"3.0.3","info":{"title":"API de Card Tokens e Pagamentos","version":"2.0.0"},"servers":[{"url":"https://api.barte.com","description":"Servidor de Produção"},{"url":"https://sandbox-api.barte.com","description":"Servidor de Sandbox"}],"security":[{"X-Token-Api":[]}],"components":{"securitySchemes":{"X-Token-Api":{"type":"apiKey","name":"X-Token-Api","in":"header"}},"schemas":{"CreateCardTokenRequest":{"type":"object","required":["holderName","number","cvv","expiration","buyerUuid"],"properties":{"holderName":{"type":"string","maxLength":255,"description":"Nome do portador do cartão conforme impresso no cartão"},"number":{"type":"string","pattern":"^\\d{13,19}$","description":"Número do cartão de crédito"},"cvv":{"type":"string","pattern":"^\\d{3,4}$","description":"Código de segurança do cartão (CVV/CVC)"},"expiration":{"type":"string","pattern":"^(0[1-9]|1[0-2])\\/\\d{4}$","description":"Data de expiração no formato MM/AAAA"},"checkZeroDollar":{"type":"boolean","default":false,"description":"Campo opcional: true executa verificação de zero dólar no cartão"},"buyerUuid":{"type":"string","format":"uuid","description":"UUID do comprador associado ao cartão"}}},"CardTokenResponse":{"type":"object","properties":{"uuid":{"type":"string","format":"uuid","description":"UUID do token criado (usar como cardToken na criação de pedidos)"},"status":{"type":"string","enum":["ACTIVE","PENDING","INACTIVE"],"description":"Status do token (ACTIVE = válido, PENDING = verificação pendente)"},"createdAt":{"type":"string","format":"date","description":"Data de criação do token"},"brand":{"type":"string","enum":["visa","mastercard","elo","american_express","hipercard","diners"],"description":"Bandeira do cartão"},"cardHolderName":{"type":"string","description":"Nome do portador do cartão"},"cvvChecked":{"type":"boolean","description":"Indica se o CVV foi verificado"},"fingerprint":{"type":"string","description":"Fingerprint único do cartão"},"first6digits":{"type":"string","description":"Primeiros 6 dígitos do cartão"},"last4digits":{"type":"string","description":"Últimos 4 dígitos do cartão"},"buyerId":{"type":"string","format":"uuid","description":"UUID do comprador"},"expirationMonth":{"type":"string","description":"Mês de expiração"},"expirationYear":{"type":"string","description":"Ano de expiração"},"cardId":{"type":"string","format":"uuid","description":"ID único do cartão (usar para o fluxo de 3DS)"}}},"ErrorResponse":{"type":"object","properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/ErrorDetail"}},"metadata":{"$ref":"#/components/schemas/Metadata"}}},"ErrorDetail":{"type":"object","properties":{"status":{"type":"string"},"code":{"type":"string","enum":["PAYMENT-0000","PAYMENT-0500","PAYMENT-9999","BAR-7001","BAD_REQUEST","FORBIDDEN","METHOD_NOT_ALLOWED","NOT_ACCEPTABLE","UNSUPPORTED_MEDIA_TYPE","CARD-0001","CARD-0002","CARD-0003"]},"title":{"type":"string","enum":["BUSINESS_SELLER","BUSINESS_CHECKOUT","BUSINESS_COMMON","BUSINESS_SECURITY","BUSINESS_SUBSCRIPTION","INVALID_REQUEST_PARAM","BUSINESS_METRIC","BUSINESS_ACCOUNTANCY","BUSINESS_NOTIFICATION","BUSINESS_BARTE","BUSINESS_COMPANY","BUSINESS_INVOICE","BUSINESS_TRANSFER","BUSINESS_CARD","BUSINESS_ORDER","card_not_supported"]},"description":{"type":"string"},"action":{"type":"string"},"additionalInfo":{"type":"object","additionalProperties":{"type":"object"}}}},"Metadata":{"type":"object","properties":{"totalRecords":{"type":"integer"},"totalPages":{"type":"integer"},"requestDatetime":{"type":"string","format":"date-time"}}}}},"paths":{"/payment/v1/cards":{"post":{"tags":["Tokenização de Cartões"],"summary":"Criar Card Token","description":"Cria um token seguro para um cartão de crédito, permitindo armazenamento seguro e reutilização dos dados do cartão sem expor informações sensíveis. ⚠️ IMPORTANTE: Criar card token com CVV falso retornará status PENDING e causará erro na criação da cobrança.","operationId":"createCardToken","requestBody":{"description":"Dados do cartão para tokenização","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCardTokenRequest"}}}},"responses":{"201":{"description":"Token de cartão criado com sucesso","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CardTokenResponse"}}}},"400":{"description":"Requisição inválida","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Não autorizado","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Acesso proibido","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Erro interno do servidor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.barte.com/api-reference/tokenizacao-de-cartao-one-buy-click/criar-token-do-cartao.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
