{"arazzo":"1.0.1","info":{"title":"Customer Order Lookup","version":"1.0.0","summary":"Find a customer by e-mail in the Customers API, then fetch their orders from the Orders OData service."},"sourceDescriptions":[{"name":"customersApi","url":"https://customers-ord.zazukoians.org/openapi.json","type":"openapi"},{"name":"ordersApi","url":"https://orders-ord.zazukoians.org/odata/v4/orders/openapi.json","type":"openapi"}],"workflows":[{"workflowId":"customerOrdersByEmail","summary":"Orders (with items) of the customer owning the given e-mail address","inputs":{"type":"object","required":["email"],"properties":{"email":{"type":"string","format":"email","examples":["jonas.weber@example.de"]}}},"steps":[{"stepId":"findCustomer","description":"Look the customer up by e-mail.","operationId":"$sourceDescriptions.customersApi.listCustomers","parameters":[{"name":"email","in":"query","value":"$inputs.email"}],"successCriteria":[{"condition":"$statusCode == 200"},{"context":"$response.body","condition":"$.total > 0","type":"jsonpath"}],"outputs":{"customerId":"$response.body#/items/0/id"}},{"stepId":"listOrders","description":"Join: filter the orders on the customer ID found in the previous step.","operationId":"$sourceDescriptions.ordersApi.listOrders","parameters":[{"name":"$filter","in":"query","value":"CustomerID eq '{$steps.findCustomer.outputs.customerId}'"},{"name":"$expand","in":"query","value":"Items"}],"successCriteria":[{"condition":"$statusCode == 200"}],"outputs":{"orders":"$response.body#/value"}}],"outputs":{"customerId":"$steps.findCustomer.outputs.customerId","orders":"$steps.listOrders.outputs.orders"}}]}