Transformations
Transformations are JavaScript functions that modify order or shipment data at specific trigger points in the processing pipeline. They allow you to normalize, enrich, or reshape data as it flows between bridges.
List Transformations
/api/transformationsList all transformations for the organization.
Returns a paginated list of transformations with their trigger points and status.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
page | number | Page number (default: 1) |
limit | number | Items per page (default: 20, max: 100) |
trigger_point | string | Filter by trigger point |
bridge_id | string | Filter by associated bridge |
curl -X GET "https://api.orderly.dev/api/transformations" \
-H "Authorization: Bearer ord_sk_..."Response
{
"data": [
{
"id": "uuid",
"name": "Normalize Shopify Addresses",
"trigger_point": "after_sync",
"bridge_id": "uuid",
"code": "function transform(order) { ... }",
"enabled": true,
"created_at": "2026-01-01T00:00:00Z"
}
],
"pagination": { "page": 1, "limit": 20, "total": 3, "totalPages": 1, "hasMore": false }
}Create Transformation
/api/transformationsCreate a new transformation.
Creates a new transformation. The code field should contain a JavaScript function that accepts and returns the data object.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Display name |
trigger_point | string | Yes | When to run: before_sync, after_sync, before_operation, after_operation |
bridge_id | string | No | Limit to a specific bridge |
code | string | Yes | JavaScript transformation function |
enabled | boolean | No | Whether the transformation is active (default: true) |
curl -X POST "https://api.orderly.dev/api/transformations" \
-H "Authorization: Bearer ord_sk_..." \
-H "Content-Type: application/json" \
-d '{
"name": "Add shipping tier tag",
"trigger_point": "after_sync",
"code": "function transform(order) { if (order.total > 100) { order.tags.push(\"free-shipping\"); } return order; }",
"enabled": true
}'Update Transformation
/api/transformations/:idUpdate a transformation's code, trigger point, or status.
Updates a transformation. Changes take effect immediately for subsequent data processing.
curl -X PATCH "https://api.orderly.dev/api/transformations/550e8400-e29b-41d4-a716-446655440000" \
-H "Authorization: Bearer ord_sk_..." \
-H "Content-Type: application/json" \
-d '{"enabled": false}'Delete Transformation
/api/transformations/:idDelete a transformation.
Permanently deletes a transformation.
curl -X DELETE "https://api.orderly.dev/api/transformations/550e8400-e29b-41d4-a716-446655440000" \
-H "Authorization: Bearer ord_sk_..."Test Transformation
/api/transformations/testTest a transformation against sample data without saving.
Runs a transformation function against sample input data and returns the result. Useful for developing and debugging transformations before deploying them.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
code | string | Yes | JavaScript transformation function to test |
input | object | Yes | Sample data to transform |
curl -X POST "https://api.orderly.dev/api/transformations/test" \
-H "Authorization: Bearer ord_sk_..." \
-H "Content-Type: application/json" \
-d '{
"code": "function transform(order) { order.tags.push(\"tested\"); return order; }",
"input": { "order_number": "1001", "total": 49.99, "tags": [] }
}'Response
{
"data": {
"success": true,
"output": { "order_number": "1001", "total": 49.99, "tags": ["tested"] },
"duration_ms": 3
}
}