arazzo: 1.0.1 info: title: SAP BRIM Renew a Subscription and Invoice the New Term summary: Manually renew a subscription, invoice the renewed term, and read the billing history. description: >- Drives a manual renewal cycle on SAP BRIM Subscription Billing. The workflow triggers a renewal for the subscription, generates an invoice for the newly renewed term, and then reads the subscription billing history to confirm the new invoice is present. 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: subscriptionBillingApi url: ../openapi/sap-brim-subscription-billing-openapi.yml type: openapi workflows: - workflowId: manual-renewal-invoice summary: Renew a subscription, invoice the term, and read back the billing history. description: >- Manually renews a subscription, generates an invoice for the renewed period, and retrieves the billing history so the new invoice can be verified. inputs: type: object required: - subscriptionId properties: subscriptionId: type: string description: Identifier of the subscription to renew and invoice. renewalTerm: type: integer description: Number of billing periods for the renewal. renewalPlanId: type: string description: Optional new plan to apply for the renewal period. billingPeriodStart: type: string description: Optional invoice period start (YYYY-MM-DD). billingPeriodEnd: type: string description: Optional invoice period end (YYYY-MM-DD). steps: - stepId: renewSubscription description: Manually trigger the renewal of the subscription. operationId: renewSubscription parameters: - name: subscriptionId in: path value: $inputs.subscriptionId requestBody: contentType: application/json payload: renewalTerm: $inputs.renewalTerm renewalPlanId: $inputs.renewalPlanId successCriteria: - condition: $statusCode == 200 outputs: status: $response.body#/status renewalCount: $response.body#/renewalCount currentPeriodEnd: $response.body#/currentPeriodEnd - stepId: generateInvoice description: Generate an invoice covering the renewed billing term. operationId: generateInvoice parameters: - name: subscriptionId in: path value: $inputs.subscriptionId requestBody: contentType: application/json payload: billingPeriodStart: $inputs.billingPeriodStart billingPeriodEnd: $inputs.billingPeriodEnd includeUsageCharges: true successCriteria: - condition: $statusCode == 201 outputs: billingRecordId: $response.body#/billingRecordId invoiceNumber: $response.body#/invoiceNumber total: $response.body#/total - stepId: getBillingHistory description: Read the subscription billing history to confirm the new invoice exists. operationId: getSubscriptionBillingHistory parameters: - name: subscriptionId in: path value: $inputs.subscriptionId - name: limit in: query value: 5 successCriteria: - condition: $statusCode == 200 outputs: records: $response.body#/results totalCount: $response.body#/totalCount outputs: renewalCount: $steps.renewSubscription.outputs.renewalCount billingRecordId: $steps.generateInvoice.outputs.billingRecordId invoiceNumber: $steps.generateInvoice.outputs.invoiceNumber billingHistory: $steps.getBillingHistory.outputs.records