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

amount integer

Source amount in smallest unit of source currency

bank string

Bank (type=fpx)

barcode string

Barcode number (type=barcode_alipay,barcode_wechat)

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_*)

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:

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

(type=alipay_cn,alipay_hk,dana,gcash,kakaopay,touch_n_go)

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

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

items items

Item containing details of item (type=atome)

shipping address

Address Shipping address (type=atome)

billing address

Address Billing address

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, atome, atome_qr, barcode_alipay, barcode_wechat, bill_payment_tesco_lotus, bkash, dana, easypaisa, econtext, fpx, gcash, installment_bay, installment_bbl, installment_citi, installment_ezypay, installment_first_choice, installment_kbank, installment_ktc, installment_scb, internet_banking_bay, internet_banking_bbl, internet_banking_ktb, internet_banking_scb, kakaopay, mobile_banking_scb, paynow, points_citi, promptpay, qr_code_upi, rabbit_linepay, touch_n_go, truemoney) Payment source type

bank string

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

barcode string

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

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_*)

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.

(type=alipay_cn,alipay_hk,dana,gcash,kakaopay,touch_n_go)

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)

items items

(optional, but conditionally required) Items for payment source (type=atome)

shipping shipping

(optional, but conditionally required) Shipping address for payment source (type=atome)

billing billing

(optional) Billing address for payment source

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

Item

- POST

The following parameters for item of the source.

Request Parameters

Name Type Description
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

Address

- POST

The following parameters for shipping and billing address of the source.

Request Parameters

Name Type Description
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

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