Get an order
curl --request GET \
--url https://api-eu.flexportal.io/v1/orders/{orderId} \
--header 'Authorization: Bearer <token>' \
--header 'Tenant-ID: <tenant-id>'import requests
url = "https://api-eu.flexportal.io/v1/orders/{orderId}"
headers = {
"Tenant-ID": "<tenant-id>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'Tenant-ID': '<tenant-id>', Authorization: 'Bearer <token>'}
};
fetch('https://api-eu.flexportal.io/v1/orders/{orderId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-eu.flexportal.io/v1/orders/{orderId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Tenant-ID: <tenant-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-eu.flexportal.io/v1/orders/{orderId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Tenant-ID", "<tenant-id>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api-eu.flexportal.io/v1/orders/{orderId}")
.header("Tenant-ID", "<tenant-id>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-eu.flexportal.io/v1/orders/{orderId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Tenant-ID"] = '<tenant-id>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"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>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Orders
Get Order
Retrieves a specific order by ID.
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>'import requests
url = "https://api-eu.flexportal.io/v1/orders/{orderId}"
headers = {
"Tenant-ID": "<tenant-id>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'Tenant-ID': '<tenant-id>', Authorization: 'Bearer <token>'}
};
fetch('https://api-eu.flexportal.io/v1/orders/{orderId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-eu.flexportal.io/v1/orders/{orderId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Tenant-ID: <tenant-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-eu.flexportal.io/v1/orders/{orderId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Tenant-ID", "<tenant-id>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api-eu.flexportal.io/v1/orders/{orderId}")
.header("Tenant-ID", "<tenant-id>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-eu.flexportal.io/v1/orders/{orderId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Tenant-ID"] = '<tenant-id>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"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>"
}
}{
"error": {
"code": "<string>",
"message": "<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
| Status | What it means |
|---|---|
pending | Order received, awaiting review/confirmation |
confirmed | Approved and ready for fulfillment (creating subscriptions) |
partial | Some items have subscriptions, others still pending |
fulfilled | All items have active subscriptions |
cancelled | Order was cancelled (no subscriptions created) |
Understanding Order Items
Each item in theitems 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"]
}
| Field | Description |
|---|---|
sku | Product variant SKU |
quantity | Number of units ordered |
unitPrice | Monthly subscription price per unit |
contractLength | Subscription duration in months |
rentalStatus | pending, partial, or completed |
rentalIds | IDs of subscriptions created for this line item |
Fulfillment Progress
TherentalProgress field shows overall fulfillment status:
{
"rentalProgress": {
"totalDevices": 5,
"rentedDevices": 3
}
}
rentedDevices equals totalDevices, the order status changes to fulfilled.
Cost Tracking Fields
For cost recovery and profitability tracking:| Field | Description |
|---|---|
listPrice | MSRP/retail price of the product |
acquisitionCost | Your cost to acquire the product |
listPriceSource | Where list price came from (variant, manual) |
acquisitionCostSource | Where 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}`);
}
}
Related Endpoints
- List Orders - Get all orders with filtering
- Create Subscription - Create subscriptions for order items
- Get Customer - Get customer details
Authorizations
API key obtained from FlexPortal dashboard
Headers
Your tenant identifier
Path Parameters
The order ID
Response
Order details
Available options:
pending, confirmed, partial, fulfilled, cancelled Available options:
standard, extension, upgrade Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?