Symptom
A subscription is created via the subscription API with the parameter "allowMidBillCycleExpiration" set to true, but the value is not validated correctly. as a result, the subscription is created with "allowMidBillCycleExpiration" set to false, preventing mid-billing cycle cancellation.
Environment
SAP S/4HANA Cloud Public Edition
Reproducing the Issue
- Use the Subscription API to create a subscription.
- Include the "allowMidBillCycleExpiration" field in the POST payload and set its value to true.
- Observe that the subscription is created with "allowMidBillCycleExpiration" disabled.
Cause
By default, the "allowMidBillCycleExpiration" field is part of the cancellation policy and is retrieved from the associated product even when a subscription creation request sets "allowMidBillCycleExpiration" to true, it's ignored because the values default to the product settings.
Resolution
- In the POST payload when creating a subscription , include the "overwriteContractTerm" field and set its value to true.
- Ensure that "allowMidBillCycleExpiration" is set to true in the same payload.
By setting "overwriteContractTerm" to true, the system is explicitly instructed to use the values in the payload for the cancellation policy, overriding the default settings from the product.
See Also
- For reference: Subscription APIs - POST /subscriptions .
- Refer to the API documentation for additional information on the "overwriteContractTerm" field: Indicates whether all the attributes of the minimum contract term, renewal term, cancellation policy and fixed term should be overwritten by the payload data. If set to false, the values are determined from the product.
Keywords
subscription billing , Subscription APIs - POST /subscriptions, api, allowMidBillCycleExpiration, cancellation policy, overwriteContractTerm, subscription creation, mid-bill cycle cancellation, subscription billing, api validation, subscription management, billing cycle, api payload, sap business accelerator hub, subscription settings, api documentation, sap subscription billing, SAP S/4HANA Cloud Public Edition , KBA , CEC-SAL-SB , Subscription Management and Billing , Problem
SAP Knowledge Base Article - Public