Bulk Upsert Products

Beta
POST/v1/catalog/products/actions/bulk-upsert

Idempotent with Idempotency-Key header. Learn more

Creates or updates multiple products for the account, matched by SKU. Validates and resolves synchronously, then writes asynchronously — 202 with a job to poll.

include[]optional arrayenumValues:created_bycreated_by.role

Sub-objects to expand in the response. When omitted, sub-objects are returned as null.

productsarray of object

Products to create or update, matched by SKU within the account.

skustring

SKU for the product, used to match an existing product within the account. If it exists the product is updated in place; otherwise a new product is created. A SKU already used by a non-product item fails that row.

typeoptional stringenumValues:saleserviceshipping

Product type. Create-only; defaults to sale when omitted.

descriptionoptional string

Product description.

notesoptional string

Product notes.

categoryobject

Item category to place the product in, referenced by id or name. Create-only.

idstring

Object ID.

namestring

Object name, matched case-insensitively.

product_lineoptional object

Product line to assign, referenced by id or name. Create-only.

idstring

Object ID.

namestring

Object name, matched case-insensitively.

portal_visibilityoptional stringenumValues:visiblehidden

Whether the product is shown to buyers in the customer portal. Defaults to hidden on create; preserved when omitted on update.

unit_priceoptional object

Selling price per unit. Numerator must be a currency unit, denominator the per-unit basis. Defaults to a zero rate in the category's base unit on create; unchanged when omitted on update.

valuestring (decimal)

Decimal value of the rate, expressed as the amount of the numerator unit per one denominator unit.

numerator_unit_idstring

ID of the unit for the rate's numerator (e.g. the currency of a price).

denominator_unit_idstring

ID of the unit for the rate's denominator (the per-unit basis).

unit_costoptional object

Cost per unit. Same currency-vs-non-currency rule as unit_price.

valuestring (decimal)

Decimal value of the rate, expressed as the amount of the numerator unit per one denominator unit.

numerator_unit_idstring

ID of the unit for the rate's numerator (e.g. the currency of a price).

denominator_unit_idstring

ID of the unit for the rate's denominator (the per-unit basis).

propertiesarray of object

Properties to attach to the product, matched/created by name + value. Additive — existing attributes are not removed. Defaults to [].

namestring

Property name (e.g. "Color"). Matched case-insensitively; created if missing.

valuestring

Property value (e.g. "Red"). Matched case-insensitively; created under the property if missing. A value already in use under a different property fails the whole job.

idstring

Job ID.

objectstringenumValues:job

Resource type identifier.

typestringenumValues:bulk_createbulk_upsertexport

The kind of work the job carries out.

resource_typestringnullableenumValues:accountactorentity

The kind of resource the job operates on, as an object-type value (e.g. product).

type names the verb — what the job does — and this names the subject, so a job that produced no results still says what it was for.

statusstringenumValues:createdstartedcompleted

How far the job has got.

completed means the work was processed, not that every row succeeded — read each entry's own status in results.

created_byactorExpandablenullable

The actor who requested the work.

idstring

Unique identifier of the actor.

objectstringenumValues:actor

Resource type identifier.

typestringenumValues:userapi_keyagent

Actor type.

  • user: a human user account.
  • api_key: a programmatic caller authenticating with an API key.
  • agent: an automated agent acting on the account's behalf.
  • group: a shared group identity, such as a "Customer Service" persona, rather than a single individual.
namestringnullable

The actor's display name.

handlestringnullable

Human-readable handle identifying the actor.

  • For user actors: the user's email address.
  • For api_key actors: the redacted key value.

Other actor types carry no handle.

avatar_urlstringnullable

URL of the actor's profile photo, if one is set.

Only populated for user actors.

roleroleExpandablenullable

The role the actor holds in the account, which determines what it is permitted to do.

idstring

Role ID.

objectstringenumValues:role

Resource type identifier.

namestring

Display name of the role.

Unique within the account.

typestringenumValues:adminuserscanner

The kind of role.

The type gates behavior that individual permissions do not cover, and some actions are reserved for a single role type.

  • admin: full administrative access. Sensitive areas such as API keys, billing, and third-party integrations are restricted to admins no matter what permissions another role holds.
  • user: a custom role tailored to a specific need, with its permissions defined explicitly. Roles created through the API always have this type.
  • scanner: the role used by shop-floor scanning stations, assigned automatically when a scanning-station user is created.
  • sales_rep: a role for sales representatives. Order analytics are scoped to the rep's own orders.
  • agent: a role assigned to an automated agent rather than a person.
ownerownernullable

Provenance of this role.

System-owned roles are platform-provided defaults shared across all accounts and cannot be updated or deleted; account-owned roles are custom to your account.

Always returned as null in this endpoint.
permissionsarray of stringnullable

Permissions granted by this role, in {permission}:{action} format, such as customers:read.

created_atstring (date-time)

Creation timestamp.

updated_atstring (date-time)

Last updated timestamp.

resultslistnullable

One entry per submitted row, saying what became of it. A bulk create records these when it accepts the request, so they stay provisional until status is completed.

