API
Links
Match orders across sources before Yuzu merges them.
Links
Links define how Yuzu should match records from one source to records from another source. For API integrations, the most common use case is order linking: matching an order created from one system to the same order created by another system.
List links
GET https://app.yuzu.so/api/links
Query parameters:
| Parameter | Type | Description |
|---|---|---|
source | string | Optional. Filter by source app UUID, manual source (api, web, or csv), or custom source key. |
target | string | Optional. Filter by target app UUID, manual source, or custom source key. |
curl 'https://app.yuzu.so/api/links?source=api' \
--header 'X-API-Key: YOUR_API_KEY'
Create a link
POST https://app.yuzu.so/api/links
| Field | Type | Description |
|---|---|---|
type | string | Required. order, product, or customer. |
source | object | Required. Source point that triggers the link. |
target | object | Required. Target point to resolve against. |
resolver | string | Required. JavaScript expression that returns the target source ID. |
condition | string | Optional. JavaScript expression that must return true before the resolver runs. |
Source and target points:
| Shape | Description |
|---|---|
{ "type": "app", "app": "a2cb2c3d-4e5f-6g7h-8i9j-0k1l2m3n4o5p" } | An installed app. |
{ "type": "manual", "source": "api" } | A manual source. Valid values are api, web, and csv. |
{ "type": "custom", "key": "warehouse-east" } | A custom source key. |
Example:
curl --request POST 'https://app.yuzu.so/api/links' \
--header 'Content-Type: application/json' \
--header 'X-API-Key: YOUR_API_KEY' \
--data '{
"type": "order",
"source": {
"type": "custom",
"key": "warehouse-east"
},
"target": {
"type": "manual",
"source": "api"
},
"resolver": "order.variables.externalOrderId",
"condition": "order.variables && order.variables.externalOrderId"
}'
When an order is created from warehouse-east, Yuzu evaluates the resolver against the incoming payload. If it returns 10000000000001, Yuzu also looks for the target key:
org_exampleTeam123456789/api-10000000000001
If that key already exists, Yuzu merges the incoming source map into the existing order. The resulting order can then be found or printed by either key.
Update a link
PUT https://app.yuzu.so/api/links/{linkId}
Send only the fields you want to change.
curl --request PUT 'https://app.yuzu.so/api/links/33333333-3333-4333-8333-333333333333' \
--header 'Content-Type: application/json' \
--header 'X-API-Key: YOUR_API_KEY' \
--data '{
"resolver": "order.variables.shopifyOrderId"
}'
Delete a link
DELETE https://app.yuzu.so/api/links/{linkId}
curl --request DELETE 'https://app.yuzu.so/api/links/33333333-3333-4333-8333-333333333333' \
--header 'X-API-Key: YOUR_API_KEY'
Successful deletes return:
{
"success": true,
"id": "33333333-3333-4333-8333-333333333333"
}
Common status codes:
| Status | Meaning |
|---|---|
200 | Request processed. |
400 | Invalid request body or resolver shape. |
401 | Missing, malformed, or invalid API key. |
403 | API key cannot access the requested team resource. |
5xx | Temporary service issue. Retry with backoff. |