Skip to main content

machineUpsert

Create or update a spare parts machine.

Creates a new machine if it doesn't exist, or updates an existing machine based on external reference matching. Supports partial updates and maintains data integrity across operations.

Slugs: a machine that does not exist yet is created with the same slug rules as machineCreate. For an existing machine, a supplied slug replaces the stored one in its language, and the stored slugs of languages that are not in the payload's name are kept. For each language in the payload's name without a supplied slug, useStandardSlugs on the top-level input decides: when true, the slug is always regenerated with the product algorithm ("Pump (A)" generates "pump-a"), even if the name did not change, so a custom slug must be sent again to be kept; when false or omitted, the stored slug is kept unless the name changed to one that generates a different slug than the old name, and only then regenerated with the legacy algorithm ("Pump (A)" generates "pump-(a)"). A supplied slug must contain only lowercase letters, digits and single hyphens, or be a legacy slug as this service generates it, otherwise the request fails validation and nothing is written. Slugs are not unique, and keeping them unique is the caller's responsibility.

Possible errors:

  • SPARE_PARTS_EXTERNAL_REFERENCE_KEY_ALREADY_EXISTS_ERROR: External reference conflicts with existing machine
  • SPARE_PARTS_EXTERNAL_REFERENCE_KEY_DUPLICATES_FOUND_ERROR: Duplicate external references found in the payload
  • SPARE_PARTS_EXTERNAL_REFERENCE_CREATE_ERROR: Failed to create or update external reference
  • SPARE_PARTS_UNKNOWN_ERROR: Unexpected error during machine upsert operation

AUTH: Role=[product.OWNER,product.EDITOR]

machineUpsert(
input: UpsertSparePartsMachineInput!
): SparePartsMachine!

Arguments​

machineUpsert.input ● UpsertSparePartsMachineInput! non-null input​

Machine upsert data.

Complete specification for creating or updating the machine including external references, localized content, spare parts, and hierarchical relationships.

Type​

SparePartsMachine object​

Represents a machine that contains spare parts and can have hierarchical sub-machines.

Core entity for organizing spare parts catalogs with support for nested machine structures, localized content, and external system integration.