Card API

Attribute

Name Type Description
object string

The string card.

id object_id

The CARD_ID.

livemode boolean

Whether this is a live (true) or test (false) card.

location string

Path to retrieve the card.

country string

Country code based on the card number following the ISO 3166 standard. Note that this information is given for information only and may not always be 100% accurate.

city string

The city.

bank string

Bank name based on the issuer identification number of the card (first six digits). Note that this information is given for information only and may not always be 100% accurate.

postal_code string

The postal code

financing string

Type of credit card financing (debit or credit).

last_digits string

Last 4 digits of the card number.

brand string

Card brand (e.g.: Visa, Mastercard,...).

expiration_month integer

Card expiration month (1-12).

expiration_year integer

Card expiration year.

fingerprint string

Unique card-based fingerprint. Allows detection of identical cards.

name string

Card owner full name.

created datetime

Creation date of the card in ISO 8601 format.

Example

  • Json Response

List all cards

- GET https://api.omise.co/customers/CUSTOMER_ID/cards

Returns a list of cards objects.

Return all cards that belongs to the customer CUSTOMER_ID. You can learn more about lists in the pagination documentation.

Query Parameter

Name Type Description
offset integer

(optional, default: 0) The offset of the first record returned. I.e.: How many records to skip from the beginning.

limit integer

(optional, default: 20, maximum: 100) The maximum amount of records returned.

from datetime

(optional, default: 1970-01-01T00:00:00Z, format: ISO 8601) The UTC date and time limiting the beginning of returned records. E.g.: 2014-10-20T00:00:00Z

to datetime

(optional, default: current UTC Datetime, format: ISO 8601) The UTC date and time limiting the end of returned records. E.g.: 2015-01-20T00:00:00Z

order string

(optional, default: chronological) The order of the list returned. E.g.: chronological(from earliest to latest), reverse_chronological(from latest to earliest)

Example

  • List all cards

Retrieve a card

- GET https://api.omise.co/customers/CUSTOMER_ID/cards/CARD_ID

Returns a single card object which match CARD_ID and belongs to the customer which match CUSTOMER_ID.

Example

  • Retrieve a card

Update a card

- PATCH https://api.omise.co/customers/CUSTOMER_ID/cards/CARD_ID

Update the card which match CARD_ID and belongs to the customer which match CUSTOMER_ID.

Request Parameter

Name Type Description
name string

(optional) The cardholder name as printed on the card.

expiration_month integer

(optional) The expiration month printed on the card.

expiration_year integer

(optional) The expiration year printed on the card in the format YYYY.

postal_code string

(optional) The postal code from the city where the card was issued.

city string

(optional) The city where the card was issued.

Example

  • Update a card

Destroy a card

- DELETE https://api.omise.co/customers/CUSTOMER_ID/cards/CARD_ID

Destroy the card which match CARD_ID and belongs to the customer which match CUSTOMER_ID.

Example

  • Destroy a card

  • Response (JSON)