GET
/
payment-requests
/
status
/
{id}
cURL
curl --request GET \
  --url https://gateway.cyrexa.com/ipg/2.0.0/payment-requests/status/{id}
This response does not have an example.

Overview

Retrieve the current status of a payment request using its identifier.

API Endpoint

GET https://apay.cyrexa.io/payment-requests/status/{id}

Authentication

  • HTTP Header: X-API-Key with your API key obtained from the dashboard
  • Content Type: application/json

Request Parameters

ParameterDescriptionRequired
{id}Payment request identifier from payment creation responseYES

Response Fields

FieldDescriptionType
idPayment request identifierstring/integer
recipientNamePayment recipient namestring
paymentRequestStatusIdPayment request status:
1 – paid
2 – unpaid
3 – cancelled
integer
transactionIdCreated transaction internal identifierstring/integer
transactionNumberCreated transaction public identifierstring
transactionStatusIdCreated transaction status:
0 – waiting
1 – approved
2 – declined
3 – pending
integer
linkPayment request link to customer-facing web pagestring
unitPayment currencystring
amountPayment amountnumber
referenceIdCustom reference detailsstring
notesPayment notesstring
clientPayment sender customer objectobject
notifyUrlWebhook URL for payment status notificationsstring
successUrlRedirect URL on successful paymentstring
failureUrlRedirect URL on failed paymentstring
lastLogLast payment attempt status and messageobject

Last Log Object

FieldDescriptionType
transactionStatusIdLast payment attempt status:
0 – waiting
1 – approved
2 – declined
3 – pending
integer
messageLast payment attempt messagestring
codeLast payment attempt codestring

Example Request

curl -X GET \
  "https://apay.cyrexa.io/payment-requests/status/16772761082427695" \
  -H "X-API-Key: your-api-key" \
  -H "Content-Type: application/json"

Status Codes

Payment Request Status

  • 1 – Paid
  • 2 – Unpaid
  • 3 – Cancelled

Transaction Status

  • 0 – Waiting
  • 1 – Approved
  • 2 – Declined
  • 3 – Pending

Best Practices

Status Checking

  • Polling Frequency: Check status periodically, not continuously
  • Rate Limiting: Respect API rate limits to avoid throttling
  • Error Handling: Handle network timeouts and API errors gracefully
  • Caching: Cache successful responses to reduce API calls

Implementation Tips

  • Store payment request IDs securely for status tracking
  • Implement exponential backoff for failed requests
  • Use webhooks for real-time updates instead of constant polling
  • Log status changes for audit trails

Integration Example

async function checkPaymentStatus(paymentId, apiKey) {
  try {
    const response = await fetch(
      `https://apay.cyrexa.io/payment-requests/status/${paymentId}`,
      {
        method: 'GET',
        headers: {
          'X-API-Key': apiKey,
          'Content-Type': 'application/json'
        }
      }
    );
    
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    const paymentStatus = await response.json();
    return paymentStatus;
    
  } catch (error) {
    console.error('Error checking payment status:', error);
    throw error;
  }
}

// Usage
const status = await checkPaymentStatus('16772761082427695', 'your-api-key');
console.log('Payment Status:', status.paymentRequestStatusId);
console.log('Transaction Status:', status.transactionStatusId);

Path Parameters

id
integer
required

Response

200

OK