Skip to main content
Version: 2019-05-29 (Current)

Retrieve a Token

Retrieve information about an existing token including its usage status and associated card details.


๐Ÿ”‘API Credentials

Request Parametersโ€‹

Required - 1 fieldRequired Parameters
โ–ผ
`id`STRING(required)
The token ID to retrieve. Must start with tokn_ followed by test_ or live_ and a unique identifier.
Example:"tokn_test_5xuy4w91xqz7d1w9u0t"
Constraints:Must be a valid token ID, Pattern: tokn_(test|live)_[0-9a-z]+

Responsesโ€‹

200

Successful retrieval

Token retrieved successfully. Returns the token object with card details.

Response includes:
  • id - Token identifier
  • used - Whether token has been used (false if unused, true if used)
  • charge_status - Status of charge created with token (null if unused)
  • card - Card object with sanitized information
  • card.brand - Card brand (Visa, Mastercard, JCB, etc.)
  • card.last_digits - Last 4 digits of card number
  • card.fingerprint - Unique card identifier
  • card.security_code_check - Whether CVV was validated

401

Unauthorized

Authentication failed. Invalid or missing API key.

Common causes:
  • Missing Authorization header
  • Invalid public key
  • Incorrect HTTP Basic Auth format

404

Not found

Token not found. The specified token ID does not exist.

Common causes:
  • Invalid token ID format
  • Token ID does not exist in your account
  • Using test key to access live token (or vice versa)
  • Typo in token ID

Code samplesโ€‹

curl https://vault.omise.co/tokens/tokn_test_5xuy4w91xqz7d1w9u0t \
-u pkey_test_5xuy4w91xqz7d1w9u0t:

Error and result codesโ€‹

Common Error Codesโ€‹

CodeDescriptionResolution
authentication_failureInvalid API keyVerify your public key is correct
not_foundToken not foundCheck token ID is valid and exists

Token Statusโ€‹

FieldValueDescription
usedfalseToken is unused and available
usedtrueToken has been used and cannot be reused
charge_statusnullToken not yet used
charge_statussuccessfulToken used for successful charge
charge_statusfailedToken used but charge failed
charge_statuspendingToken used, charge pending

Try it outโ€‹

Required - 1 fields
โ–ผ