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 string

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

bank string

Bank (type=fpx)

barcode string

Barcode number (type=barcode_alipay)

billing object

Billing address. See source creation parameters for more details.

charge_status string

Status of charge created using this source (if any). Value is one of allowed charge.status values or, no charge has been created, unknown

created_at string

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

currency string

Currency for source as three-letter ISO 4217 code

discounts array

Discounts (type=qr_code_upi)

email string

Payer email address (type=econtext,fpx)

flow string

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

  • 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).
  • app_redirect: payer must be redirected to an app (charge.authorize_uri) to complete payment.
installment_term integer

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

ip string

IP address provided to Opn Payments at source creation. May be IPv4 or IPv6.

items array

Information about items included in the order. See source creation parameters for more details.

mobile_number string

Payer phone number (type=econtext,truemoney)

name string

Payer name (type=econtext)

phone_number string

Payer phone number (type=econtext,truemoney)

platform_type string

Platform from which payer is making a payment. One of WEB, IOS, or ANDROID.

promotion_code string

The code that grants access to special offers or discounts provided by the service provider.

provider_references object

Denotes the transaction references for payments made. The following payment methods return transaction references:

  • promptpay
  • paynow
  • mobile_banking_scb
  • mobile_banking_ktb
  • mobile_banking_kbank
  • mobile_banking_bay
  • mobile_banking_bbl

This object returns null for all other payment providers.

receipt_amount integer

Receipt amount (type=qr_code_upi)

references object

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

scannable_code barcode

Barcode object

shipping object

Shipping address. See source creation parameters for more details.

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

zero_interest_installments boolean

Whether merchant absorbs the interest for installment payments; must match value in associated charge (type=installment_*)

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 string

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

type string

(required, one of: alipay, alipay_cn, alipay_hk, alipayplus_mpm, alipayplus_upm, atome, atome_qr, barcode_alipay, bill_payment_tesco_lotus, bkash, boost, dana, duitnow_qr, duitnow_obw, easypaisa, econtext, fpx, gcash, grabpay, installment_bay, installment_bbl, installment_first_choice, installment_kbank, installment_ktc, installment_mbb, installment_paynext_extra_jumpapp, installment_paynext_extra_qr, installment_scb, installment_ttb, installment_uob, installment_wlb_kbank, installment_wlb_ktc, installment_wlb_ttb, internet_banking_bay, internet_banking_bbl, kakaopay, maybank_qr, mobile_banking_ocbc, mobile_banking_scb, mobile_banking_kbank, mobile_banking_bbl, mobile_banking_bay, mobile_banking_ktb, paynow, paypay, points_citi, promptpay, qr_code_upi, rabbit_linepay, shopeepay, shopeepay_jumpapp, touch_n_go, truemoney, truemoney_jumpapp, truemoney_qr, wechat_pay, wechat_pay_mpm, wechat_pay_upm) Payment source type

bank string

(optional, but conditionally required) Bank (type=fpx)

barcode string

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

billing object

(optional) Billing address

  • country (string) Address country as two-letter ISO 3166 code
  • city (string) Address city
  • postal_code (string) Address postal code
  • state (string) Address state
  • street1 (string) Address street #1
  • street2 (string) (optional) Address street #2
email string

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

installment_term integer

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

ip string

(optional) IP address provided to Opn Payments at source creation. May be IPv4 or IPv6.

items array

(optional) Information about items included in the order. Array of objects with the following attributes:

  • amount (integer) (optional, but conditionally required) Selling price of the item in smallest unit of currency (type=atome)
  • sku (string) (optional, but conditionally required) SKU/product id of the item (type=atome)
  • name (string) (optional, but conditionally required) Name of the item (type=atome)
  • quantity (integer) (optional, but conditionally required) Quantity of the item (type=atome)
  • category (string) (optional) Category of the item
  • brand (string) (optional) Brand of the item
  • item_uri (string) (optional) URI of the item
  • image_uri (string) (optional) Image URI of the item
mobile_number string

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

name string

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

platform_type string

(optional, but conditionally required) Platform from which payer is making a payment. One of WEB, IOS, or ANDROID:

  • WEB(default): payer is making the payment from website.
  • IOS: payer is making the payment from iOS device.
  • ANDROID: payer is making the payment from ANDROID device.

The following payment methods support platform_type:

  • alipay_cn
  • alipay_hk
  • dana
  • gcash
  • kakaopay
  • touch_n_go
promotion_code string

(optional) The code that grants access to special offers or discounts provided by the service provider.

shipping object

(optional) Shipping address

  • country (string) Address country as two-letter ISO 3166 code
  • city (string) Address city
  • postal_code (string) Address postal code
  • state (string) Address state
  • street1 (string) Address street #1
  • street2 (string) (optional) Address street #2
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, one of: true, false) Whether merchant absorbs the interest for installment payments; must match value in associated charge (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. This verb accepts both secret and public key authentication.

Example

  • Retrieve a source with a secret key

Omise uses cookies to improve your overall site experience and collect information on your visits and browsing behavior. By continuing to browse our website, you agree to our Privacy Policy. Learn more