Skip to main content
GET
/
v1
/
orders
List orders
curl --request GET \
  --url https://api-eu.flexportal.io/v1/orders \
  --header 'Authorization: Bearer <token>' \
  --header 'Tenant-ID: <tenant-id>'
{
  "orders": [
    {
      "orderId": "<string>",
      "tenantId": "<string>",
      "status": "pending",
      "orderType": "standard",
      "customer": {
        "customerId": "<string>",
        "email": "jsmith@example.com",
        "firstName": "<string>",
        "lastName": "<string>",
        "company": "<string>",
        "phone": "<string>",
        "customerType": "individual"
      },
      "billingAddress": {
        "contactName": "<string>",
        "streetAddress": "<string>",
        "city": "<string>",
        "country": "<string>",
        "company": "<string>",
        "buildingInfo": "<string>",
        "locality": "<string>",
        "adminArea": "<string>",
        "postalCode": "<string>"
      },
      "shippingAddress": {
        "contactName": "<string>",
        "streetAddress": "<string>",
        "city": "<string>",
        "country": "<string>",
        "company": "<string>",
        "buildingInfo": "<string>",
        "locality": "<string>",
        "adminArea": "<string>",
        "postalCode": "<string>"
      },
      "items": [
        {
          "sku": "<string>",
          "productName": "<string>",
          "quantity": 2,
          "unitPrice": 1,
          "contractLength": 123,
          "productId": "<string>",
          "productImageUrl": "<string>",
          "variantId": "<string>",
          "listPrice": 1,
          "listPriceSource": "unknown",
          "acquisitionCost": 1,
          "acquisitionCostSource": "unknown",
          "listPriceOverride": 1,
          "acquisitionCostOverride": 1,
          "usedListPriceAsAcquisition": false,
          "rentalIds": [],
          "rentalStatus": "pending"
        }
      ],
      "totals": {
        "subtotal": 1,
        "total": 1,
        "currency": "<string>",
        "totalDevices": 2,
        "taxAmount": 0
      },
      "rentalProgress": {
        "totalDevices": 1,
        "rentedDevices": 1
      },
      "rentalIds": [
        "<string>"
      ],
      "createdAt": "<string>",
      "updatedAt": "<string>",
      "createdBy": "<string>",
      "payment": {
        "status": "pending",
        "method": "stripe",
        "transactionId": "<string>",
        "paidAmount": 1,
        "manuallyMarked": false
      },
      "customFields": {},
      "billingGroupId": "<string>",
      "trackingNumber": "<string>",
      "shippedAt": "<string>",
      "notes": "<string>",
      "extensionDetails": {
        "originalOrderId": "<string>",
        "extensionMonths": 123,
        "previousEndDate": "<string>",
        "newEndDate": "<string>",
        "reason": "<string>"
      },
      "upgradeDetails": {
        "previousDevice": "<string>",
        "previousSerialNumber": "<string>",
        "previousMonthlyAmount": 123,
        "previousRentalId": "<string>",
        "upgradeReason": "<string>"
      }
    }
  ],
  "count": 123,
  "limit": 123,
  "hasMore": true,
  "nextCursor": "<string>"
}

Overview

Retrieve a paginated list of orders with optional filtering and sorting. Orders represent subscription checkout transactions—each order contains customer information, line items with products and pricing, and fulfillment status.

Common Use Cases

Dashboard Integration

Build custom dashboards showing recent orders, fulfillment queues, or revenue reports

Order Management

Display order lists for your operations team to process and fulfill

Customer Portal

Show customers their order history in your customer-facing application

Sync & Export

Sync orders to external systems like ERPs, accounting software, or data warehouses

Filtering Orders

Filter orders by status to power different views in your application:
StatusDescriptionTypical Action
pendingOrder submitted, awaiting confirmationReview and confirm
confirmedOrder confirmed, ready for fulfillmentAssign assets and create subscriptions
partialSome items fulfilled, others pendingContinue fulfillment
fulfilledAll items have active subscriptionsArchive or monitor
cancelledOrder was cancelledNo action needed
# Get orders awaiting fulfillment
GET /v1/orders?status=confirmed

# Get orders for a specific customer
GET /v1/orders?customerId=cust_abc123

# Combine filters
GET /v1/orders?status=pending&sortBy=createdAt&sortDir=asc

Sorting Options

FieldDescription
createdAtOrder creation timestamp (default)
updatedAtLast modification timestamp
orderIdOrder ID (alphabetical)
statusOrder status
totals.totalOrder total amount

Pagination

Results are paginated using cursor-based pagination. See Pagination for details.
// Fetch all pending orders
const pendingOrders = [];
let cursor = null;

do {
  const params = new URLSearchParams({ status: 'pending', limit: '50' });
  if (cursor) params.set('startAfter', cursor);

  const { orders, nextCursor } = await fetchOrders(params);
  pendingOrders.push(...orders);
  cursor = nextCursor;
} while (cursor);

Response Fields

Key fields in each order object:
FieldDescription
orderIdUnique order identifier
statusCurrent order status
orderTypestandard, extension, or upgrade
customerCustomer details (email, name, company)
itemsArray of line items with SKU, quantity, pricing
totalsOrder totals (subtotal, tax, total, currency)
rentalProgressFulfillment progress (totalDevices, rentedDevices)
createdAtISO 8601 timestamp

Authorizations

Authorization
string
header
required

API key obtained from FlexPortal dashboard

Headers

Tenant-ID
string
required

Your tenant identifier

Query Parameters

limit
string

Items per page (default: 50, max: 100)

startAfter
string

Cursor for pagination

status
string

Filter by status (pending, confirmed, partial, fulfilled, cancelled)

customerId
string

Filter by customer ID

Response

200 - application/json

List of orders

orders
object[]
required
count
number
required
limit
number
required
hasMore
boolean
required
nextCursor
string | null
required