External References
externalReference is a feature designed to link an object to an ID from an external system.
This can be particularly useful when incorporating Saleor with other services.
For example, suppose we aim to synchronize Saleor with a CMS. If a product is introduced in Saleor, we would also want to generate a corresponding product in the CMS.
Upon creation of a product in the CMS, an ID is assigned. This ID can then be used to update the externalReference of the product in Saleor:
mutation {
productUpdate(externalReference: "CMS_ID", input: { name: "New name" }) {
errors {
field
message
}
}
}
externalReference is available in the following types:
- Order - starting from version 3.19, the MANAGE_ORDERS permission is required to use
externalReferencewith order query. - Product
- ProductVariant
- Attribute
- AttributeValue
- Warehouse
- User
note
The externalReference value must be unique across a single type. The maximum length is 250 characters.