arazzo: 1.0.1 info: title: SAP BRIM Charge an Account and Refund It summary: Execute a charge against an account, refund that charge, and confirm the balance. description: >- Executes and then reverses a charge on SAP BRIM Convergent Charging. The workflow charges the account, refunds the charge it just created using the returned charge identifier, and reads the account balance to observe the restored funds. Every step spells out its request inline so the flow can be read and executed without opening the underlying OpenAPI description. version: 1.0.0 sourceDescriptions: - name: convergentChargingApi url: ../openapi/sap-brim-convergent-charging-openapi.yml type: openapi workflows: - workflowId: charge-and-refund summary: Charge an account and refund the resulting charge. description: >- Charges the account, refunds the charge using the returned charge id, and reads the account balance to confirm the refund was applied. inputs: type: object required: - accountId - amountValue - currency - chargeType properties: accountId: type: string description: Identifier of the account to charge and refund. amountValue: type: number description: Amount value to charge. currency: type: string description: ISO 4217 currency code for the charge and refund. chargeType: type: string description: Charging model (PREPAID or POSTPAID). refundReason: type: string description: Optional reason recorded for the refund. steps: - stepId: charge description: Execute a charge against the account. operationId: chargeAccount requestBody: contentType: application/json payload: accountId: $inputs.accountId amount: value: $inputs.amountValue currency: $inputs.currency chargeType: $inputs.chargeType successCriteria: - condition: $statusCode == 200 - context: $response.body condition: $.status == "COMPLETED" type: jsonpath outputs: chargeId: $response.body#/chargeId - stepId: refund description: Refund the charge that was just executed. operationId: refundCharge requestBody: contentType: application/json payload: originalChargeId: $steps.charge.outputs.chargeId amount: value: $inputs.amountValue currency: $inputs.currency reason: $inputs.refundReason successCriteria: - condition: $statusCode == 200 outputs: refundId: $response.body#/refundId refundStatus: $response.body#/status - stepId: getBalance description: Read the account balance to confirm the refund was applied. operationId: getAccountBalance parameters: - name: accountId in: path value: $inputs.accountId successCriteria: - condition: $statusCode == 200 outputs: availableBalance: $response.body#/availableBalance lastUpdated: $response.body#/lastUpdated outputs: chargeId: $steps.charge.outputs.chargeId refundId: $steps.refund.outputs.refundId availableBalance: $steps.getBalance.outputs.availableBalance