page_info.has_next_page is true when the job produced more rows than it records.

objectstringenumValues:list

Resource type identifier.

page_infoobject

Pagination metadata.

next_page_urlstringnullable

Relative URL that fetches the next page of results.

previous_page_urlstringnullable

Relative URL that fetches the previous page of results.

has_next_pageboolean

Whether more results exist after this page.

has_prev_pageboolean

Whether results exist before this page.

dataarray of job_result

Resources in this page.

objectstringenumValues:job_result

Resource type identifier.

indexinteger

Zero-based row of the request this result names.

statusstringenumValues:createdupdatedfailed

What became of the row.

  • created: the row produced a new resource.
  • updated: the row updated an existing resource.
  • failed: the row was rejected and wrote nothing.
resourceentitynullable

The resource the row produced. Null when the row failed.

idstring

Unique identifier for the entity.

objectstringenumValues:entity

Resource type identifier.

typestringenumValues:accountactorentity

The resource kind that this entity references, as an object-type value (e.g. user, account).

Unlike object — which is always entity — this names the underlying resource the id points to.

namestringnullable

Human-readable display name for the entity (e.g. a user's full name, a sales order number).

handlestringnullable

Secondary human-readable identifier (e.g. email address, username, redacted API key value).

sub_resourceslistnullable

Resources produced as a side effect to the row's primary operation.

For example, when creating a production run, several batch records may also be created.

objectstringenumValues:list

Resource type identifier.

page_infoobject

Pagination metadata.

next_page_urlstringnullable

Relative URL that fetches the next page of results.

previous_page_urlstringnullable

Relative URL that fetches the previous page of results.

has_next_pageboolean

Whether more results exist after this page.

has_prev_pageboolean

Whether results exist before this page.

dataarray of entity

Resources in this page.

idstring

Unique identifier for the entity.

objectstringenumValues:entity

Resource type identifier.

typestringenumValues:accountactorentity

The resource kind that this entity references, as an object-type value (e.g. user, account).

Unlike object — which is always entity — this names the underlying resource the id points to.

namestringnullable

Human-readable display name for the entity (e.g. a user's full name, a sales order number).

handlestringnullable

Secondary human-readable identifier (e.g. email address, username, redacted API key value).

errorobjectnullable

Why the row was rejected, in the same shape a synchronous error response carries.

Null unless status is failed.

codestringenumValues:expired_tokenapi_key_expiredapi_key_revoked

A machine-readable code for the error.

typestringenumValues:api_erroridempotency_errorinvalid_request_error

The type of error.

messagestring

A human-readable message providing more details about the error.

paramstringnullable

The parameter that caused the error, if applicable.

doc_urlstringnullable

A URL to documentation about the error.

is_transientboolean

Whether this error is transient and the request can be retried.

quotaobjectnullable

Quota provides plan limit details when the error is limit_exceeded. Nil otherwise.

limitinteger

Limit is the maximum number of resources allowed by the current plan.

usedinteger

Used is the number of resources currently consumed.

reset_atstring (date-time)nullable

ResetAt is the time when the quota resets, if applicable. Nil for static (non-metered) limits.

request_log_urlstringnullable

RequestLogURL is a link to the dashboard page for this request's log entry. Nil when no request log is available.

errorobjectnullable

The failure that sank the job as a whole, in the same shape a synchronous error response carries.

A row rejected on its own merits reports its failure on its own entry in results instead, so this stays null even when some rows failed.

codestringenumValues:expired_tokenapi_key_expiredapi_key_revoked

A machine-readable code for the error.

typestringenumValues:api_erroridempotency_errorinvalid_request_error

The type of error.

messagestring

A human-readable message providing more details about the error.

paramstringnullable

The parameter that caused the error, if applicable.

doc_urlstringnullable

A URL to documentation about the error.

is_transientboolean

Whether this error is transient and the request can be retried.

quotaobjectnullable

Quota provides plan limit details when the error is limit_exceeded. Nil otherwise.

limitinteger

Limit is the maximum number of resources allowed by the current plan.

usedinteger

Used is the number of resources currently consumed.

reset_atstring (date-time)nullable

ResetAt is the time when the quota resets, if applicable. Nil for static (non-metered) limits.

request_log_urlstringnullable

RequestLogURL is a link to the dashboard page for this request's log entry. Nil when no request log is available.

exportjob_exportnullable

Where a completed export job's file can be downloaded.

Null on every other job, and returned only to a caller asking for JSON — otherwise retrieving the job redirects to it.

objectstringenumValues:job_export

Resource type identifier.

urlstring

Presigned link to the file, valid for five minutes.

If the link has expired, read the job again for a fresh one.

started_atstring (date-time)nullable

When the job began executing.

completed_atstring (date-time)nullable

When the job finished processing, whether or not every row succeeded.

failed_atstring (date-time)nullable

When the most recent attempt failed. A retry that succeeds leaves this alongside completed_at.

cancelled_atstring (date-time)nullable

When the job was cancelled.

created_atstring (date-time)

When the job was created.

updated_atstring (date-time)

When the job was last updated.

Responses

202

Successful response for Bulk Upsert Products