Retrieve a transaction
GET
/api/wallet/transactions/{transactionID}Returns the transaction object with HTTP 200, including its current status. Use the same key that created the transaction. A different app’s key receives 403.
Example · cURL
curl "https://yorkonthe.net/api/wallet/transactions/TRANSACTION_ID" \
-H "x-api-key: YOUR_WALLET_API_KEY"After payment, status is paid, payer_id identifies the
payer, and paid_at records the payment date. Also verify the recipient, amount, currency,
and order reference.
Example · server-side JavaScript
// Run this on your app's server.
const response = await fetch(
'https://yorkonthe.net/api/wallet/transactions/' + encodeURIComponent(transactionId),
{ headers: { 'x-api-key': process.env.YORK_WALLET_KEY } }
);
const transaction = await response.json();
if (!response.ok) throw new Error(transaction.message);
// Compare against the order stored in your database.
if (transaction.status === 'paid' &&
transaction.receiver_id === order.receiverId &&
transaction.amount === order.amount &&
transaction.currency === order.currency &&
transaction.external_id === order.id &&
transaction.payer_id === order.userId) {
// Record fulfillment atomically, only once per transaction.id.
await fulfillOrderOnce(order.id, transaction.id);
}In this example, order comes from your app’s database and fulfillOrderOnce is your fulfillment routine. Associate the order with the York user
ID beforehand so you can verify the payer.