Skip to main content
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"
}
'
{
  "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>"
  }
}

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

FieldRequiredDescription
serialNumberYesUnique identifier (manufacturer SN or your own)
skuYesProduct variant SKU (must exist in catalog)
acquisitionCostNoYour cost to acquire (used for cost recovery)
acquisitionDateNoWhen acquired (default: today)
locationNoPhysical location (warehouse name, etc.)
conditionNoCondition notes
notesNoAdditional 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:
ApproachExamplePros
Manufacturer SNC02ZX1Y2MD6TMatches physical label
Your numberingFP-2025-00001Predictable, sequential
CombinedAPPLE-C02ZX1Y2MD6TSearchable 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:
  1. Verify the SKU exists using List Variants
  2. Ensure the variant is active, not inactive

Acquisition Cost Importance

The acquisitionCost 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 CodeCauseSolution
ASSET_EXISTSSerial number already in useUse unique serial number
VARIANT_NOT_FOUNDSKU doesn’t existCreate product variant first
VARIANT_INACTIVESKU is deactivatedReactivate variant or use different SKU
VALIDATION_ERRORMissing required fieldsCheck serial number and SKU

Authorizations

Authorization
string
header
required

API key obtained from FlexPortal dashboard

Headers

Tenant-ID
string
required

Your tenant identifier

Body

application/json
serialNumber
string
required
Minimum string length: 1
tenantId
string
required
Minimum string length: 1
sku
string
required
Minimum string length: 1
productName
string
required
Minimum string length: 1
status
enum<string>
required
Available options:
available,
rented_out,
returned,
sold,
unavailable
createdAt
any
required
updatedAt
any
required
productId
string
productImageUrl
string<uri>
variantId
string
location
string
customerId
string
rentalId
string
notes
string

Response

Asset created

success
boolean
required
message
string
required
asset
object
required