Part type in the API Reference, or open the GraphiQL editor in ION from Developer Platform > GraphQL.
Query parts
The queries below list parts by a filter or get a specific part. List parts with a filter:"isLatestRevision": { "eq": true } to filters.
Get a single part by ID:
Create a part
The part number and revision must be unique. If you supply no revision in the mutation, the part defaults to revision A. Once created, you cannot update the revision of a part. Instead, use thecreatePartRevision mutation to iterate a part’s revision.
Create the part with this mutation:
Update a part
You can update the tracking type to eitherserial or lot only if all existing inventory objects related to the part conform to the new tracking type.
Update the part with this mutation:
Create a part revision
You can generate a revision from any part. For example, if your part “ion-13” has existing revisions A and B, you can generate a third revision C from either revision A or B.What the new revision copies
The new revision starts as a copy of the source part. ThecreatePartRevision input accepts overrides for description, thumbnailId, supplierPartNumber, revisionScheme, and trackingType. Everything else comes from the source part:
- Part fields. All part fields except the ones ION sets itself:
id,parentId,revision,revisedFromId,revisionScheme,entityId, the created and updated timestamps, and the created-by and updated-by users. ION setsrevisedFromIdto the source part’sid. - File attachments. The new revision links to the same file attachments as the source, including link-only attachments. Both revisions share the same attachment records, so there is no second copy of the file.
- Assets, labels, and requirements. Linked to the new revision the same way as file attachments.
- Custom attributes. Copied with their values.
- Part subtypes and planning policy. Copied.
- mBOM. ION creates a new Draft mBOM at version 1 for the new revision. If the source part has an mBOM, ION copies the items from its latest version into it, along with each item’s substitutes and reference designators. The source’s status doesn’t carry over, so a released mBOM on the source becomes a draft on the new revision. See mBOM versions and release.
How the new revision is chosen
You can’t setrevision in createPartRevision. ION chooses it for you:
- Without
revisionScheme, the new revision is the next revision in the part’s scheme after the part number’s latest revision. That is not always the source’s next revision. If revisions A and B exist, B is the latest, and you revise A, the result is C. If the part’s latest revision is Z, the new revision is AA. - With a
revisionSchemethat differs from the part’s current scheme, the new revision is the initial revision of that scheme. See Convert the revision scheme of an existing part. - If the chosen revision already exists for the part number, the mutation fails with
Revision X already exists on part Y. Choose a different revision or scheme.
Set a revision when you create a part
If you setrevision in createPart, ION checks these rules:
- The revision must match the format of the part’s revision scheme. The default scheme is alphabetical, so a revision such as
1fails withRevision 1 for part N is invalid. Must follow set revision format (ALPHABETICAL). - The revision is not required to come after existing revisions. You can create revision C and then revision A of the same part number.
- The part number and revision pair must be unique, and uniqueness ignores case. Creating
awhenAexists fails. - The latest revision is the most recently created one, not the highest. If you create C and then A,
latestRevisionisA, and a revision created from either one isB. A-revision counts as the latest only when it is the part number’s only revision. - Setting a different
revisionSchemeincreatePartRevisionrestarts numbering from the initial revision of the new scheme. InupdatePart, it casts the current revision instead.
Delete a part
Deleting a part cascades to delete the mBOM and mBOM substitutes associated with the part. You cannot delete a part that has existing inventory or that was used within a run. Delete the part with this mutation:Custom part revision scheme
ION lets you define custom schemes for part revisioning. You define these schemes in your organization’s settings. The mutation below creates a new scheme. You first need the ID and etag of the organization before you can update its settings. Four additional variables define a part revision scheme:- name (string): The name of the new revision scheme.
- default (boolean): If
true, all newly created parts inherit this revision scheme. - allowOverflow (boolean): Defines whether ION raises an error when the revision scheme reaches its max iteration, or overflows to the next available value.
- format (array of strings): Defines how the values of a revision scheme appear. The string values in the array can be
NUMERIC,ALPHABETICAL, or single-character-length constants. The format below defines part revisions like00-1or95-7.
Update a part revision scheme
Once a part revision scheme exists in your organization’s settings, you can update it. The only fields you can update on a part revision scheme areallowOverflow and default.
Update the revision scheme with this mutation:
Convert the revision scheme of an existing part
Two strategies change the revision scheme of an existing part. Both set therevisionScheme for a part in either the updatePart or createPartRevision mutation above. Set revisionScheme to the name of one of the schemes in your organization’s settings.
- Setting
revisionSchemein theupdatePartmutation casts the part’s revision. For example, if a part currently has revisionDand you update that part to use the revisionScheme “new scheme” created above, the revision is set to00-4. - Setting
revisionSchemein thecreatePartRevisionmutation resets the part’s revision, starting it over from the initial revision of the new scheme. If a part has revisionDand you update the part’srevisionSchemein thecreatePartRevisionmutation, it is set to00-1.