Skip to main content
Payment apps and customers poll this endpoint to check if an order has been paid.

Status Values

StatusDescription
pendingOrder created, awaiting payment
paidPayment received and verified
expiredOrder expired before payment
cancelledOrder was cancelled

Implementation

When you receive a transfer webhook notification, update your order status to paid and store the transaction ID. This endpoint should return that status.
app.get('/orders/:orderId/status', (req, res) => {
  const order = db.getOrder(req.params.orderId);

  if (!order) {
    return res.status(404).json({
      error: { code: 'ORDER_NOT_FOUND', message: 'Order not found' }
    });
  }

  res.json({
    orderId: order.id,
    status: order.status,
    paidAt: order.paidAt,
    txid: order.txid
  });
});

Example Response

Pending order:
{
  "orderId": "ord_abc123",
  "status": "pending"
}
Paid order:
{
  "orderId": "ord_abc123",
  "status": "paid",
  "paidAt": 1706313900,
  "txid": "tx_xyz789"
}