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 phoneProperties
| Property | Type | Description | Defined in |
|---|---|---|---|
checkoutUrl? | string | Redirect URL for DPO / Pesapal redirect flows. | packages/pesa/src/types/order.ts:115 |
orderId | string | Provider-assigned transaction ID. Use this to query status via PesaInstance.getPaymentStatus. | packages/pesa/src/types/order.ts:109 |
raw? | unknown | Raw provider response. Escape hatch — never rely on this. Use the normalized fields instead. | packages/pesa/src/types/order.ts:122 |
reference | string | Your reference, echoed back. | packages/pesa/src/types/order.ts:111 |
status | PaymentStatus | Current payment status. | packages/pesa/src/types/order.ts:113 |
ussdPushInitiated? | boolean | Whether a USSD push was initiated (Selcom / MNO push flows). | packages/pesa/src/types/order.ts:117 |