Skip to main content
PUT
/
v1
/
products
/
{productId}
Update a product
curl --request PUT \
  --url https://api-eu.flexportal.io/v1/products/{productId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'Tenant-ID: <tenant-id>' \
  --data '
{
  "productSku": "<string>",
  "name": "<string>",
  "specification": "<string>",
  "category": "<string>",
  "brand": "<string>",
  "variants": [
    {
      "variantSku": "<string>",
      "variantName": "<string>",
      "grade": "<string>",
      "pricing": [
        {
          "contractLength": 2,
          "monthlyPrice": 1,
          "setupFee": 1,
          "discount": {
            "type": "percentage",
            "value": 1,
            "description": "<string>"
          },
          "source": "suggested",
          "calculatedAt": "<unknown>",
          "presetUsed": "<string>"
        }
      ],
      "variantId": "<string>",
      "condition": "<string>",
      "colorName": "<string>",
      "images": [
        "<string>"
      ],
      "listPrice": 1,
      "acquisitionCost": 1
    }
  ],
  "description": "<string>",
  "images": [
    "<string>"
  ]
}
'
{
  "success": true,
  "message": "<string>",
  "productId": "<string>",
  "productSku": "<string>",
  "operation": "created",
  "variantResults": [
    {
      "variantSku": "<string>",
      "operation": "create"
    }
  ]
}

Overview

Update an existing product’s details and variants. Use this endpoint to modify product information, update pricing, add new variants, or change variant status.

Common Use Cases

  • Price Updates: Adjust subscription pricing based on market conditions
  • Add Variants: Add new configurations (colors, specs, grades)
  • Product Refresh: Update descriptions, images, or categories
  • Discontinue Variants: Mark old variants as inactive
  • Grade Adjustments: Reclassify product condition after inspection

Partial Updates

This endpoint supports partial updates. You only need to include fields you want to change:
{
  "name": "MacBook Pro 16\" (2024)",
  "description": "Updated description with new features"
}

Updating Variants

To update variants, include the variants array with the variants you want to modify or add:
{
  "variants": [
    {
      "sku": "MACBOOK-PRO-16-M3-18GB-SILVER",
      "pricing": {
        "12": 149.00,
        "24": 119.00,
        "36": 99.00
      }
    }
  ]
}

Variant Update Behavior

ScenarioBehavior
Existing SKUVariant is updated with new values
New SKUNew variant is created
Missing SKUVariant remains unchanged
Variants are matched by sku. If you include a variant with a new SKU, it will be created. To modify an existing variant, you must use its exact current SKU.

Updating Pricing

Update pricing for specific contract lengths:
{
  "variants": [
    {
      "sku": "MACBOOK-PRO-16-M3-18GB-SILVER",
      "pricing": {
        "12": 149.00,
        "24": 119.00
      }
    }
  ]
}
Pricing changes only affect new orders. Existing subscriptions retain their original pricing.

Updating Acquisition Cost

When asset costs change (e.g., new supplier pricing):
{
  "variants": [
    {
      "sku": "MACBOOK-PRO-16-M3-18GB-SILVER",
      "acquisitionCost": 1650.00
    }
  ]
}
This affects cost recovery calculations for new subscriptions.

Discontinuing a Product

To discontinue a product (hide from catalog but preserve history):
{
  "status": "discontinued"
}
Discontinued products cannot be used in new orders but remain visible for existing subscriptions and historical reporting.

Example: Adding New Color Variant

// Add Space Black variant to existing MacBook Pro
await updateProduct('prod_abc123', {
  variants: [
    {
      sku: 'MACBOOK-PRO-16-M3-18GB-BLACK',
      specification: 'M3 Pro, 18GB RAM, 512GB SSD',
      grade: 'A',
      color: 'Space Black',
      listPrice: 2499.00,
      acquisitionCost: 1800.00,
      pricing: {
        '12': 159.00,
        '24': 129.00,
        '36': 109.00
      }
    }
  ]
});

Example: Bulk Price Reduction

// Reduce prices on older stock
await updateProduct('prod_abc123', {
  variants: [
    {
      sku: 'MACBOOK-PRO-16-M3-18GB-SILVER',
      grade: 'B',  // Reclassify as Grade B
      pricing: {
        '12': 139.00,
        '24': 109.00,
        '36': 89.00
      }
    }
  ]
});

Authorizations

Authorization
string
header
required

API key obtained from FlexPortal dashboard

Headers

Tenant-ID
string
required

Your tenant identifier

Path Parameters

productId
string
required

The product ID

Body

application/json
productSku
string
required
Minimum string length: 1
name
string
required
Minimum string length: 1
specification
string
required
Minimum string length: 1
category
string
required
Minimum string length: 1
brand
string
required
Minimum string length: 1
variants
object[]
required
Minimum array length: 1
description
string
images
string<uri>[]

Response

Product updated

success
enum<boolean>
required
Available options:
true,
false
message
string
required
productId
string
required
productSku
string
required
operation
enum<string>
required
Available options:
created,
updated
variantResults
object[]
required