Skip to main content
GET
/
v1
/
orders
/
{orderId}
Get an order
curl --request GET \
  --url https://api-eu.flexportal.io/v1/orders/{orderId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Tenant-ID: <tenant-id>'
{
  "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>"
  }
}

Overview

Retrieve complete details for a single order by its ID. Use this endpoint to display order details, check fulfillment status, or verify order contents before creating subscriptions.

Common Use Cases

  • Order Details Page: Display complete order information to customers or staff
  • Pre-Fulfillment Check: Verify order contents and customer details before creating subscriptions
  • Status Tracking: Check if an order has been fully fulfilled
  • Invoice Generation: Get order totals and line items for invoicing

Order Lifecycle

Orders progress through these statuses:
pending → confirmed → partial → fulfilled
                  ↘     ↗
                 cancelled
StatusWhat it means
pendingOrder received, awaiting review/confirmation
confirmedApproved and ready for fulfillment (creating subscriptions)
partialSome items have subscriptions, others still pending
fulfilledAll items have active subscriptions
cancelledOrder was cancelled (no subscriptions created)

Understanding Order Items

Each item in the items array represents a product line in the order:
{
  "sku": "MACBOOK-PRO-16-M3",
  "productName": "MacBook Pro 16\" M3",
  "quantity": 3,
  "unitPrice": 89.00,
  "contractLength": 24,
  "rentalStatus": "partial",
  "rentalIds": ["sub_abc123", "sub_def456"]
}
FieldDescription
skuProduct variant SKU
quantityNumber of units ordered
unitPriceMonthly subscription price per unit
contractLengthSubscription duration in months
rentalStatuspending, partial, or completed
rentalIdsIDs of subscriptions created for this line item

Fulfillment Progress

The rentalProgress field shows overall fulfillment status:
{
  "rentalProgress": {
    "totalDevices": 5,
    "rentedDevices": 3
  }
}
When rentedDevices equals totalDevices, the order status changes to fulfilled.

Cost Tracking Fields

For cost recovery and profitability tracking:
FieldDescription
listPriceMSRP/retail price of the product
acquisitionCostYour cost to acquire the product
listPriceSourceWhere list price came from (variant, manual)
acquisitionCostSourceWhere cost came from (variant, manual, list_price)

Example: Check if Order is Ready for Fulfillment

const order = await getOrder('ord_abc123');

if (order.status === 'confirmed') {
  // Order is approved, check for unfulfilled items
  const unfulfilledItems = order.items.filter(
    item => item.rentalStatus !== 'completed'
  );

  for (const item of unfulfilledItems) {
    const unitsNeeded = item.quantity - item.rentalIds.length;
    console.log(`Need ${unitsNeeded}x ${item.sku}`);
  }
}

Authorizations

Authorization
string
header
required

API key obtained from FlexPortal dashboard

Headers

Tenant-ID
string
required

Your tenant identifier

Path Parameters

orderId
string
required

The order ID

Response

Order details

orderId
string
required
tenantId
string
required
status
enum<string>
required
Available options:
pending,
confirmed,
partial,
fulfilled,
cancelled
orderType
enum<string>
required
Available options:
standard,
extension,
upgrade
customer
object
required
billingAddress
object
required
shippingAddress
object
required
items
object[]
required
totals
object
required
rentalProgress
object
required
rentalIds
string[]
required
createdAt
string
required
updatedAt
string
required
createdBy
string
required
payment
object
customFields
object
billingGroupId
string
trackingNumber
string
shippedAt
string
notes
string
extensionDetails
object
upgradeDetails
object