Start inputs
Order orchestration
Passed by the calling system
Headless & Integration package
A synchronous order endpoint for your storefront: validate, price, fraud-screen, reserve stock, authorise payment and create the shipment in one call.
About this package
Order orchestration API turns one storefront call into a complete, ordered set of back-office steps. The storefront posts the order (order id, customer, email, lines with sku, quantity and price, the shipping address and a payment token reference from your payment provider) and waits for the answer: the workflow runs as middleware and its response is the result.
The workflow rejects incomplete orders straight away, then totals the lines and adds shipping and tax. The Fraud screening decision table looks at the order value, shipping country, whether the customer is new and whether billing and shipping countries differ, and returns accept, review or reject with a risk score. Accepted orders reserve stock in the inventory API, authorise the payment and create the shipment in the fulfilment API. If the payment is declined the reservation is released.
Orders flagged for review are still accepted, but the shipment is created on hold and a Manual fraud review runs in the background: a reviewer releases the shipment or cancels the order, voiding the authorisation and releasing the stock. The caller always gets result, order_status, reason, reservation_id, authorization_id, shipment_id and estimated_delivery. Card data never passes through the workflow.
Called synchronously: the caller waits and receives the workflow's final variables as the response.
Another system starts it over REST or an inbound webhook. No UI is needed; people only appear where a decision needs a human.
The flow
Order posted
The storefront posts the order, customer, lines, shipping address and a payment token reference, and waits for the response.
Validate and price
Missing ids, token or lines are rejected with a 400. Line totals, shipping and tax give the order total.
Screen for fraud
The Fraud screening decision table returns accept, review or reject and a risk score; rejected orders get a 422.
Reserve and authorise
Stock is reserved and the payment authorised. A declined payment releases the reservation and returns a 402.
Create the shipment
The shipment is created, on hold if the order needs review, and the caller gets the ids and estimated delivery.
Review in the background
Flagged orders start Manual fraud review: a reviewer releases the shipment or cancels, voiding the payment and stock.
Forms
The inputs a caller passes when it starts a run, and the forms people complete when the process needs a decision.
Start inputs
Passed by the calling system
User Task · Manual fraud review
Fraud review: order {{order_id}} · {{currency}} {{order_total}} · score {{risk_score}}
Headless
Every workflow can be started over REST, MCP or the CLI, whatever its trigger, with the sample input below. Runs start straight away on the published version; replace <workflow id> with the id the install created.
REST
curl -X POST "$USERTASKS_URL/api/v1/workflows/start" \
-H "Authorization: Bearer $USERTASKS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"workflow_id":"<workflow id>","variables":{"order_id":"SO-100482","customer_id":"C-20931","email":"jamie.fox@example.com","currency":"NZD","lines":[{"sku":"MUG-BLK-350","qty":2,"price":24.5},{"sku":"TEE-ORG-M","qty":1,"price":39},{"sku":"BAG-CNV-01","qty":1,"price":49}],"shipping_address":{"name":"Jamie Fox","line1":"12 Example Street","city":"Wellington","postcode":"6011","country":"NZ"},"billing_country":"NZ","new_customer":false,"payment_method_ref":"pm_ref_example_4f9a21"}}'CLI
usertasks workflows inputs <workflow id> # the start form: keys, types, required
usertasks workflows run <workflow id> --input order_id=SO-100482 --input customer_id=C-20931 --input email=jamie.fox@example.com --input currency=NZD … --waitInbound webhook (synchronous: the response is the workflow result)
usertasks webhooks create <workflow id> # prints the hook slug and secret once
curl -X POST "$USERTASKS_URL/api/webhooks/inbound?hook=<slug>" \
-H "Authorization: Bearer <webhook secret>" -H "Content-Type: application/json" \
-d '{"order_id":"SO-100482","customer_id":"C-20931","email":"jamie.fox@example.com","currency":"NZD","lines":[{"sku":"MUG-BLK-350","qty":2,"price":24.5},{"sku":"TEE-ORG-M","qty":1,"price":39},{"sku":"BAG-CNV-01","qty":1,"price":49}],"shipping_address":{"name":"Jamie Fox","line1":"12 Example Street","city":"Wellington","postcode":"6011","country":"NZ"},"billing_country":"NZ","new_customer":false,"payment_method_ref":"pm_ref_example_4f9a21"}'What's included
| Type | Name | Details |
|---|---|---|
| Integration | Fulfilment API | |
| Integration | Inventory API | |
| Integration | Payments API | |
| API reference | Authorise payment | POST /payments/authorize — Authorise (not capture) the order total against the tokenised payment method from the storefront. |
| API reference | Create shipment | POST /shipments — Create the shipment for the reserved stock, optionally on hold until a fraud review releases it. |
| API reference | Release reservation | POST /reservations/{{reservation_id}}/release — Release a stock reservation when the order does not go ahead. |
| API reference | Reserve stock | POST /reservations — Reserve stock for every order line; the reservation expires if the order is not confirmed. |
| API reference | Update shipment | PATCH /shipments/{{shipment_id}} — Release a held shipment for picking, or cancel it. |
| API reference | Void authorisation | POST /payments/authorizations/{{authorization_id}}/void — Void a payment authorisation so the customer is not charged. |
| Decision table | Fraud screening | 6 rules — Accept, review or reject an order from its value, shipping country, customer history and address match. First matching rule wins; NZ is the home market in the sample rules. |
| Workflow | Manual fraud review | 10 steps — Runs in the background for orders the fraud rules flag for review: a reviewer releases the held shipment or cancels the order (voiding the payment authorisation and the shipment). |
| Workflow | Order orchestration | 48 steps — Synchronous order API for a storefront: validates the order, prices it, screens it for fraud, reserves stock, authorises payment and creates the shipment, then answers the caller with the ids and delivery estimate. |
Requirements
Credentials never travel in a package. The install wizard asks for what your environment must provide, or installs it incomplete until you finish setup.
Integration “Fulfilment API”Required
Integration “Inventory API”Required
Integration “Payments API”Required
Workflow “Manual fraud review” assigneesRequired
Install
Works on UserTasks cloud and on any self-hosted instance. Installing creates the assets above; nothing runs until you complete setup and start it.
curl -fLO https://usertasks.com/gallery/order-orchestration-api-1.0.0.utpkg
usertasks packages inspect order-orchestration-api-1.0.0.utpkg # offline: checksum, hashes, signature
usertasks packages install order-orchestration-api-1.0.0.utpkg --dry-run
usertasks packages install order-orchestration-api-1.0.0.utpkg # prompts for each requirement
usertasks packages install order-orchestration-api-1.0.0.utpkg --keep-incomplete --yes # in CI; finish with:
usertasks packages complete order-orchestration-api -f values.yamlVerify the download
shasum -a 256 order-orchestration-api-1.0.0.utpkg should print the file SHA-256. How gallery packages are signed.
Versions
Installing a newer version upgrades in place: local credentials and requirement values are kept, and changes you made are flagged first. How packages work
More packages
Headless & Integration
An AI agent classifies each helpdesk ticket and drafts a reply; confident, low-risk answers go out automatically and the rest wait for a person.
Needs:AI modelREST APIAssigneesInbound webhook
Headless & Integration
Turn contract data from any app into a filled Word contract and Excel fee schedule, file both in your DMS and send the contract for e-signature.
Needs:REST APIDocument templatesInbound webhook
Headless & Integration
A CRM "account updated" webhook is validated and fanned out to the ERP, billing platform and support desk, with every result written to a sync log.
Needs:REST APIInbound webhook