POST /v2/payments/inquiryPayment
Queries the current status of a payment. Use this endpoint to check payment status when:
The initial payment response has resultStatus: "U" (unknown)
Webhook notification hasn’t been received
You need to verify payment status before fulfillment
Request Parameters
Rebell-assigned payment identifier. Max length : 64 charactersAt least one of paymentId or paymentRequestId is required.
Merchant-generated payment request ID. Max length : 64 characters
Response Parameters
Rebell payment identifier
Merchant payment request ID
Current payment status:
SUCCESS - Payment completed successfully
PROCESSING - Payment is being processed
FAIL - Payment failed
Payment completion time (ISO 8601)
Example Request
{
"paymentId" : "2024011012345678901234" ,
"paymentRequestId" : "RETAIL-20240110-001"
}
Example Response
Successful Payment :
{
"result" : {
"resultCode" : "SUCCESS" ,
"resultStatus" : "S" ,
"resultMessage" : "success"
},
"paymentId" : "2024011012345678901234" ,
"paymentRequestId" : "RETAIL-20240110-001" ,
"paymentStatus" : "SUCCESS" ,
"paymentTime" : "2024-01-10T14:30:45+01:00" ,
"paymentAmount" : {
"currency" : "EUR" ,
"value" : "2500"
}
}
Processing :
{
"result" : {
"resultCode" : "SUCCESS" ,
"resultStatus" : "S" ,
"resultMessage" : "success"
},
"paymentId" : "2024011012345678901234" ,
"paymentRequestId" : "RETAIL-20240110-001" ,
"paymentStatus" : "PROCESSING"
}
Failed Payment :
{
"result" : {
"resultCode" : "SUCCESS" ,
"resultStatus" : "S" ,
"resultMessage" : "success"
},
"paymentId" : "2024011012345678901234" ,
"paymentRequestId" : "RETAIL-20240110-001" ,
"paymentStatus" : "FAIL"
}
Result Codes
resultStatus resultCode Description Action SSUCCESSQuery successful Check paymentStatus field FORDER_NOT_EXISTPayment not found Verify paymentId/paymentRequestId FPARAM_ILLEGALInvalid parameters Check request UUNKNOWN_EXCEPTIONUnknown error Retry with backoff
Polling Implementation
Use inquiry for polling when waiting for payment completion:
async function pollPaymentStatus ( paymentId , paymentRequestId , options = {}) {
const {
maxAttempts = 60 , // Max polling attempts
interval = 3000 , // Polling interval (ms)
timeout = 180000 // Total timeout (ms)
} = options ;
const startTime = Date . now ();
let attempts = 0 ;
while ( attempts < maxAttempts && ( Date . now () - startTime ) < timeout ) {
attempts ++ ;
try {
const response = await rebellAPI . inquiryPayment ({
paymentId ,
paymentRequestId
});
if ( response . result . resultStatus === 'S' ) {
switch ( response . paymentStatus ) {
case 'SUCCESS' :
return {
status: 'success' ,
paymentId: response . paymentId ,
paymentTime: response . paymentTime ,
amount: response . paymentAmount
};
case 'FAIL' :
return {
status: 'failed' ,
paymentId: response . paymentId
};
case 'PROCESSING' :
// Continue polling
break ;
}
}
} catch ( error ) {
console . error ( `Polling attempt ${ attempts } failed:` , error );
// Continue polling on error
}
// Wait before next poll
await new Promise ( resolve => setTimeout ( resolve , interval ));
}
return { status: 'timeout' };
}
// Usage
const result = await pollPaymentStatus ( paymentId , paymentRequestId );
if ( result . status === 'success' ) {
await fulfillOrder ( orderId );
}
Best Practices
Don’t rely solely on polling for payment confirmation. Always implement webhook handlers as the primary notification mechanism. Use polling as a fallback or for real-time UI updates.
Payment Notify Handle payment webhooks
Retail Pay Initiate retail payments