Saltar para o conteúdo principal
GET
GET /token/{token} informa se um token que você armazenou ainda pode ser cobrado. Chame-o antes de uma nova tentativa ou de uma cobrança agendada quando você guarda tokens por muito tempo, ou depois de receber um webhook token.deleted ou token.erased. Um token está em um de quatro estados: erasesAt fica vazio enquanto uma assinatura ativa ou um beneficiário de repasses ainda usa o cartão (heldBySubscription é true). Ele se move para mais adiante sempre que o token é usado de novo. Depois do apagamento, brand, last4, expiryMonth e expiryYear permanecem, então pagamentos antigos continuam mostrando o cartão. Veja o ciclo de vida do token para as regras de retenção e os códigos de erro que uma cobrança retorna.

Autorizações

Authorization
string
header
obrigatório

Your secret API key: Bearer prv_production_xxx (production) or Bearer prv_sandbox_xxx (sandbox).

Parâmetros de caminho

token
string
obrigatório

The token returned when the card was stored (vt_...).

Parâmetros de consulta

merchantCode
string

Your merchant account identifier.

Resposta

Token status

token
string
status
enum<string>

active, deleted (still charges until erasesAt), erased (card data permanently erased; cannot be charged) or expired.

Opções disponíveis:
active,
deleted,
erased,
expired
deletedAt
string<date-time> | null

When the card was deleted or retired.

deletedReason
string | null

deleted when the shopper or a support agent removed the card or a newer save replaced it; expired or unused when Therius retired it; null while the token is active.

erasedAt
string<date-time> | null

When the card data was erased.

erasesAt
string<date-time> | null

When the card data will be erased if the token is not used again. null while a live subscription or payout still uses the card. Using the token again moves this date.

heldBySubscription
boolean

true when a deleted card is kept because an active subscription still renews on it.

brand
string | null

Card brand. Kept after the card data is erased.

last4
string | null

Last four digits. Kept after the card data is erased.

expiryMonth
string | null
expiryYear
string | null