Interface: OrderResult

Defined in: packages/pesa/src/types/order.ts:104

Result returned after initiating a payment.

The shape varies by provider. Redirect-based providers (DPO, Pesapal) return checkoutUrl. USSD push providers (Selcom, ClickPesa) set ussdPushInitiated: true.

Example

const order = await pesa.createOrder({ ... });

if (order.checkoutUrl) {
  // Redirect-based flow: send customer to the URL
  return redirect(order.checkoutUrl);
}
// USSD push flow: customer receives a PIN prompt on their phone

Properties

PropertyTypeDescriptionDefined in
checkoutUrl?stringRedirect URL for DPO / Pesapal redirect flows.packages/pesa/src/types/order.ts:115
orderIdstringProvider-assigned transaction ID. Use this to query status via PesaInstance.getPaymentStatus.packages/pesa/src/types/order.ts:109
raw?unknownRaw provider response. Escape hatch — never rely on this. Use the normalized fields instead.packages/pesa/src/types/order.ts:122
referencestringYour reference, echoed back.packages/pesa/src/types/order.ts:111
statusPaymentStatusCurrent payment status.packages/pesa/src/types/order.ts:113
ussdPushInitiated?booleanWhether a USSD push was initiated (Selcom / MNO push flows).packages/pesa/src/types/order.ts:117

On this page