arazzo: 1.0.1 info: title: SAP SD Contract Release Order summary: Create a sales contract, read it, list its items, then release a sales order from it. description: >- Models releasing a call-off order against a sales contract in SAP Sales and Distribution. The workflow creates a sales contract with a deep-inserted item, reads it back, lists its items, and then creates a sales order carrying the contract's sold-to party and material forward as a release order. Each step inlines its OData request so the flow reads and runs without opening the underlying OpenAPI descriptions. Both modifying POSTs require an X-CSRF-Token header supplied as a workflow input. Adaptation note: the SalesOrderItem create schema exposes no contract-reference field, so the release is modeled by carrying the contract's sold-to party and material forward rather than by an OData contract reference. version: 1.0.0 sourceDescriptions: - name: salesContractApi url: ../openapi/sap-sd-sales-contract-openapi.yml type: openapi - name: salesOrderApi url: ../openapi/sap-sd-sales-order-openapi.yml type: openapi workflows: - workflowId: contract-release-order summary: Create a sales contract and release a sales order from it. description: >- Creates a sales contract, retrieves it, lists its items, and creates a sales order that carries the contract's sold-to party and material forward. inputs: type: object required: - csrfToken - salesContractType - salesOrderType - salesOrganization - soldToParty - material - requestedQuantity properties: csrfToken: type: string description: X-CSRF-Token fetched from the OData service for write operations. salesContractType: type: string description: Sales contract document type (e.g. CQ / WK1). salesOrderType: type: string description: Sales order document type for the release order (e.g. OR). salesOrganization: type: string description: Sales organization. distributionChannel: type: string description: Distribution channel. organizationDivision: type: string description: Division. soldToParty: type: string description: Sold-to party customer number. material: type: string description: Material covered by the contract and the release order. requestedQuantity: type: string description: Quantity to release on the order. steps: - stepId: createContract description: >- Create a sales contract header with one deep-inserted item for the sold-to party. operationId: createSalesContract parameters: - name: X-CSRF-Token in: header value: $inputs.csrfToken requestBody: contentType: application/json payload: SalesContractType: $inputs.salesContractType SalesOrganization: $inputs.salesOrganization DistributionChannel: $inputs.distributionChannel OrganizationDivision: $inputs.organizationDivision SoldToParty: $inputs.soldToParty to_Item: results: - Material: $inputs.material RequestedQuantity: $inputs.requestedQuantity successCriteria: - condition: $statusCode == 201 outputs: salesContract: $response.body#/d/SalesContract - stepId: getContract description: Read the created contract back to capture its sold-to party. operationId: getSalesContract parameters: - name: SalesContract in: path value: $steps.createContract.outputs.salesContract successCriteria: - condition: $statusCode == 200 outputs: salesContract: $response.body#/d/SalesContract soldToParty: $response.body#/d/SoldToParty - stepId: listContractItems description: List the contract items to confirm the covered lines before release. operationId: listSalesContractItems parameters: - name: SalesContract in: path value: $steps.getContract.outputs.salesContract successCriteria: - condition: $statusCode == 200 outputs: items: $response.body#/d/results - stepId: createReleaseOrder description: >- Create a sales order that carries the contract's sold-to party and material forward as a release order. operationId: createSalesOrder parameters: - name: X-CSRF-Token in: header value: $inputs.csrfToken requestBody: contentType: application/json payload: SalesOrderType: $inputs.salesOrderType SalesOrganization: $inputs.salesOrganization DistributionChannel: $inputs.distributionChannel OrganizationDivision: $inputs.organizationDivision SoldToParty: $steps.getContract.outputs.soldToParty to_Item: results: - Material: $inputs.material RequestedQuantity: $inputs.requestedQuantity successCriteria: - condition: $statusCode == 201 outputs: salesOrder: $response.body#/d/SalesOrder outputs: salesContract: $steps.getContract.outputs.salesContract salesOrder: $steps.createReleaseOrder.outputs.salesOrder