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

Retrieve a Card

Retrieve detailed information about a specific card attached to a customer.


๐Ÿ”‘API Credentials

Request Parametersโ€‹

Required - 2 fieldsPath Parameters
โ–ผ
`id`STRING(required)
Customer ID (must be a valid customer ID starting with cust_).
Example:"cust_test_5xuy4w91xqz7d1w9u0t"
Constraints:Must be a valid customer ID
`card_id`STRING(required)
Card ID (must be a valid card ID starting with card_).
Example:"card_test_5xuy4w91xqz7d1w9u0t"
Constraints:Must be a valid card ID, Card must belong to the customer

Responsesโ€‹

200

Card retrieved successfully

Card object with complete details.

Card details include:
  • id - Card ID
  • brand - Card brand (Visa, MasterCard, JCB, etc.)
  • last_digits - Last 4 digits of card number
  • first_digits - First 6 digits (BIN) - may be null
  • name - Cardholder name
  • expiration_month - Expiration month (1-12)
  • expiration_year - Expiration year (YYYY)
  • bank - Issuing bank name
  • country - Card issuing country (ISO 3166-1 alpha-2)
  • fingerprint - Unique card identifier
  • security_code_check - Whether CVV was verified

400

Bad request

Invalid customer ID or card ID format.

Common causes:
  • Invalid ID format
  • IDs do not start with cust_ or card_

401

Unauthorized

Authentication failed. Invalid or missing API key.

Common causes:
  • Missing Authorization header
  • Invalid secret key
  • Using public key instead of secret key
  • Incorrect HTTP Basic Auth format

404

Not found

Customer or card not found.

Common causes:
  • Customer ID does not exist
  • Card ID does not exist
  • Card does not belong to the specified customer

Code samplesโ€‹

curl https://api.omise.co/customers/cust_test_5xuy4w91xqz7d1w9u0t/cards/card_test_5xuy4w91xqz7d1w9u0t \
-u skey_test_5xuy4w91xqz7d1w9u0t:

Error and result codesโ€‹

Common Error Codesโ€‹

CodeDescriptionResolution
bad_requestInvalid ID formatCheck customer and card ID formats
authentication_failureInvalid API keyVerify your secret key is correct
not_foundCustomer or card not foundVerify IDs exist and card belongs to customer

Card Response Fieldsโ€‹

FieldDescription
idCard ID (card_*)
brandCard brand (Visa, MasterCard, etc.)
last_digitsLast 4 digits of card number
first_digitsFirst 6 digits (BIN)
nameCardholder name
expiration_monthExpiration month (1-12)
expiration_yearExpiration year (YYYY)
bankIssuing bank name
countryCard issuing country
fingerprintUnique card identifier
security_code_checkWhether CVV was verified
created_atCard creation timestamp

Try it outโ€‹

Required - 2 fields
โ–ผ