Skip to main content
GET
/
v1
/
customers
/
{customerId}
Get a customer
curl --request GET \
  --url https://api-eu.flexportal.io/v1/customers/{customerId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Tenant-ID: <tenant-id>'
{
  "customerId": "<string>",
  "tenantId": "<string>",
  "email": "<string>",
  "firstName": "<string>",
  "lastName": "<string>",
  "customerType": "individual",
  "totalOrders": 123,
  "totalDevicesRented": 123,
  "totalMonthlyRevenue": 123,
  "status": "active",
  "orderIds": [
    "<string>"
  ],
  "rentalIds": [
    "<string>"
  ],
  "createdBy": "<string>",
  "company": "<string>",
  "phone": "<string>",
  "customFields": {},
  "lastBillingAddress": {
    "contactName": "<string>",
    "streetAddress": "<string>",
    "city": "<string>",
    "country": "<string>",
    "company": "<string>",
    "buildingInfo": "<string>",
    "locality": "<string>",
    "adminArea": "<string>",
    "postalCode": "<string>"
  },
  "lastShippingAddress": {
    "contactName": "<string>",
    "streetAddress": "<string>",
    "city": "<string>",
    "country": "<string>",
    "company": "<string>",
    "buildingInfo": "<string>",
    "locality": "<string>",
    "adminArea": "<string>",
    "postalCode": "<string>"
  },
  "createdAt": "<unknown>",
  "updatedAt": "<unknown>",
  "lifetimeCollected": 123,
  "totalAcquisitionCost": 123,
  "customerMargin": 123,
  "customerMarginPercent": 123,
  "subscriptionsTracked": 123
}

Overview

Retrieve complete details for a single customer, including profitability metrics and subscription summary. Use this endpoint for customer detail pages, support lookups, or profitability analysis.

Common Use Cases

  • Customer Profile Page: Display complete customer information and subscription history
  • Support Lookup: Quickly find customer details during support calls
  • Profitability Analysis: Review customer lifetime value and cost recovery metrics
  • Pre-Order Check: Verify customer details before processing new orders

Profitability Metrics

The customer response includes valuable profitability data:
{
  "profitability": {
    "lifetimeCollected": 4250.00,
    "totalAcquisitionCost": 3600.00,
    "costRecoveryPercent": 118.05,
    "averageMonthlyRevenue": 354.17,
    "totalDevicesEver": 3,
    "activeDevices": 2
  }
}
MetricDescription
lifetimeCollectedTotal payments collected from this customer
totalAcquisitionCostTotal cost of assets provided to customer
costRecoveryPercent(Collected / Cost) × 100—shows overall profitability
averageMonthlyRevenueAverage monthly revenue from this customer
totalDevicesEverTotal devices ever subscribed
activeDevicesCurrently active subscriptions

Customer Types

TypeDescriptionTypical Use
individualPersonal customerConsumer subscriptions
businessBusiness customerB2B subscriptions, often with billing groups

Address Information

Customer records include billing and shipping addresses:
{
  "billingAddress": {
    "contactName": "John Smith",
    "streetAddress": "123 Main Street",
    "city": "Amsterdam",
    "postalCode": "1012 AB",
    "country": "Netherlands"
  },
  "shippingAddress": {
    "contactName": "John Smith",
    "company": "Acme Corp",
    "streetAddress": "456 Office Park",
    "city": "Rotterdam",
    "postalCode": "3011 AA",
    "country": "Netherlands"
  }
}

Example: Customer Summary for Support

async function getCustomerSummary(customerId) {
  const customer = await getCustomer(customerId);

  return {
    name: `${customer.firstName} ${customer.lastName}`,
    email: customer.email,
    company: customer.company || 'Individual',
    activeSubscriptions: customer.profitability.activeDevices,
    monthlyRevenue: customer.profitability.averageMonthlyRevenue,
    lifetimeValue: customer.profitability.lifetimeCollected,
    isProfitable: customer.profitability.costRecoveryPercent >= 100
  };
}

Example: Check Customer Eligibility

async function canCustomerUpgrade(customerId) {
  const customer = await getCustomer(customerId);

  // Business logic: Only allow upgrades for customers in good standing
  const hasActiveSubscriptions = customer.profitability.activeDevices > 0;
  const isActive = customer.status === 'active';

  return hasActiveSubscriptions && isActive;
}

Authorizations

Authorization
string
header
required

API key obtained from FlexPortal dashboard

Headers

Tenant-ID
string
required

Your tenant identifier

Path Parameters

customerId
string
required

The customer ID

Response

Customer details

customerId
string
required
tenantId
string
required
email
string
required
firstName
string
required
lastName
string
required
customerType
enum<string>
required
Available options:
individual,
business
totalOrders
number
required
totalDevicesRented
number
required
totalMonthlyRevenue
number
required
status
enum<string>
required
Available options:
active,
inactive
orderIds
string[]
required
rentalIds
string[]
required
createdBy
string
required
company
string
phone
string
customFields
object
lastBillingAddress
object
lastShippingAddress
object
createdAt
any
updatedAt
any
lifetimeCollected
number
totalAcquisitionCost
number
customerMargin
number
customerMarginPercent
number
subscriptionsTracked
number