Can't create charge on nodejs backend


Hi there,

I am trying to learn how to integrate omise in React (frontend), Node and Express (backend) applicationI (use omise-node ). I finished testing the credit card payment with Omise pre-built payment form, it works just fine. I got token in frontend and sent token to create charge in backend, and I got transfer in my test dashboard.
However, when I tried the internet banking (pre-built form also), it didn’t work. I got source key (which start with “src_test_xxxxxxx” in frontend, I sent it to backend, but I got error " message: ‘token src_test_5eyypeposqoqezff28w was not found’"

Here is my code in node backend.

const omise = require('omise')({
  publicKey: process.env.OMISE_PUBLIC_KEY,
  secretKey: process.env.OMISE_SECRET_KEY
.....'/internet-banking', async (req, res, next) => {
  try {
    const { name, amount, source } = req.body;

    const customer = await omise.customers.create({
      email: '',
      description: `${name}, id (123)`,
      card: source

    console.log('Customer -->', customer)

    const charge = await omise.charges.create({
      currency: 'thb',
      return_uri: 'http://localhost:3000'

    console.log('Charge -->', charge)

      charge: {
        status: charge.status,
        amount: `${charge.amount / 100} ${charge.currency}`
  } catch (err) {

Here is the log from my console.

   { name: 'Autsada T',
     amount: 10000,
     source: 'src_test_5eyypeposqoqezff28w' },
  _body: true,
  length: undefined,
   Route {
     path: '/internet-banking',
     stack: [ [Layer] ],
     methods: { post: true } } }
{ object: 'error',
  location: '',
  code: 'not_found',
  message: 'token src_test_5eyypeposqoqezff28w was not found' }

In the post request body, you can see it has all I need to create charge - amount, source.
I tried to search around, but couldn’t find solution.
Could you please help?



Hi Autsada,

The Customer API can be used only for saved card, which means you can create a customer by using a token only.

Please kindly take a look the API description on how create a customer by this link. (

Thank you!


Dear K. big,

Thank you krub for your quick reply, it works now.

Just to confirm my understanding, we can’t create customer in other payment methods except credit card, is that right? It is, by the way, not a big problem cuz I can create customer data by other way.


Your understanding is correct krub :slight_smile:


Thank you very much krub.


Dear K.big,

One more question krub, how do I check internet banking payment transaction in dashboard, now the charge object shows status “pending” and I don’t see transaction in my dashboard.

Charge IB --> { object: 'charge',
  id: 'chrg_test_5ez0sfbv07lhb10uudb',
  livemode: false,
  location: '/charges/chrg_test_5ez0sfbv07lhb10uudb',
  amount: 25000,
  currency: 'thb',
  funding_amount: 25000,
  funding_currency: 'thb',
  description: null,
  metadata: {},
  status: 'pending',

I logged the charge data out in my console as shown above.

Thank you.


Could you please share a screenshot of your dashboard krub?

Please follow my instruction by below…

  1. Log in to with your Omise account.
  2. Click Charges menu on the left-hand side under Transactions topic. (
  3. Capture your screen on this page.


Ok krub.

I saw it already. thank you very much.


You’re welcome :slight_smile: