openapi: 3.0.3 info: title: SAP BRIM ( and Revenue Innovation Management) SAP BRIM Convergent Charging Balances Billing API description: API for real-time charging and rating of usage-based services within the SAP BRIM (Billing and Revenue Innovation Management) suite. Supports complex pricing models, prepaid and postpaid scenarios, tiered and volume-based pricing, and real-time balance management. version: 1.0.0 contact: name: SAP Support email: support@sap.com url: https://support.sap.com license: name: SAP Developer License url: https://www.sap.com/about/legal/terms-of-use.html termsOfService: https://www.sap.com/about/legal/terms-of-use.html servers: - url: https://api.sap.com/convergent-charging/v1 description: SAP API Business Hub - Production - url: https://sandbox.api.sap.com/convergent-charging/v1 description: SAP API Business Hub - Sandbox security: - OAuth2: - read - write - ApiKeyAuth: [] tags: - name: Billing description: Billing cycle and invoice generation operations paths: /subscriptions/{subscriptionId}/billing-history: get: operationId: getSubscriptionBillingHistory summary: SAP BRIM (Billing and Revenue Innovation Management) Get subscription billing history description: Retrieves the billing history for a subscription, including all generated invoices and payment records. tags: - Billing parameters: - $ref: '#/components/parameters/SubscriptionId' - $ref: '#/components/parameters/Offset' - $ref: '#/components/parameters/Limit' responses: '200': description: Billing history content: application/json: schema: type: object properties: results: type: array items: $ref: '#/components/schemas/BillingRecord' totalCount: type: integer offset: type: integer limit: type: integer '401': $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/InternalServerError' /subscriptions/{subscriptionId}/generate-invoice: post: operationId: generateInvoice summary: SAP BRIM (Billing and Revenue Innovation Management) Generate an invoice for a subscription description: Manually triggers invoice generation for a subscription outside of the normal billing cycle. Useful for ad-hoc or on-demand billing. tags: - Billing parameters: - $ref: '#/components/parameters/SubscriptionId' requestBody: required: false content: application/json: schema: type: object properties: billingPeriodStart: type: string format: date billingPeriodEnd: type: string format: date includeUsageCharges: type: boolean default: true responses: '201': description: Invoice generated content: application/json: schema: $ref: '#/components/schemas/BillingRecord' '400': $ref: '#/components/responses/BadRequest' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/InternalServerError' components: parameters: Limit: name: limit in: query description: Maximum number of items to return schema: type: integer default: 20 minimum: 1 maximum: 100 SubscriptionId: name: subscriptionId in: path required: true description: Unique identifier of the subscription schema: type: string format: uuid Offset: name: offset in: query description: Number of items to skip for pagination schema: type: integer default: 0 minimum: 0 responses: BadRequest: description: Invalid request parameters content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' Unauthorized: description: Authentication required or invalid credentials content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' InternalServerError: description: Internal server error content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' NotFound: description: Resource not found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' schemas: BillingRecord: type: object properties: billingRecordId: type: string format: uuid subscriptionId: type: string format: uuid invoiceNumber: type: string billingPeriodStart: type: string format: date billingPeriodEnd: type: string format: date subtotal: $ref: '#/components/schemas/MonetaryAmount' tax: $ref: '#/components/schemas/MonetaryAmount' total: $ref: '#/components/schemas/MonetaryAmount' status: type: string enum: - DRAFT - ISSUED - PAID - OVERDUE - VOID issuedAt: type: string format: date-time dueDate: type: string format: date paidAt: type: string format: date-time lineItems: type: array items: type: object properties: description: type: string quantity: type: number unitPrice: $ref: '#/components/schemas/MonetaryAmount' amount: $ref: '#/components/schemas/MonetaryAmount' ErrorResponse: type: object properties: error: type: object properties: code: type: string message: type: string target: type: string details: type: array items: type: object properties: code: type: string message: type: string MonetaryAmount: type: object required: - value - currency properties: value: type: number format: double currency: type: string pattern: ^[A-Z]{3}$ description: ISO 4217 currency code securitySchemes: OAuth2: type: oauth2 flows: clientCredentials: tokenUrl: https://auth.sap.com/oauth/token scopes: read: Read access to charging and rating resources write: Write access to charging and rating resources ApiKeyAuth: type: apiKey in: header name: APIKey