SAP Sales and Distribution (SD) · Arazzo Workflow

SAP SD Customer Return Intake

Version 1.0.0

Create a customer return referencing an order, read it, and list its items.

1 workflow 1 source API 1 provider
View Spec View on GitHub DistributionERPODataS/4HANASalesSAPArazzoWorkflows

Provider

sap-sales-and-distribution-sd

Workflows

customer-return-intake
Create a customer return and review its items.
Creates a customer return referencing the original sales document, retrieves it, and lists its items.
3 steps inputs: csrfToken, customerReturnType, distributionChannel, material, organizationDivision, referenceSDDocument, requestedQuantity, salesOrganization, sdDocumentReason, soldToParty outputs: customerReturn, items
1
createReturn
createCustomerReturn
Create a customer return with one item referencing the original sales document.
2
getReturn
getCustomerReturn
Read the created customer return back to confirm it persisted.
3
listItems
listCustomerReturnItems
List the customer return items to review the returned lines.

Source API Descriptions

Arazzo Workflow Specification

sap-sales-and-distribution-sd-customer-return-intake-workflow.yml Raw ↑
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-sd-customer-return-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: 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: 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: 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