GET
https://api.stableyard.fi
/
sdk
/
v1
/
verify-payment
curl -X GET "https://api.stableyard.fi/sdk/v1/verify-payment?requestId=req_xyz789" \
  -H "Authorization: Basic $(echo -n $STABLEYARD_APP_ID | base64)"
{
  "success": true,
  "data": {
    "status": "completed",
    "quoteId": "quote_abc123",
    "transactionId": "tx_def456",
    "txHash": "0x1234567890abcdef...",
    "amount": "100.00",
    "token": "USDC",
    "from": {
      "userId": "user_sender123",
      "paymentAddress": "alice@partner"
    },
    "to": {
      "userId": "user_receiver456",
      "paymentAddress": "merchant@partner"
    },
    "createdAt": "2024-01-15T10:30:00Z",
    "completedAt": "2024-01-15T10:30:05Z",
    "failureReason": null
  },
  "requestId": "req_xyz789"
}
Check the status of a payment using the requestId received from the quote or settle response. Use this for polling payment completion or displaying real-time status updates in your UI.
Polling pattern — After calling /settle, poll this endpoint every 2-3 seconds until status is completed or failed. For production, consider using webhooks instead of polling.

Authentication

Authorization
string
required
Basic authentication. Value: Basic base64(STABLEYARD_APP_ID). Obtain your STABLEYARD_APP_ID from the Stableyard SDK.

Query Parameters

requestId
string
required
The request ID returned from /quote or /settle response
quoteId
string
The quote ID for additional verification (optional but recommended)

Response

success
boolean
Indicates if the request was successful
data
object
Payment status data
curl -X GET "https://api.stableyard.fi/sdk/v1/verify-payment?requestId=req_xyz789" \
  -H "Authorization: Basic $(echo -n $STABLEYARD_APP_ID | base64)"
{
  "success": true,
  "data": {
    "status": "completed",
    "quoteId": "quote_abc123",
    "transactionId": "tx_def456",
    "txHash": "0x1234567890abcdef...",
    "amount": "100.00",
    "token": "USDC",
    "from": {
      "userId": "user_sender123",
      "paymentAddress": "alice@partner"
    },
    "to": {
      "userId": "user_receiver456",
      "paymentAddress": "merchant@partner"
    },
    "createdAt": "2024-01-15T10:30:00Z",
    "completedAt": "2024-01-15T10:30:05Z",
    "failureReason": null
  },
  "requestId": "req_xyz789"
}

Status Flow

pending → processing → completed
                    ↘ failed
StatusDescription
pendingQuote created, awaiting signature and settlement
processingSettlement initiated, transaction being processed
completedPayment successful, funds transferred
failedPayment failed, check failureReason

Polling Example

async function waitForPayment(requestId: string, maxAttempts = 30): Promise<PaymentStatus> {
  for (let i = 0; i < maxAttempts; i++) {
    const response = await fetch(
      `https://api.stableyard.fi/sdk/v1/verify-payment?requestId=${requestId}`,
      { headers: { 'Authorization': 'Basic ' + btoa(STABLEYARD_APP_ID) } }
    );
    const { data } = await response.json();

    if (data.status === 'completed' || data.status === 'failed') {
      return data;
    }

    // Wait 2 seconds before next poll
    await new Promise(resolve => setTimeout(resolve, 2000));
  }

  throw new Error('Payment verification timeout');
}

// Usage
const payment = await waitForPayment('req_xyz789');
if (payment.status === 'completed') {
  console.log(`Payment complete! Tx: ${payment.txHash}`);
} else {
  console.error(`Payment failed: ${payment.failureReason}`);
}
Pro tip — For production applications, use webhooks to receive real-time payment notifications instead of polling.