# UpsertProductDTO

A product to be created or updated.

- id: (\`string\`) The ID of the product to update. If not provided, a product
  is created instead. In that case, the \`title\` property is required.
- title: (\`string\`) The title of the product.
- subtitle: (\`null\` \\| \`string\`) The subttle of the product.
- description: (\`null\` \\| \`string\`) The description of the product.
- is\_giftcard: (\`boolean\`) Whether the product is a gift card.
- discountable: (\`boolean\`) Whether the product can be discounted.
- thumbnail: (\`null\` \\| \`string\`) The URL of the product's thumbnail.
- handle: (\`string\`) The handle of the product. The handle can be used to create slug URL paths.
  If not supplied, the value of the \`handle\` attribute of the product is set to the slug version of the \`title\` attribute.
- status: (\[ProductStatus]\(../../types/product.ProductStatus/page.mdx)) The status of the product.
- images: (\[UpsertProductImageDTO]\(../product.UpsertProductImageDTO/page.mdx)\[]) The associated images to create or update.

  - id: (\`string\`) The product image's ID. If not provided, the image is created. In
    that case, the \`url\` property is required.

  - url: (\`string\`) The new URL of the product image.

  - metadata: (\[MetadataType]\(../../types/product.MetadataType/page.mdx)) Holds custom data in key-value pairs.
- external\_id: (\`null\` \\| \`string\`) The id of the product in an external system
- type\_id: (\`null\` \\| \`string\`) The product type to associate with the product.
- collection\_id: (\`null\` \\| \`string\`) The product collection to associate with the product.
- tag\_ids: (\`string\`\[]) The tags to associate with the product
- category\_ids: (\`string\`\[]) The product categories to associate with the product.
- options: (\[UpsertProductOptionDTO]\(../product.UpsertProductOptionDTO/page.mdx)\[]) The associated options to create or update.

  - id: (\`string\`) The ID of the product option to update. If not provided, the product
    option is created. In that case, the \`title\` and \`values\` properties are
    required.

  - title: (\`string\`) The product option's title.

  - values: (\`string\`\[]) The product option values.

  - product\_id: (\`string\`) The ID of the associated product.
- variants: (\[UpsertProductVariantDTO]\(../product.UpsertProductVariantDTO/page.mdx)\[]) The product variants to be created and associated with the product.
  You can also update existing product variants associated with the product.

  - id: (\`string\`) The ID of the product variant to update.

  - title: (\`string\`) The tile of the product variant.

  - sku: (\`null\` \\| \`string\`) The SKU of the product variant.

  - barcode: (\`null\` \\| \`string\`) The barcode of the product variant.

  - ean: (\`null\` \\| \`string\`) The EAN of the product variant.

  - upc: (\`null\` \\| \`string\`) The UPC of the product variant.

  - allow\_backorder: (\`boolean\`) Whether the product variant can be ordered when it's out of stock.

  - manage\_inventory: (\`boolean\`) Whether the product variant's inventory should be managed by the core system.

  - hs\_code: (\`null\` \\| \`string\`) The HS Code of the product variant.

  - origin\_country: (\`null\` \\| \`string\`) The origin country of the product variant.

  - mid\_code: (\`null\` \\| \`string\`) The MID Code of the product variant.

  - material: (\`null\` \\| \`string\`) The material of the product variant.

  - weight: (\`null\` \\| \`number\`) The weight of the product variant.

  - length: (\`null\` \\| \`number\`) The length of the product variant.

  - height: (\`null\` \\| \`number\`) The height of the product variant.

  - width: (\`null\` \\| \`number\`) The width of the product variant.

  - options: (\`Record\<string, string>\`) The product variant options to associate with the product variant.

  - metadata: (\[MetadataType]\(../../types/product.MetadataType/page.mdx)) Holds custom data in key-value pairs.
- width: (\`null\` \\| \`number\`) The width of the product.
- height: (\`null\` \\| \`number\`) The height of the product.
- length: (\`null\` \\| \`number\`) The length of the product.
- weight: (\`null\` \\| \`number\`) The weight of the product.
- origin\_country: (\`null\` \\| \`string\`) The origin country of the product.
- hs\_code: (\`null\` \\| \`string\`) The HS Code of the product.
- material: (\`null\` \\| \`string\`) The material of the product.
- mid\_code: (\`null\` \\| \`string\`) The MID Code of the product.
- metadata: (\[MetadataType]\(../../types/product.MetadataType/page.mdx)) Holds custom data in key-value pairs.
