External Systems
With the API, you can store and manage external system IDs for a brand's order, product, and customer records. This section describes popular use cases.
External system IDs are stored using the external_ids
field, an array of key-value pairs. Keys are managed by LeafLink and must be requested via support@leaflink.com. Values can be up to 36 characters long.
Update external ID of record
By default, order, product, and customer records will not include an external ID. Each record will include an empty array of "external_ids": {}
. External IDs can be added to records within a POST or PATCH API call.
The following request updates the external ID for a product.
/**
PATCH /api/v2/products/303113/
Host: sandbox.leaflink.com
Authorization: App 54901b614b81d25084edc7b1f2016571b96778910d7b8b0befgf8decd418d6ab
Content-Type: application/json
*/
{
"external_ids": { "foo": "bar"}
}
Delete external ID of record
External IDs can be deleted from a record by updating the value with a null
value.
The following request removes the external ID from a product.
/**
PATCH /api/v2/products/303113/
Host: sandbox.leaflink.com
Authorization: App 54901b614b81d25084edc7b1f2016571b96778910d7b8b0befgf8decd418d6ab
Content-Type: application/json
*/
{
"external_ids": { "foo": null}
}
List records using external ID
External IDs can be used as a query parameter to filter a list of records.
The following request lists the product containing a specific external ID.
GET /api/v2/products/?external_id_key=foo&external_id_values=bar
Host: sandbox.leaflink.com
Authorization: App 54901b614b81d25084edc7b1f2016571b96778910d7b8b0befgf8decd418d6ab
Content-Type: application/json