Bill Payment

Bill payment allows customers to make cash payment over-the-counter at supported outlets by presenting a unique barcode generated by the store.

Bill payments are now supported at over 1800 Tesco Lotus branches across Thailand. Support for other payment outlets will be added soon.

* Tesco Lotus charges a small transaction fee of THB 10 from the payee at payment point.

The payment flow

Once your customer comes to the checkout process, they enter their shipping details and confirm their order, the next step is to select their preferred payment method. To pay over-the-counter, select Tesco Lotus as shown below.

Bill payment flow

System will then generate a unique barcode which they can present at the payment counter to pay. This barcode will expire in 24 hours.

Bill payment flow 2

The height of the barcode presented at payment point must be no less than 1 centimeter.

Creating a charge by using Payment Source

In order to create a bill payment charge, you need to create source object by using the source api.
The following code demonstrates how to create source.

curl https://api.omise.co/sources \
  -X POST \
  -u skey_test_59npyqikgqxtfqmfgq6: \
  -d "amount=10025" \
  -d "currency=thb" \
  -d "type=bill_payment_tesco_lotus"

Note that the amount must be less than or equal to 4900000 (thb subunits).

JSON Response

{
  "object": "source",
  "id": "src_test_59o3faxp9fn4fksdryb",
  "type": "bill_payment_tesco_lotus",
  "flow": "offline",
  "amount": 10025,
  "currency": "thb"
}

Note that when creating source object, you can use either Secret Key or Public Key.

You will then get the result of creating source, the most important attribute is the id which will be used next. Lets assume you got src_test_59o3faxp9fn4fksdryb as an id.

To create a charge, pass it as source parameter in the charge api.

curl https://api.omise.co/charges \
  -X POST \
  -u skey_test_59npyqikgqxtfqmfgq6: \
  -d "description=Charge for order 3947" \
  -d "amount=10025" \
  -d "currency=thb" \
  -d "source=src_test_59o3faxp9fn4fksdryb"

You will then get the following result.

{
  "object": "charge",
  "id": "chrg_test_59o3j8ukevxlvj1vo5p",
  "livemode": false,
  "location": "/charges/chrg_test_59o3j8ukevxlvj1vo5p",
  "amount": 10025,
  "currency": "thb",
  "description": null,
  "metadata": {
  },
  "status": "pending",
  "capture": true,
  "authorized": false,
  "reversed": false,
  "paid": false,
  "transaction": null,
  "refunded": 0,
  "refunds": {
    "object": "list",
    "from": "1970-01-01T00:00:00Z",
    "to": "2017-10-18T06:25:08Z",
    "offset": 0,
    "limit": 20,
    "total": 0,
    "order": null,
    "location": "/charges/chrg_test_59o3j8ukevxlvj1vo5p/refunds",
    "data": [

    ]
  },
  "return_uri": null,
  "reference": null,
  "authorize_uri": null,
  "failure_code": null,
  "failure_message": null,
  "card": null,
  "customer": null,
  "ip": null,
  "dispute": null,
  "created": "2017-10-18T06:25:08Z",
  "source": {
    "object": "source",
    "id": "src_test_59o3faxp9fn4fksdryb",
    "references": {
      "omise_tax_id": "0105556091152",
      "reference_number_1": "789164909013218240",
      "reference_number_2": "437059934205645755",
      "barcode": "https://api.omise.co/charges/chrg_test_59o3j8ukevxlvj1vo5p/documents/docu_test_59o3j8xlm2n5qew173e/downloads/6B5B4C0F8DE54221",
      "expires_at": "2017-10-19T06:25:08Z"
    },
    "type": "bill_payment_tesco_lotus",
    "flow": "offline",
    "amount": 10025,
    "currency": "thb"
  }
}

Charge status

Status Description
successful The payee has successfully made payment (authorized = true and paid = true)
pending The payment has not been made
expired The payee did not pay within 24 hours
failed The charge failed. You can check the reason from the failure_code and failure_message in the charge result.

Failure codes

Code Description
bad_request The amount must be less than or equal to 4900000 (thb subunits)
bad_request Currency is currently not supported
bad_request type is currently not supported
bad_request invalid source
not_found source source_id was not found

Webhooks

Get a notification once the customer completes the transaction by making use of our Webhook API. A webhook will be sent to the URL that is specified in the dashboard with the event name charge.complete

Creating a charge by adding attribute source[type]

curl https://api.omise.co/charges \
  -X POST \
  -u skey_test_59npyqikgqxtfqmfgq6: \
  -d "description=Charge for order 3947" \
  -d "amount=10025" \
  -d "currency=thb" \
  -d "source[type]=bill_payment_tesco_lotus"

A charge can also be created by adding attribute source[type], however we recommend you create a charge by using the payment source api.

Note

- Bill payment is only available for merchants with a Thai-registered Omise account.

- For users with a live account, you will be required to review Terms & Conditions before using the live API.