Card API

Card API สามารถใช้เพื่อเรียกดู, อัปเดต และลบข้อมูลบัตรเครดิตที่ได้มีการจัดเก็บไว้ได้ ส่วนบัตรใบใหม่ๆ ที่มีการสร้างเพิ่มขึ้นมาโดยการใช้ token สามารถสร้างเป็นลูกค้า (customer) ขึ้นใหม่ หรือเพิ่มเข้าไปกับลูกค้าเดิมที่มีอยู่แล้ว

Attributes

Name Type Description
object string

The string card.

id string

The card identifier matching /card(_test)?_[0-9a-z]+/.

livemode boolean

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

location string

API path to retrieve the current card object.

bank string

Card bank name. Note: derived from issuer identification number (IIN); may not be accurate.

brand string

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

city string

Billing address city.

country string

Billing address country as two-letter ISO 3166 code. Note: if not supplied at token creation, value derived from issuer identification number (IIN) so may not be accurate.

created_at string

UTC datetime of card creation in ISO 8601 format (YYYY-MM-DDThh:mm:ssZ).

deleted boolean

Whether card is deleted.

email string

The email address of the customer

expiration_month integer

Card expiration month (M or MM).

expiration_year integer

Card expiration year (YYYY).

financing string

Type of credit card financing. One of credit, debit, or prepaid. Note: derived from issuer identification number (IIN); may not be accurate.

fingerprint string

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

first_digits string

First six (6) digits of card number. Value will be present only for specific merchants based on additional security/business assessments.

last_digits string

Last four (4) digits of card number.

name string

Card owner name.

phone_number string

Phone number.

postal_code string

Card postal code.

security_code_check boolean

Whether card passed pre-authorization. A card may fail pre-authorization for several reasons including, but not limited to, having an invalid security_code. As of 1 April 2020, this attribute only returns true regardless of the actual pre-authorization result.

state string

Billing address state.

street1 string

Billing address street #1.

street2 string

Billing address street #2.

tokenization_method string

The method by which a card is tokenized. The possible values are:

  • googlepay (when tokenized by Google Pay

  • null (when tokenized by Opn). This is the default value.

Example

  • JSON Response

Destroy a card

- DELETE https://api.omise.co/customers/{id}/cards/{card_id}

Destroys the card matching :card_id belonging to customer matching :id.

Example

  • Destroy a card

List cards

- GET https://api.omise.co/customers/{id}/cards

Returns a list of cards belonging to customer matching :id.

Request Parameters

Name Type Description
from string

(optional, default: 1970-01-01T00:00:00Z) Earliest UTC datetime for returned records in ISO 8601 format (YYYY-MM-DDThh:mm:ssZ).

limit integer

(optional, default: 20) Number of records returned.

offset integer

(optional, default: 0) Offset of the first record returned (i.e. how many records to skip from the beginning).

order string

(optional, default: chronological, one of: chronological, reverse_chronological) Order of records returned.

to string

(optional) Latest UTC datetime for returned records in ISO 8601 format (YYYY-MM-DDThh:mm:ssZ).

Example

  • List all cards

Retrieve a card

- GET https://api.omise.co/customers/{id}/cards/{card_id}

Returns the card matching :card_id belonging to customer matching :id.

Example

  • Retrieve a card

Update a card

- PATCH https://api.omise.co/customers/{id}/cards/{card_id}

Updates the card matching :card_id belonging to customer matching :id.

Request Parameters

Name Type Description
city string

(optional, but recommended) Billing address city. Supplying the cardholder's billing address improves your authorization rate for US, UK, and Canadian cardholders.

expiration_month integer

(optional) Card expiration month (M or MM).

expiration_year integer

(optional) Card expiration year (YY or YYYY).

name string

(optional) Card owner name.

postal_code string

(optional, but recommended) Card postal code. Supplying the cardholder's billing address improves your authorization rate for US, UK, and Canadian cardholders.

Example

  • Update a card

เว็ปไซต์นี้มีการใช้คุกกี้เพื่อวิเคราะห์การใช้และปรับการใช้งานให้เหมาะกับท่าน เมื่อกดยอมรับหรือยังคงเข้าชมเว็บไซต์ต่อ เราถือว่าท่านยินยอมในการใช้งานคุกกี้ของเว็บไซต์ อ่านนโยบายความเป็นส่วนตัว