Skip to main content
GET
/
orders
/
{orderId}
/
status
Get order status
curl --request GET \
  --url https://api.merchant.example/opencharge/orders/{orderId}/status
{
  "orderId": "ord_abc123",
  "status": "paid",
  "paidAt": 1706313900,
  "txid": "tx_xyz789"
}
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"
}

Path Parameters

orderId
string
required

The order ID from the signed order object

Response

Order status retrieved

Current payment status of an order

orderId
string
required

The order ID

status
enum<string>
required

Current payment status

Available options:
pending,
paid,
expired,
cancelled
paidAt
integer

Unix timestamp when order was paid

txid
string

Transaction ID of the payment