Source API

ในการรับชำระเงินผ่านช่องทางใดๆ ที่นอกเหนือจากบัตรเครดิตและบัตรเดบิต ให้ทำการสร้าง source ของรายการนั้นๆ ก่อนแล้วจึงนำ source ไปสร้างรายการรับชำระเงิน

Attribute

Name Type Description
object string

The string source.

id object_id

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

livemode boolean

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

location string

API path to retrieve the current source object.

absorption_type string

Who absorbs interest for installment payments. One of customer or merchant (type=installment_*).

amount integer

Amount for source in smallest currency unit.

barcode string

Barcode number (type=barcode_alipay).

currency string

Currency for source as three-letter ISO 4217 code.

email string

Email address associated with the source. (type=econtext).

flow string

The payment flow customers need to go through to complete the payment. Value can be one of the following:

  • redirect: a customer needs to be redirected to the external website with authorize_uri in the charge to complete the payment, e.g. internet banking.
  • offline: a customer will receive payment information in the charge to pay offline, e.g. bill payment at a department store.

installment_terms string

Installment term in months. See installments for allowed values (type=installment_*).

name string

Payer name (type=econtext).

phone_number string

Payer phone number (type=econtext,truemoney).

references references

Reference information about the payment (type=bill_payment_tesco_lotus,econtext,barcode_alipay).

store_id string

Store ID for payment source (type=barcode_alipay).

store_name string

Store name for payment source (type=barcode_alipay).

terminal_id string

Terminal ID for payment source (type=barcode_alipay).

type string

The payment source type. Value can be one of the following (depending on account and country):

  • alipay
  • barcode_alipay
  • bill_payment_tesco_lotus
  • econtext
  • installment_bay
  • installment_bbl
  • installment_first_choice
  • installment_kbank
  • installment_ktc
  • internet_banking_bay
  • internet_banking_bbl
  • internet_banking_ktb
  • internet_banking_scb
  • truemoney

See installments for allowed values.

Example

  • Json Response

Create a source

- POST https://api.omise.co/sources

Creates and returns a new source. Note: this verb accepts both public and secret key authentication. Sources can also be created and charged directly using the Charge API.

Request Parameter

Name Type Description
type string

(required) The source payment type. See attribute section above for the available types.

amount integer

(required) Amount for source in the smallest currency unit.

currency string

(required) The currency in which you want the payment to be done.

barcode string

(optional) Barcode number (type=barcode_alipay)

store_id string

(optional) Store ID for payment source (type=barcode_alipay)

store_name string

(optional) Store name for payment source (type=barcode_alipay)

terminal_id string

(optional) Terminal ID for payment source (type=barcode_alipay)

installment_terms integer

(optional) The installment term in months. See installments for allowed values (type=installment_*).

name string

(optional) Payer name (type=econtext).

email string

(optional) E-mail address associated with the payer. (type=econtext).

phone_number string

(optional) Payer phone number. (type=econtext,truemoney).

Example

  • Create a source

Retrieve a source

- GET https://api.omise.co/sources/SOURCE_ID

Retrieves a source that has already been created. Note: this verb accepts only secret key authentication.

Example

  • Retrieve a source