Skip to main content

Verify a payment

Call GET /payments/:reference from your backend after a payer returns and when reconciling a webhook. Use a secret key from the same environment that created the payment; a Live key cannot read a Sandbox transaction.

const response = await fetch(
`https://api.skypay.ng/api/v1/payments/${encodeURIComponent(reference)}`,
{ headers: { Authorization: `Bearer ${process.env.SKYPAY_SECRET_KEY}` } }
)
const result = await response.json()

if (!response.ok) throw new Error(result.error?.message ?? 'Lookup failed')
if (result.data.amount !== order.amountKobo) throw new Error('Amount mismatch')
if (result.data.currency !== 'NGN') throw new Error('Currency mismatch')
if (result.data.status === 'SUCCESS') await fulfilOrderOnce(order.id)

Response fields​

FieldMeaning
referencePublic SkyPay transaction reference
amountInteger kobo
currencyTransaction currency
statusCurrent normalized status
gatewayProcessor slug, if assigned
customerEmail, customerNameOptional payer details
environmentSANDBOX or LIVE
initiatedAt, completedAtISO timestamps
failureReasonSafe reason for a failed payment, if available
metadataMerchant-provided metadata

Statuses​

StatusMeaningAction
INITIATEDPayment reference exists; processing has not begunWait or let the payer open checkout
PENDINGProcessor or payer action is in progressKeep the order pending and check later
SUCCESSPayment is confirmedValidate amount/currency and fulfil once
FAILEDPayment failedShow a safe retry path
REVERSEDA previously successful payment was reversedReconcile and follow your reversal policy

The browser callback is navigation, not proof of payment. Query parameters can be forged. Your server must use this endpoint or a verified webhook before delivering value.