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

Retrieve a Customer

Retrieve complete information about a customer including their saved cards, email, description, and metadata.


๐Ÿ”‘API Credentials

Request Parametersโ€‹

Required - 1 fieldRequired Parameters
โ–ผ
`id`STRING(required)
The customer ID to retrieve (must start with cust_).
Example:"cust_test_5xuy4w91xqz7d1w9u0t"
Constraints:Must be a valid customer ID

Responsesโ€‹

200

Customer retrieved successfully

Customer object returned with all details including saved cards.

Customer object includes:
  • id - Customer ID
  • email - Customer email address
  • description - Customer name or description
  • default_card - ID of default payment card
  • cards - List object with all saved cards
  • metadata - Custom key-value data
  • created_at - ISO 8601 timestamp of creation

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 ID not found.

Common causes:
  • Customer ID does not exist
  • Customer has been deleted
  • Incorrect customer ID format

Code samplesโ€‹

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

Error and result codesโ€‹

Common Error Codesโ€‹

CodeDescriptionResolution
authentication_failureInvalid API keyVerify your secret key is correct
not_foundCustomer not foundVerify customer ID exists
bad_requestInvalid customer ID formatCheck ID starts with cust_

Customer Response Fieldsโ€‹

FieldDescription
idCustomer ID (cust_*)
emailCustomer email address
descriptionCustomer name or description
default_cardID of default payment card
cardsList object with all saved cards
cards.dataArray of card objects
cards.totalTotal number of saved cards
metadataCustom key-value data
created_atCustomer creation timestamp

Try it outโ€‹

Required - 1 fields
โ–ผ