Transactions

Use kyshi.transactions to create and inspect customer payments.

Initialize Checkout

const checkout = await kyshi.transactions.initialize({
  email: '[email protected]',
  localCurrency: 'NGN',
  amount: 1000,
  reference: 'ORDER-10001',
  redirectUrl: 'https://merchant.example.com/payments/callback',
});

console.log(checkout.authorizationUrl);

Charge Transaction

const charge = await kyshi.transactions.charge({
  email: '[email protected]',
  localCurrency: 'NGN',
  amount: 1000,
  reference: 'CHARGE-10001',
  chargeType: 'BANK_TRANSFER',
});

Verify Transaction

Verify payments from your backend before giving value to the customer.

const transaction = await kyshi.transactions.verify('ORDER-10001');

if (transaction.status === 'SUCCESS') {
  // Fulfill the order in your system.
}

List And Retrieve

const history = await kyshi.transactions.list({
  page: 1,
  limit: 10,
});

const transaction = await kyshi.transactions.retrieve('transaction-id');

Methods

MethodDescription
initialize(params)Create a hosted checkout transaction.
charge(params)Create a direct charge transaction.
verify(reference)Verify a transaction by reference.
retrieve(id)Retrieve one transaction by ID.
list(query)List transaction history.

For exact API fields and response schemas, see Reference > Transactions.