Source API

The Source API allows you to 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). Note: this endpoint accepts both public and private key authentication.

Attribute

Name Type Description
object string

The string source.

id object_id

The SOURCE_ID matching /src(_test)?_[1-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

(For use with installments only) Either customer or merchant. Determines who absorbs the interest. Can be set via the dashboard.

amount integer

The amount expressed as a positive integer in the smallest unit for a given currency (e.g. 100 satangs equals THB 1). See supported currencies by country for maximum and minimum.

barcode string

Barcode number.

currency string

The currency expressed as its lower-cased international 3-letter code defined by the ISO 4217 standard (see supported currencies by country).

email string

(Only for convenence store, pay-easy, or online banking payments in Japan) Email address associated with the source.

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 integer

(For use with installments only) The installment term in months. See installments for allowed values.

name string

(Only for convenence store, pay-easy, or online banking payments in Japan) Source name (e.g. person name).

phone_number string

(Only for convenence store, pay-easy, or online banking payments in Japan) Source phone number.

references References

Reference information about the payment (e.g. expiration time).

store_id string

Store ID for transaction.

store_name string

Store name for transaction.

terminal_id string

Terminal ID for transaction.

type string

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

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

See installments and payment methods for details.

Example

  • Json Response

Create a source

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

Creates and returns a new source.

Request Parameter

Name Type Description
type string

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

amount integer

(required) The amount in the smallest subunits of the currency used. For thb (Thai Baht) you'll need to pass the amount in satangs.

currency string

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

barcode string

(optional) Barcode number

store_id string

(optional) Store ID for transaction

store_name string

(optional) Store name for transaction

terminal_id string

(optional) Terminal ID for transaction

installment_terms integer

(optional) (For use with installments only) The installment term in months. See installments for allowed values.

name string

(optional) (Only for convenence store, pay-easy, or online banking payments in Japan) Source name (e.g. person name).

email string

(optional) (Only for convenence store, pay-easy, or online banking payments in Japan) E-mail address associated with the source.

phone_number string

(optional) (Only for convenence store, pay-easy, or online banking payments in Japan) Source phone number.

Example

  • Create a source

Retrieve a source

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

Retrieve a source that has been already created.

Example

  • Retrieve a source