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
x-realizes-capability-ids:
- BC-4250.20
- BC-4250.40
x-capability-derivation:
method: 'deterministic join: sourceDescriptions -> per-tag OpenAPI -> tag/capability edge. No classification at this step.'
min_confidence: 0.7
sources:
- capability_id: BC-4250.20
capability_name: Rating & Charging
spec: sap-brim-billing-and-revenue-innovation-management-charging-api-openapi.yml
confidence: 0.88
- capability_id: BC-4250.40
capability_name: Payment Collection & Dunning
spec: sap-brim-billing-and-revenue-innovation-management-balances-api-openapi.yml
confidence: 0.7
model: Turbo EA Capabilities by Vincent Verdet — Turbo EA, https://github.com/vincentmakes/turbo-ea-capabilities, CC BY 4.0
sourceDescriptions:
- name: balancesApi
url: ../openapi/sap-brim-billing-and-revenue-innovation-management-balances-api-openapi.yml
type: openapi
- name: chargingApi
url: ../openapi/sap-brim-billing-and-revenue-innovation-management-charging-api-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: $sourceDescriptions.chargingApi.chargeAccount
requestBody:
contentType: application/json
payload:
accountId: $inputs.accountId
amount:
value: $inputs.amountValue
currency: $inputs.currency
chargeType: $inputs.chargeType
successCriteria:
- condition: $statusCode == 200
- condition: $response.body#/status == 'COMPLETED'
outputs:
chargeId: $response.body#/chargeId
- stepId: refund
description: Refund the charge that was just executed.
operationId: $sourceDescriptions.chargingApi.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: $sourceDescriptions.balancesApi.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
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.