External IDs
External IDs (XIDs) are a powerful feature of the Jungle System that allow you to use your own identifiers for products, locations, and other objects. This can be particularly useful if you have existing systems or processes that rely on specific identifiers.
XIDs are unique identifiers that can be associated with any object in the Jungle System. They can be used to link objects in Jungle with objects in your own systems, making it easier to integrate Jungle into your existing workflows.
Benefits of Using XIDs
- Flexibility: You can use any identifier that makes sense for your business, whether it's a SKU, barcode, PK or any other unique identifier.
- Consistency: By using XIDs, you can ensure that your identifiers are consistent across different systems and processes.
- Integration: XIDs simplify integrating Jungle with your existing systems by using your own identifiers.
Adding XIDs
To use XIDs in Jungle, you can follow these steps:
- Assign an XID: You can create an XID for any object in Jungle using the
xidAssign
mutation. This mutation takes the object and the XID value as input.
mutation {
xidAssign(input: { objectId: "your_object_id", xid: "xid:jungle/Product:acme/product/bomb" }) {
ok
}
}
Querying XIDs
XID conflicts
When assigning XIDs, it's important to ensure that they are unique within the context of the object type. If you try to assign an XID that already exists for a different object, you will receive an error.
You can reference objects using your own identifiers in Jungle.
External IDs allow you to identity objects in Jungle with IDs in your own, or other 3rd party systems.
Creating External IDs
External IDs are a pair of the name of the identity, and the value that represents the ID.
For example, you could have a storefrontOrder
ID and a fraud-analysis
ID referencing the same Jungle object.
mutation exampleExternalID {
externalIdAssign(input: { object: { id: "0x123" }, xid: "storeFrontOrder/300001" }) {
__typename
ok
... on MutationSuccess {
objects {
id
typename
}
}
... on MutationFailure {
code
reason
}
}
}
Uniqueness
External IDs are only considered unique with in the scope of an account. External ID values can only be used once for a external ID name.
🤖: External IDs are themselves objects in Jungle, and therefore benefit from our global features.
Using External IDs
query exampleObjectXID{
object(input: {
id: "storeFrontOrder/300001"
}) {
... on Order {
id
}
}
}
Introduction
Jungle platform concepts
Barcodes
Learn about Barcodes are core concept of the Jungle System