Skip to content

Server-Side Payment Verification

Before you deliver that product or service, make sure the payment actually happened — no trust falls here. This guide walks you through verifying a SkyPay transaction securely from your backend.


When to Verify

Always verify payments after redirect and before fulfillment. Just because someone saw a "success" screen doesn’t mean the money's landed.


Environment URLs

EnvironmentBase API URLNote
Livehttps://api.skypay.dev Note: This uses api.

API Request Details

ElementValue / Description
MethodGET
Endpoint/api/v1/checkout/payments-verify/{code}
Base URLDepends on environment (Live or UAT)
Path Paramcode — The unique order/payment ID used in the checkout
HeaderKey: YOUR_API_KEY

Replace {code} with your order's unique identifier.


Axios Example

js
axios.get('https://api.skypay.dev/api/v1/checkout/payments-verify/ORDER123', {
  headers: {
    Key: 'YOUR_API_KEY'
  }
})
.then(res => {
  if (res.data?.data?.status === 'complete') {
    // Fulfill the order
  } else {
    // Handle failed or pending payment
  }
})
.catch(err => {
  // Handle request failure
})

Detailed Response Format

The verification endpoint returns a comprehensive PaymentResource object. Here’s exactly what you get:

FieldTypeDescription
iduuidUnique SkyPay transaction ID
codestringYour unique order identifier
statusstringCurrent status (e.g., complete, pending)
amountfloatBase amount in NPR
modestringIntegration mode (API, Manual, Assisted)
provider_namestringPayment provider used (e.g., eSewa, Khalti)
merchant_amountfloatFinal net amount received by merchant
payment_dataobjectRaw data returned from the payment provider (eSewa, Khalti, etc.)
created_attimestampWhen the session was initialized

Provider Specific Data (payment_data)

The payment_data object contains the raw response from the payment provider. This is useful if you need provider-specific transaction IDs or audit logs.


Sample Full Response

json
{
  "status": true,
  "message": "Existing payment found",
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "code": "ORDER123",
    "status": "complete",
    "amount": 1000.0,
    "gross_amount": 1000.0,
    "merchant_amount": 973.7,
    "provider_name": "Khalti",
    "provider_code": "khalti",
    "mode": "API",
    "payment_data": {
      "pidx": "HT69Z7Y8...",
      "status": "Completed",
      "transaction_id": "KHL-TXN-456"
    },
    "created_at": "2024-03-20T10:00:00Z",
    "expires_at": "2024-03-20T10:15:00Z"
  }
}
Check if status is "complete". That means money has been received.

Other Status Values

StatusMeaning
completePayment successful. Proceed to fulfill.
waitingManual payment marked as paid. Awaiting merchant verification.
pendingPayment session is active but user hasn't completed it.
cancelledUser cancelled or let the session time out.
failedProvider validation failed.
invalidTechnical error or mismatch in transaction data.

Pro Tips

  • Always verify from the backend — never rely solely on frontend redirects.
  • Base64 data from success_url is not enough — use this endpoint to confirm.
  • Handle errors gracefully and log everything for support/debugging.

Ready to Test?

Sign up 👉 web.skypay.dev to simulate and verify payments.


SkyPay — Because verifying payments is cooler than getting scammed

Proudly built in Pokhara, Nepal — a product by Skybase Innovations