Add a Variant

POST /items/{itemId}/variants

Add a new variant for an item

Path parameters

  • itemId string(guid) Required

    ID of the item to add a variant to

application/json

Body

  • variant object
    Hide variant attributes Show variant attributes object
    • parent_id string(guid)
    • parent_title string
    • parent_product_code string
    • description string
    • sku string
    • upc string
    • msrp string(float)
    • unit_price string(float)
    • map string(float)

      Minimum Advertised Price

    • moq integer(int32)

      Minimum Order Quantity

    • quantity_multiplier integer(int32)

      Multiple of quantity to be ordered

    • options array[object]
      Hide options attributes Show options attributes object
      • name string
      • value string
      • _destroy boolean
    • sku_status string

      Status of the variant SKU (active or inactive)

      Values are active or inactive.

Responses

  • 201 application/json

    Variant created

    Hide response attributes Show response attributes object
    • id string(guid)

      System generated unique identifier. Don't include this in POST request body.

    • parent_id string(guid)
    • parent_title string
    • parent_product_code string
    • title string

      Autogenerated - Variant title is a combination of all option values

    • description string
    • sku string
    • upc string
    • msrp string(float)
    • unit_price string(float)
    • map string(float)

      Minimum Advertised Price

    • moq integer(int32)

      Minimum Order Quantity

    • quantity_multiplier integer(int32)

      Multiple of quantity to be ordered

    • options array[object]
      Hide options attributes Show options attributes object
      • name string
      • value string
      • _destroy boolean
    • sku_status string

      Status of the variant SKU (active or inactive)

      Values are active or inactive.

    • category_id string(guid)

      Inherited from parent product

    • vendor_id string(guid)

      Inherited from parent product

    • brand_id string(guid)

      Inherited from parent product

    • category_name string

      Category Name to which the item belongs, Inherited from parent product

    • vendor_name string

      Vendor Name to which the item belongs, Inherited from parent product

    • brand_name string

      Brand Name to which the item belongs, Inherited from parent product

  • 401 application/json

    Unauthorized

    Hide response attributes Show response attributes object
    • error string

      401: Invalid Credentials

      404: Resource not found

      422: Unprocessable Entity

    • details string

      404: empty

      401: The credentials presented are not valid to access this resource

  • 404 application/json

    Not Found

    Hide response attributes Show response attributes object
    • error string

      401: Invalid Credentials

      404: Resource not found

      422: Unprocessable Entity

    • details string

      404: empty

      401: The credentials presented are not valid to access this resource

  • 422 application/json

    Unprocessable Entity

    Hide response attributes Show response attributes object
    • error string

      401: Invalid Credentials

      404: Resource not found

      422: Unprocessable Entity

    • details string

      404: empty

      401: The credentials presented are not valid to access this resource

POST /items/{itemId}/variants
curl \
 --request POST 'https://app.getfoundation.com/api/external/v1/items/{itemId}/variants' \
 --header "X-API-Key: $API_KEY" \
 --header "Content-Type: application/json" \
 --data '{"variant":{"parent_id":"9aa62446-c3b0-42f5-8027-3648daed9d73","parent_title":"Dog Collar","parent_product_code":"DC","description":"A beautiful red dog collar","sku":"DC-001-R","upc":"123456789012","msrp":99.99,"unit_price":49.99,"map":49.99,"moq":10,"quantity_multiplier":1,"options":[{"name":"Size","value":"Large"},{"name":"Material","value":"Leather"}],"sku_status":"active"}}'
Request examples
{
  "variant": {
    "parent_id": "9aa62446-c3b0-42f5-8027-3648daed9d73",
    "parent_title": "Dog Collar",
    "parent_product_code": "DC",
    "description": "A beautiful red dog collar",
    "sku": "DC-001-R",
    "upc": "123456789012",
    "msrp": 99.99,
    "unit_price": 49.99,
    "map": 49.99,
    "moq": 10,
    "quantity_multiplier": 1,
    "options": [
      {
        "name": "Size",
        "value": "Large"
      },
      {
        "name": "Material",
        "value": "Leather"
      }
    ],
    "sku_status": "active"
  }
}
Response examples (201)
{
  "id": "9aa62446-c3b0-42f5-8027-3648daed9d73",
  "parent_id": "9aa62446-c3b0-42f5-8027-3648daed9d73",
  "parent_title": "Dog Collar",
  "parent_product_code": "DC",
  "title": "Large / Leather",
  "description": "A beautiful red dog collar",
  "sku": "DC-001-R",
  "upc": "123456789012",
  "msrp": 99.99,
  "unit_price": 49.99,
  "map": 49.99,
  "moq": 10,
  "quantity_multiplier": 1,
  "options": [
    {
      "name": "Size",
      "value": "Large"
    },
    {
      "name": "Material",
      "value": "Leather"
    }
  ],
  "sku_status": "active",
  "category_id": "string",
  "vendor_id": "string",
  "brand_id": "string",
  "category_name": "Toys",
  "vendor_name": "Acme Corp",
  "brand_name": "Acme Corp"
}
Response examples (401)
{
  "error": "string",
  "details": "string"
}
Response examples (404)
{
  "error": "string",
  "details": "string"
}
Response examples (422)
{
  "error": "string",
  "details": "string"
}