Create an asset
curl --request POST \
--url https://api-eu.flexportal.io/v1/assets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Tenant-ID: <tenant-id>' \
--data '
{
"serialNumber": "C02ZN1ABCD12",
"sku": "MACBOOK-PRO-16-M3-A",
"productName": "MacBook Pro 16\" M3 Pro - Grade A",
"status": "available",
"location": "Warehouse A - Shelf 12",
"notes": "Received from supplier 2025-01-15"
}
'import requests
url = "https://api-eu.flexportal.io/v1/assets"
payload = {
"serialNumber": "C02ZN1ABCD12",
"sku": "MACBOOK-PRO-16-M3-A",
"productName": "MacBook Pro 16\" M3 Pro - Grade A",
"status": "available",
"location": "Warehouse A - Shelf 12",
"notes": "Received from supplier 2025-01-15"
}
headers = {
"Tenant-ID": "<tenant-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Tenant-ID': '<tenant-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
serialNumber: 'C02ZN1ABCD12',
sku: 'MACBOOK-PRO-16-M3-A',
productName: 'MacBook Pro 16" M3 Pro - Grade A',
status: 'available',
location: 'Warehouse A - Shelf 12',
notes: 'Received from supplier 2025-01-15'
})
};
fetch('https://api-eu.flexportal.io/v1/assets', 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/assets",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'serialNumber' => 'C02ZN1ABCD12',
'sku' => 'MACBOOK-PRO-16-M3-A',
'productName' => 'MacBook Pro 16" M3 Pro - Grade A',
'status' => 'available',
'location' => 'Warehouse A - Shelf 12',
'notes' => 'Received from supplier 2025-01-15'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-eu.flexportal.io/v1/assets"
payload := strings.NewReader("{\n \"serialNumber\": \"C02ZN1ABCD12\",\n \"sku\": \"MACBOOK-PRO-16-M3-A\",\n \"productName\": \"MacBook Pro 16\\\" M3 Pro - Grade A\",\n \"status\": \"available\",\n \"location\": \"Warehouse A - Shelf 12\",\n \"notes\": \"Received from supplier 2025-01-15\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Tenant-ID", "<tenant-id>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-eu.flexportal.io/v1/assets")
.header("Tenant-ID", "<tenant-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"serialNumber\": \"C02ZN1ABCD12\",\n \"sku\": \"MACBOOK-PRO-16-M3-A\",\n \"productName\": \"MacBook Pro 16\\\" M3 Pro - Grade A\",\n \"status\": \"available\",\n \"location\": \"Warehouse A - Shelf 12\",\n \"notes\": \"Received from supplier 2025-01-15\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-eu.flexportal.io/v1/assets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Tenant-ID"] = '<tenant-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"serialNumber\": \"C02ZN1ABCD12\",\n \"sku\": \"MACBOOK-PRO-16-M3-A\",\n \"productName\": \"MacBook Pro 16\\\" M3 Pro - Grade A\",\n \"status\": \"available\",\n \"location\": \"Warehouse A - Shelf 12\",\n \"notes\": \"Received from supplier 2025-01-15\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"asset": {
"serialNumber": "<string>",
"tenantId": "<string>",
"sku": "<string>",
"productName": "<string>",
"status": "available",
"createdAt": "<string>",
"updatedAt": "<string>",
"productId": "<string>",
"productImageUrl": "<string>",
"variantId": "<string>",
"location": "<string>",
"customerId": "<string>",
"rentalId": "<string>",
"notes": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Assets
Create Asset
Registers a new device/asset in inventory. Each asset is identified by a unique serial number. Assets start as “available” and can be assigned to subscriptions during order fulfillment.
POST
/
v1
/
assets
Create an asset
curl --request POST \
--url https://api-eu.flexportal.io/v1/assets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Tenant-ID: <tenant-id>' \
--data '
{
"serialNumber": "C02ZN1ABCD12",
"sku": "MACBOOK-PRO-16-M3-A",
"productName": "MacBook Pro 16\" M3 Pro - Grade A",
"status": "available",
"location": "Warehouse A - Shelf 12",
"notes": "Received from supplier 2025-01-15"
}
'import requests
url = "https://api-eu.flexportal.io/v1/assets"
payload = {
"serialNumber": "C02ZN1ABCD12",
"sku": "MACBOOK-PRO-16-M3-A",
"productName": "MacBook Pro 16\" M3 Pro - Grade A",
"status": "available",
"location": "Warehouse A - Shelf 12",
"notes": "Received from supplier 2025-01-15"
}
headers = {
"Tenant-ID": "<tenant-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Tenant-ID': '<tenant-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
serialNumber: 'C02ZN1ABCD12',
sku: 'MACBOOK-PRO-16-M3-A',
productName: 'MacBook Pro 16" M3 Pro - Grade A',
status: 'available',
location: 'Warehouse A - Shelf 12',
notes: 'Received from supplier 2025-01-15'
})
};
fetch('https://api-eu.flexportal.io/v1/assets', 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/assets",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'serialNumber' => 'C02ZN1ABCD12',
'sku' => 'MACBOOK-PRO-16-M3-A',
'productName' => 'MacBook Pro 16" M3 Pro - Grade A',
'status' => 'available',
'location' => 'Warehouse A - Shelf 12',
'notes' => 'Received from supplier 2025-01-15'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-eu.flexportal.io/v1/assets"
payload := strings.NewReader("{\n \"serialNumber\": \"C02ZN1ABCD12\",\n \"sku\": \"MACBOOK-PRO-16-M3-A\",\n \"productName\": \"MacBook Pro 16\\\" M3 Pro - Grade A\",\n \"status\": \"available\",\n \"location\": \"Warehouse A - Shelf 12\",\n \"notes\": \"Received from supplier 2025-01-15\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Tenant-ID", "<tenant-id>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-eu.flexportal.io/v1/assets")
.header("Tenant-ID", "<tenant-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"serialNumber\": \"C02ZN1ABCD12\",\n \"sku\": \"MACBOOK-PRO-16-M3-A\",\n \"productName\": \"MacBook Pro 16\\\" M3 Pro - Grade A\",\n \"status\": \"available\",\n \"location\": \"Warehouse A - Shelf 12\",\n \"notes\": \"Received from supplier 2025-01-15\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-eu.flexportal.io/v1/assets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Tenant-ID"] = '<tenant-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"serialNumber\": \"C02ZN1ABCD12\",\n \"sku\": \"MACBOOK-PRO-16-M3-A\",\n \"productName\": \"MacBook Pro 16\\\" M3 Pro - Grade A\",\n \"status\": \"available\",\n \"location\": \"Warehouse A - Shelf 12\",\n \"notes\": \"Received from supplier 2025-01-15\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"asset": {
"serialNumber": "<string>",
"tenantId": "<string>",
"sku": "<string>",
"productName": "<string>",
"status": "available",
"createdAt": "<string>",
"updatedAt": "<string>",
"productId": "<string>",
"productImageUrl": "<string>",
"variantId": "<string>",
"location": "<string>",
"customerId": "<string>",
"rentalId": "<string>",
"notes": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Overview
Add a new physical asset to your inventory. Assets are tracked by serial number and linked to product variants via SKU. Before you can create subscriptions, you need assets in your inventory.The serial number becomes the asset’s unique identifier. Use manufacturer serial numbers, asset tags, or your own numbering system—just ensure each is unique.
Common Use Cases
Receiving Inventory
Add assets as they arrive from suppliers
Warehouse Operations
Register assets during intake and inspection
Bulk Import
Add multiple assets from inventory spreadsheets
Returns Processing
Re-register returned/refurbished assets
Request Fields
| Field | Required | Description |
|---|---|---|
serialNumber | Yes | Unique identifier (manufacturer SN or your own) |
sku | Yes | Product variant SKU (must exist in catalog) |
acquisitionCost | No | Your cost to acquire (used for cost recovery) |
acquisitionDate | No | When acquired (default: today) |
location | No | Physical location (warehouse name, etc.) |
condition | No | Condition notes |
notes | No | Additional notes |
Minimal Example
{
"serialNumber": "SN123456789",
"sku": "MACBOOK-PRO-16-M3-18GB-SILVER"
}
Complete Example
{
"serialNumber": "C02ZX1Y2MD6T",
"sku": "MACBOOK-PRO-16-M3-18GB-SILVER",
"acquisitionCost": 1750.00,
"acquisitionDate": "2025-01-15",
"location": "Amsterdam Warehouse",
"condition": "New in box",
"notes": "Batch order #2025-001"
}
Serial Number Best Practices
Choose a consistent serial number strategy:| Approach | Example | Pros |
|---|---|---|
| Manufacturer SN | C02ZX1Y2MD6T | Matches physical label |
| Your numbering | FP-2025-00001 | Predictable, sequential |
| Combined | APPLE-C02ZX1Y2MD6T | Searchable by manufacturer |
Serial numbers must be unique within your tenant. Attempting to create an asset with an existing serial number returns a
409 Conflict error.SKU Validation
The SKU must match an active product variant. Before creating assets:- Verify the SKU exists using List Variants
- Ensure the variant is
active, notinactive
Acquisition Cost Importance
TheacquisitionCost is crucial for cost recovery calculations:
- If provided: Used for profitability tracking on subscriptions
- If omitted: System may use variant’s default acquisition cost
// Example: Asset with cost tracking
await createAsset({
serialNumber: 'SN123456789',
sku: 'MACBOOK-PRO-16-M3-18GB-SILVER',
acquisitionCost: 1750.00 // What you paid for this unit
});
Example: Bulk Asset Creation
async function importAssets(assetList) {
const results = { created: 0, errors: [] };
for (const asset of assetList) {
try {
await createAsset({
serialNumber: asset.serialNumber,
sku: asset.sku,
acquisitionCost: asset.cost,
location: asset.warehouse
});
results.created++;
} catch (error) {
results.errors.push({
serialNumber: asset.serialNumber,
error: error.message
});
}
}
return results;
}
Error Handling
| Error Code | Cause | Solution |
|---|---|---|
ASSET_EXISTS | Serial number already in use | Use unique serial number |
VARIANT_NOT_FOUND | SKU doesn’t exist | Create product variant first |
VARIANT_INACTIVE | SKU is deactivated | Reactivate variant or use different SKU |
VALIDATION_ERROR | Missing required fields | Check serial number and SKU |
Related Endpoints
- List Assets - View all assets
- Get Asset - Verify asset was created
- List Variants - Find valid SKUs
- Create Subscription - Use asset in subscription
Authorizations
API key obtained from FlexPortal dashboard
Headers
Your tenant identifier
Body
application/json
Minimum string length:
1Minimum string length:
1Minimum string length:
1Minimum string length:
1Available options:
available, rented_out, returned, sold, unavailable Was this page helpful?