How to list orders and check balance

List orders for your account and check your API account balance. Use these for dashboards, reporting, and ensuring you have enough balance before creating orders.

List orders

Endpoint: GET https://api.cardpluspay.com/v1/orders

Returns a paginated list of orders for the authenticated account.

Query parameters

  • per_page — Items per page (1–100).
  • status — Filter by order status.
  • sort_bycreated_at, amount, or status.
  • orderasc or desc.

Example request

curl -X GET "https://api.cardpluspay.com/v1/orders?per_page=10&sort_by=created_at&order=desc" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Accept: application/json"

Example response

{
  "success": true,
  "message": "Orders retrieved successfully",
  "data": {
    "orders": [
      { "order_id": 123, "order_no": "ORD-2026-001", "status": "completed", "amount": 5.00, ... }
    ],
    "pagination": {
      "total": 1,
      "per_page": 10,
      "current_page": 1,
      "last_page": 1
    },
    "state": "success"
  }
}

Use orders and pagination to build order history or admin views. For full details of a single order (including codes), use GET /orders/{id}.

Check account balance

Endpoint: GET https://api.cardpluspay.com/v1/balance

Returns the current balance for your API account (e.g. in USD). Call this before creating orders or to show balance in a dashboard.

Example request

curl -X GET "https://api.cardpluspay.com/v1/balance" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Accept: application/json"

Example response

{
  "success": true,
  "message": "Balance retrieved successfully",
  "data": {
    "balance": "100.50",
    "currency": "USD",
    "state": "success"
  }
}

The balance value is returned as a string (e.g. "547.45") for precision; parse it to a decimal/number type in your code before doing arithmetic. If balance is too low for a planned order, the API may return an error when you try to create it. Checking balance beforehand helps you show a clear message or prompt the user to top up.

← Order status · Integration Guide · API Reference