Source API

Create and retrieve payment sources. Sources are methods for accepting payments through non-credit-card channels (including Alipay, convenience store, internet banking and installment payments).

Attributes

Name Type Description
object string

The string source.

id object_id

The source identifier 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

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

amount integer

Source amount in smallest unit of source currency.

barcode string

Barcode number (type=barcode_alipay).

created datetime

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

currency currency_lowercase

Currency for source as three-letter ISO 4217 code.

email string

Payer email address (type=econtext).

flow string

The payment flow payers need to go through to complete the payment. One of redirect or offline:

  • redirect: payer must be redirected to external website (charge.authorize_uri) to complete payment.
  • offline: payer will receive payment information to complete payment offline (charge.source.references).
installment_terms string

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

mobile_number string

Payer phone number (type=econtext,truemoney).

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).

scannable_code string

Barcode object.

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

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
  • points_citi
  • 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 Parameters

Name Type Description
amount integer

(required) Source amount in smallest unit of source currency.

currency currency_lowercase

(required) Currency for source as three-letter ISO 4217 code.

type string

(required) 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
  • points_citi
  • truemoney

See installments for allowed values.

barcode string

(optional, but conditionally required) Barcode number (type=barcode_alipay).

email string

(optional, but conditionally required) Payer email address (type=econtext).

installment_terms integer

(optional, but conditionally required) Installment term in months. See installments for allowed values (type=installment_*).

name string

(optional, but conditionally required) Payer name (type=econtext).

phone_number string

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

store_id string

(optional, but conditionally required) Store ID for payment source (type=barcode_alipay).

store_name string

(optional, but conditionally required) Store name for payment source (type=barcode_alipay).

terminal_id string

(optional, but conditionally required) Terminal ID for payment source (type=barcode_alipay).

zero_interest_installments boolean

(optional) Whether merchant absorbs the interest for installment payments (type=installment_*).

Example

  • Create a source with a public key

Retrieve a source

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

Returns the source matching :id. Note: this verb accepts only secret key authentication.

Example

  • Retrieve a source with a secret key