arazzo: 1.0.1
info:
title: SAP SD Customer Return Intake
summary: Create a customer return referencing an order, read it, and list its items.
description: >-
Records a customer return in SAP Sales and Distribution. The workflow
creates a customer return whose item references the original sales document,
reads the return back to confirm it persisted, and lists its items so the
returned lines can be reviewed before downstream returns delivery handling.
Each step inlines its OData request so the flow reads and runs without
opening the underlying OpenAPI descriptions. The return creation POST
requires an X-CSRF-Token header supplied as a workflow input.
version: 1.0.0
sourceDescriptions:
- name: customerReturnApi
url: ../openapi/sap-sales-and-distribution-sd-customer-return-api-openapi.yml
type: openapi
- name: customerReturnItemApi
url: ../openapi/sap-sales-and-distribution-sd-customer-return-item-api-openapi.yml
type: openapi
workflows:
- workflowId: customer-return-intake
summary: Create a customer return and review its items.
description: >-
Creates a customer return referencing the original sales document,
retrieves it, and lists its items.
inputs:
type: object
required:
- csrfToken
- salesOrganization
- soldToParty
- material
- requestedQuantity
- referenceSDDocument
properties:
csrfToken:
type: string
description: X-CSRF-Token fetched from the OData service for write operations.
customerReturnType:
type: string
description: Customer return document type (e.g. RE).
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 returning the goods.
sdDocumentReason:
type: string
description: Order reason / reason for the return.
material:
type: string
description: Material being returned.
requestedQuantity:
type: string
description: Quantity being returned.
referenceSDDocument:
type: string
description: Original sales document number the return references.
steps:
- stepId: createReturn
description: >-
Create a customer return with one item referencing the original sales
document.
operationId: $sourceDescriptions.customerReturnApi.createCustomerReturn
parameters:
- name: X-CSRF-Token
in: header
value: $inputs.csrfToken
requestBody:
contentType: application/json
payload:
CustomerReturnType: $inputs.customerReturnType
SalesOrganization: $inputs.salesOrganization
DistributionChannel: $inputs.distributionChannel
OrganizationDivision: $inputs.organizationDivision
SoldToParty: $inputs.soldToParty
SDDocumentReason: $inputs.sdDocumentReason
to_Item:
results:
- Material: $inputs.material
RequestedQuantity: $inputs.requestedQuantity
ReferenceSDDocument: $inputs.referenceSDDocument
successCriteria:
- condition: $statusCode == 201
outputs:
customerReturn: $response.body#/d/CustomerReturn
- stepId: getReturn
description: Read the created customer return back to confirm it persisted.
operationId: $sourceDescriptions.customerReturnApi.getCustomerReturn
parameters:
- name: CustomerReturn
in: path
value: $steps.createReturn.outputs.customerReturn
successCriteria:
- condition: $statusCode == 200
outputs:
customerReturn: $response.body#/d/CustomerReturn
- stepId: listItems
description: List the customer return items to review the returned lines.
operationId: $sourceDescriptions.customerReturnItemApi.listCustomerReturnItems
parameters:
- name: CustomerReturn
in: path
value: $steps.getReturn.outputs.customerReturn
successCriteria:
- condition: $statusCode == 200
outputs:
items: $response.body#/d/results
outputs:
customerReturn: $steps.getReturn.outputs.customerReturn
items: $steps.listItems.outputs.items
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. By signing up you are subscribing to the APIs.io and API Evangelist
newsletters — you can unsubscribe from any issue. See our
Privacy Policy and Terms.