Product & variant

Update product and variants

Partially updates an existing product and reconciles its variants in a single request. Only the fields present in the payload are written. A variant with an id is updated; a variant without an id is created and linked to the product; existing variants omitted from the payload are left untouched (deletion is out of scope for v1). Scoped to the API key company. The update is non-transactional: a failure mid-write can leave earlier writes applied.

patch/v1/workflows/product/update-product-and-variants

Request

  • Base URL: https://api.finalpos.com (the document declares no server; this is the origin it was published from)
  • URL: https://api.finalpos.com/v1/workflows/product/update-product-and-variants
  • Auth: API key in header x-api-key

Request body

Example request

{
  "product": {
    "name": "Sweet Tea",
    "productType": "simple",
    "source": "woo-commerce",
    "externalId": "1234567890",
    "description": "Sweet Tea is a refreshing drink made with tea and sugar.",
    "shortDescription": "Sweet Tea is a drink with sugar.",
    "sku": "1234567890",
    "images": [
      "https://example.com/image1.jpg",
      "https://example.com/image2.jpg"
    ],
    "tags": [
      "sweet",
      "tea",
      "refreshing"
    ],
    "status": "active",
    "minPrice": 100,
    "maxPrice": 200,
    "supplier": "Supplier 1",
    "taxTable": "o1p2q3r4s5t6u7v8w9x0y1z2",
    "bookingRulesId": "o1p2q3r4s5t6u7v8w9x0y1z2",
    "defaultVariantId": "o1p2q3r4s5t6u7v8w9x0y1z2",
    "categories": [
      "o1p2q3r4s5t6u7v8w9x0y1z2",
      "o1p2q3r4s5t6u7v8w9x0y1z3"
    ],
    "metadata": [
      {
        "key": "key1",
        "value": "value1"
      },
      {
        "key": "key2",
        "value": "value2"
      }
    ],
    "attributes": [
      {
        "name": "color",
        "values": [
          "red",
          "blue"
        ]
      }
    ],
    "barcode": "1234567890"
  },
  "variants": [
    {
      "productId": "o1p2q3r4s5t6u7v8w9x0y1z2",
      "sku": "1234567890",
      "isOnSale": true,
      "barcode": "1234567890",
      "price": 10000,
      "salePrice": 9000,
      "externalId": "1234567890",
      "allowBackorder": true,
      "costPrice": 8000,
      "images": [
        "https://example.com/image1.jpg",
        "https://example.com/image2.jpg"
      ],
      "metadata": [
        {
          "key": "key1",
          "value": "value1"
        },
        {
          "key": "key2",
          "value": "value2"
        }
      ],
      "attributes": [
        {
          "name": "color",
          "value": "red"
        }
      ],
      "unitId": "KGM",
      "stockVariantId": "68d4a2c7b1e35f9a4c67a101"
    }
  ]
}

Response

Product and variants updated.

Example response

{
  "product": {
    "id": "o1p2q3r4s5t6u7v8w9x0y1z2",
    "createdAt": "2025-12-07T19:31:48.436+00:00",
    "updatedAt": "2025-12-07T19:35:48.436+00:00",
    "companyId": "o1p2q3r4s5t6u7v8w9x0y1z2",
    "name": "Sweet Tea",
    "productType": "simple",
    "source": "woo-commerce",
    "externalId": "1234567890",
    "description": "Sweet Tea is a refreshing drink made with tea and sugar.",
    "shortDescription": "Sweet Tea is a drink with sugar.",
    "sku": "1234567890",
    "images": [
      "https://example.com/image1.jpg",
      "https://example.com/image2.jpg"
    ],
    "tags": [
      "sweet",
      "tea",
      "refreshing"
    ],
    "status": "active",
    "minPrice": 100,
    "maxPrice": 200,
    "supplier": "Supplier 1",
    "taxTable": "o1p2q3r4s5t6u7v8w9x0y1z2",
    "bookingRulesId": "o1p2q3r4s5t6u7v8w9x0y1z2",
    "defaultVariantId": "o1p2q3r4s5t6u7v8w9x0y1z2",
    "categories": [
      "o1p2q3r4s5t6u7v8w9x0y1z2",
      "o1p2q3r4s5t6u7v8w9x0y1z3"
    ],
    "currency": "USD",
    "minorUnits": 2,
    "metadata": [
      {
        "key": "key1",
        "value": "value1"
      },
      {
        "key": "key2",
        "value": "value2"
      }
    ],
    "attributes": [
      {
        "name": "color",
        "values": [
          "red",
          "blue"
        ]
      }
    ],
    "barcode": "1234567890"
  },
  "variants": [
    {
      "id": "o1p2q3r4s5t6u7v8w9x0y1z2",
      "createdAt": "2025-12-07T19:31:48.436+00:00",
      "updatedAt": "2025-12-07T19:35:48.436+00:00",
      "companyId": "o1p2q3r4s5t6u7v8w9x0y1z2",
      "productId": "o1p2q3r4s5t6u7v8w9x0y1z2",
      "sku": "1234567890",
      "isOnSale": true,
      "barcode": "1234567890",
      "price": 10000,
      "salePrice": 9000,
      "externalId": "1234567890",
      "allowBackorder": true,
      "costPrice": 8000,
      "images": [
        "https://example.com/image1.jpg",
        "https://example.com/image2.jpg"
      ],
      "currency": "USD",
      "minorUnits": 2,
      "metadata": [
        {
          "key": "key1",
          "value": "value1"
        },
        {
          "key": "key2",
          "value": "value2"
        }
      ],
      "attributes": [
        {
          "name": "color",
          "value": "red"
        }
      ],
      "unitId": "KGM",
      "stockVariantId": "68d4a2c7b1e35f9a4c67a101"
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.