Skip to main content

Bulk create/update cross-upsell relations

POST 

/v2/cross-upsells/bulk

Processes an array of cross-upsell relations in a single call.

Each relation is matched against existing records using its composite natural key (baseProductUuidFrom + baseProductUuidTo + type).

Referencing products / clusters

Each side supplies exactly one reference: productFrom or clusterFrom (and productTo or clusterTo). Declaring product vs cluster explicitly keeps source resolution unambiguous. Within each reference, provide exactly one of:

  • id — legacy numeric id.
  • uuid — global UUID.
  • source — external { name, id } pair, for callers (e.g. REST imports) that only hold external identifiers. Resolved against the matching entity type (product vs cluster).

Supplying both sides' entity types, or more than one identifier within a reference, is rejected as a per-item error.

Actions per item:

  • create — relation does not exist yet; it is inserted.
  • update — relation exists and subType changed; only subType is mutable.
  • skip — relation exists and nothing changed.
  • error — invalid input (entity not found, missing/multiple references, intra-payload duplicate).

Errors are reported per item — a bad item never fails the rest of the batch.

resetOnUpdate directive

Include { "operation": "resetOnUpdate" } in directives to replace the full relation-set for every source entity that appears in the payload. After the upsert pass, any existing relation whose "from" entity is in the payload but whose relation is not in the payload is deleted. Entities that do not appear in the payload are untouched.

Request

Responses

Bulk operation result