Parspal Approve Payment API
Verify and finalize Parspal payments by confirming the transaction with payment ID and receipt number
Parspal Approve Payment API
Complete the Parspal payment flow by verifying the transaction. Confirm payments using the payment ID and receipt number received from the callback.
Verify Transaction
Confirm payment authenticity with Parspal servers.
Fraud Prevention
Server-side verification prevents tampering.
Instant Activation
Subscription activated upon successful verification.
Endpoint Overview
/graphqlApprove and verify a Parspal payment using the payment ID and receipt number. Finalizes the transaction and activates the purchase.
Request Parameters
payment_idStringRequiredThe payment ID received from parspalCreatePayment and returned in the callback URL.
receipt_numberStringRequiredThe receipt number provided by Parspal after user completes payment.
GraphQL Mutation
mutation parspalApprovePayment(
$payment_id: String
$receipt_number: String
) {
parspalApprovePayment(
payment_id: $payment_id
receipt_number: $receipt_number
)
}Variables:
{
"payment_id": "PP123456789",
"receipt_number": "RCP987654321"
}HTTP Request:
curl -X POST https://api.orbnet.com/graphql \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-d '{
"query": "mutation parspalApprovePayment($payment_id: String, $receipt_number: String) { parspalApprovePayment(payment_id: $payment_id, receipt_number: $receipt_number) }",
"variables": {
"payment_id": "PP123456789",
"receipt_number": "RCP987654321"
}
}'Response
{
"data": {
"parspalApprovePayment": true
}
}{
"errors": [
{
"message": "Payment verification failed",
"path": ["parspalApprovePayment"],
"extensions": {
"code": "VERIFICATION_FAILED"
}
}
],
"data": null
}{
"errors": [
{
"message": "Receipt number does not match payment",
"path": ["parspalApprovePayment"],
"extensions": {
"code": "INVALID_RECEIPT"
}
}
],
"data": null
}Callback Handling
After the user completes payment on Parspal, they are redirected to your callback URL with query parameters:
https://yoursite.com/payment/callback?payment_id=PP123456789&receipt_number=RCP987654321&status=successBackend Handler Example (Node.js):
app.get('/payment/callback', async (req, res) => {
const { payment_id, receipt_number, status } = req.query;
if (status === 'success') {
// Call the approve API
const result = await graphqlClient.mutate({
mutation: PARSPAL_APPROVE_PAYMENT,
variables: { payment_id, receipt_number }
});
if (result.data.parspalApprovePayment) {
// Payment verified - redirect to success page
res.redirect('/payment/success');
} else {
// Verification failed
res.redirect('/payment/failed');
}
} else {
// User cancelled or payment failed
res.redirect('/payment/cancelled');
}
});Complete Parspal Flow
Create Payment
Call parspalCreatePayment to get payment_id and redirect link.
Redirect User
Send user to Parspal's payment page using the link URL.
User Pays
User completes payment on Parspal's secure gateway.
Receive Callback
Parspal redirects to your callback URL with payment_id and receipt_number.
Verify Payment
Call this API with payment_id and receipt_number to verify and activate.
Best Practices
Always Verify
Never trust callback status alone. Always call this API to verify with Parspal servers.
Handle Retries
If verification fails due to network issues, implement retry logic with backoff.
Idempotent Handling
Handle duplicate callbacks gracefully. Same payment_id should return same result.
Log Transactions
Log payment_id and receipt_number for troubleshooting and auditing purposes.
Error Handling
VERIFICATION_FAILED
Payment could not be verified. May be cancelled or tampered.
INVALID_RECEIPT
Receipt number doesn't match the payment_id.
PAYMENT_EXPIRED
Payment request has expired. Create a new payment.
INVALID_PAYMENT_ID
Payment ID not found or doesn't exist.
Related Endpoints
Required Step
This verification step is mandatory. Without calling this API, the payment is not finalized and the user's subscription will not be activated, even if Parspal shows success.
Complete Parspal Integration
Ensure your Parspal integration includes both create and approve steps for secure, verified payments.