Skip to content

Create product variant

POST/api/v1/inventory/products/variants

Create a new product variant. When the business has Stripe connected, the variant is mirrored to Stripe Catalog (Product + Price); otherwise the variant is created locally with empty Stripe IDs and can be synced later.

Operation ID: create_variant·View as markdown·OpenAPI slice

Authentication

Bearer token authentication. Pass your DayZero API token in the Authorization header and the target business UUID in x-business-id.

Request body

product_idstring

UUID of the parent product this variant belongs to.

unit_priceinteger

Sale price in cents (e.g., 2999 = $29.99).

unit_costinteger

Cost price in cents for margin calculations.

unit_cost_precisenumber

Precise unit cost in dollars with sub-cent precision (e.g. 0.0478 for $0.0478/gram).

namestring

Variant name (e.g., 'Large - Blue').

skustring

Stock Keeping Unit - unique identifier for inventory.

manufacturer_skustring

Manufacturer's SKU for supplier ordering.

barcodestring

Scannable barcode (UPC/EAN/QR). Distinct from SKU.

uomstring

Unit of measure: EA, LB, G, KG, OZ, L, ML, etc.

inventory_categorystring

Which inventory ledger this item's cost sits in: raw_material, packaging or finished_good. Production runs and counts post by it.

default_vendor_idstring

UUID of the preferred vendor for this variant.

tax_code_idstring

UUID of the tax code that decides whether this variant is charged sales tax on invoices. Omit for the default: taxable.

initial_inventory_quantityinteger

Starting inventory quantity.

initial_inventory_quantity_datestring · date-time

Date for the initial inventory count (ISO 8601).

Responses

201Variant created successfully

successboolean
messagestring
codestring
dataVariantResponse

400Bad request - invalid data

errorstringrequired

Error category: validation_error, unauthorized, forbidden, not_found, conflict, rate_limited, server_error, or service_unavailable.

messagestringrequired

Human-readable explanation, safe to show to end users.

codestringrequired

Stable machine-readable code in CATEGORY_NNN form (e.g. NOT_FOUND_006, AUTH_010, GEN_002).

request_idstring

Correlation id for support requests. Echoes the x-request-id request header when one was supplied.

errorsobject

Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

401Unauthorized - Missing or expired token, an MCP OAuth token used against the REST API, or no access to this business

errorstringrequired

Error category: validation_error, unauthorized, forbidden, not_found, conflict, rate_limited, server_error, or service_unavailable.

messagestringrequired

Human-readable explanation, safe to show to end users.

codestringrequired

Stable machine-readable code in CATEGORY_NNN form (e.g. NOT_FOUND_006, AUTH_010, GEN_002).

request_idstring

Correlation id for support requests. Echoes the x-request-id request header when one was supplied.

errorsobject

Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

403Forbidden - Insufficient permissions

errorstringrequired

Error category: validation_error, unauthorized, forbidden, not_found, conflict, rate_limited, server_error, or service_unavailable.

messagestringrequired

Human-readable explanation, safe to show to end users.

codestringrequired

Stable machine-readable code in CATEGORY_NNN form (e.g. NOT_FOUND_006, AUTH_010, GEN_002).

request_idstring

Correlation id for support requests. Echoes the x-request-id request header when one was supplied.

errorsobject

Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

404Business or product not found

errorstringrequired

Error category: validation_error, unauthorized, forbidden, not_found, conflict, rate_limited, server_error, or service_unavailable.

messagestringrequired

Human-readable explanation, safe to show to end users.

codestringrequired

Stable machine-readable code in CATEGORY_NNN form (e.g. NOT_FOUND_006, AUTH_010, GEN_002).

request_idstring

Correlation id for support requests. Echoes the x-request-id request header when one was supplied.

errorsobject

Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

409Variant with same SKU already exists

errorstringrequired

Error category: validation_error, unauthorized, forbidden, not_found, conflict, rate_limited, server_error, or service_unavailable.

messagestringrequired

Human-readable explanation, safe to show to end users.

codestringrequired

Stable machine-readable code in CATEGORY_NNN form (e.g. NOT_FOUND_006, AUTH_010, GEN_002).

request_idstring

Correlation id for support requests. Echoes the x-request-id request header when one was supplied.

errorsobject

Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

422Validation error

errorstringrequired

Error category: validation_error, unauthorized, forbidden, not_found, conflict, rate_limited, server_error, or service_unavailable.

messagestringrequired

Human-readable explanation, safe to show to end users.

codestringrequired

Stable machine-readable code in CATEGORY_NNN form (e.g. NOT_FOUND_006, AUTH_010, GEN_002).

request_idstring

Correlation id for support requests. Echoes the x-request-id request header when one was supplied.

errorsobject

Field-level validation messages keyed by field name. Present on 400/422 validation failures only.