# Generate variants

Endpoint: POST /products/{productID}/variants/generate
Version: 1.0.447.36344
Security: OAuth2

## Path parameters:

  - `productID` (string, required)
    ID of the product.

## Query parameters:

  - `overwriteExisting` (boolean)
    Overwrite existing of the product.

## Request fields (application/json):

  - `Active` (boolean)
    Overrides the Active value inherited from the product when generating variants.

## Response 201 fields (application/json):

  - `OwnerID` (string)
    ID of the organization that owns the product. Only the marketplace owner can override the OwnerID on create.

  - `DefaultPriceScheduleID` (string)
    When provided, no explicit price schedule assignment is required. When a price schedule assignment exists, it will override any default provided.

  - `AutoForward` (boolean)
    If true, when this product is ordered by a buyer, it will automatically be added to a new order from the marketplace owner to the default supplier and submitted. Requires a valid DefaultSupplierID.

  - `ID` (string)

  - `ParentID` (string)
    ID of the parent product. If not null, IsParent should be false

  - `IsParent` (boolean)
    If true, ParentID must be null, as a parent product cannot have a parent itself.

  - `IsBundle` (boolean)
    If true, IsParent must be false, as a parent product cannot be a bundle.

  - `Name` (string)

  - `Description` (string)

  - `QuantityMultiplier` (integer)
    For reference only, does not influence any OrderCloud behavior. Used to indicate an amount per Quantity.

  - `ShipWeight` (number)

  - `ShipHeight` (number)

  - `ShipWidth` (number)

  - `ShipLength` (number)

  - `Active` (boolean)
    If false, product is not visible or purchasable from a buyer's perspective.

  - `SpecCount` (integer)
    Count of specs assigned to the product.

  - `VariantCount` (integer)
    Count of variants generated from the product/spec combinations.

  - `ShipFromAddressID` (string)
    Marketplace owner or supplier AddressID where the product will be shipped from. Can be used to calculate shipping costs.

  - `Inventory` (object)
    Example: {"Enabled":false,"NotificationPoint":0,"VariantLevelTracking":false,"OrderCanExceed":false,"QuantityAvailable":0,"LastUpdated":"2018-01-01T00:00:00-06:00"}

  - `Inventory.Enabled` (boolean)
    If true, inventory will be tracked and enforced.

  - `Inventory.NotificationPoint` (integer)

  - `Inventory.VariantLevelTracking` (boolean)
    If true, QuantityAvailable will be determined at the variant level.

  - `Inventory.OrderCanExceed` (boolean)
    If true, a user can create line items and place orders for the product even if there is insufficient QuantityAvailable.

  - `Inventory.QuantityAvailable` (integer)
    Automatically decrements on order submit. If you utilize inventory records either at the product or variant level, this property becomes readonly, and is derived from the sum of all QuantityAvailable of each InventoryRecord. If VariantLevelTracking is enabled, this is the sum of all variant quantities.

  - `Inventory.LastUpdated` (string)
    Example: "2018-01-01T00:00:00-06:00"

  - `DefaultSupplierID` (string)
    Used for forwarding orders to suppliers.

  - `AllSuppliersCanSell` (boolean)
    If true, all suppliers are eligible to opt into selling this product.

  - `Returnable` (boolean)

  - `DateCreated` (string)
    Example: "2018-01-01T00:00:00-06:00"

  - `xp` (object)
    Example: {}

## Response 4XX fields (application/json):

  - `StatusCode` (integer)
    Example: "404"

  - `ErrorCode` (string)
    Example: "NotFoundError"

  - `Message` (string)
    Example: "Object not found"

  - `Data` (object)
    Example: {"ObjectType":"","ObjectID":""}


