<span class="bold">Amend Subscription Products Using REST APIs</span>
You can use REST APIs to amend subscriptions products. You can use the Amend action to update products on an active subscription. When you amend a product, the action creates a duplicate product line, and you can update the duplicate line. However, there's no single API to amend a subscription product. You can follow the steps given below to achieve the same result:
- Create a subscription.
- Activate the subscription.
- Create a subscription product with its associated charges on the existing subscription.
- Activate the subscription.
- Close the source subscription product.
Step 1: Create a Subscription
The following example shows how to create a subscription.
Example URL:
https://servername.fa.us2.oraclecloud.com/crmRestApi/resources/11.13.18.05/subscriptions
Example of Request Body
{ "SubscriptionNumber": "KAN_12_01", "BusinessUnitId": 204, "LegalEntityId": 204, "SubscriptionProfileId": 300100172161473, "PrimaryPartyId": 1001, "Currency": "USD", "StartDate": "2019-01-01", "EndDate": "2024-12-31", "DefinitionOrganizationId": 204, "BillToAccountId": 1001, "BillToAccountNumber": "1001", "BillToSiteUseId": 1006, "PaymentTermsName": "Immediate" }
Example of Response Body
{ "SubscriptionId": 300100187385307, "SubscriptionNumber": "KAN_12_01", "BusinessUnitId": 204, "BusinessUnitName": "Vision Operations", "LegalEntityId": 204, "LegalEntityName": "Vision Operations", "SubscriptionProfileId": 300100172161473, "SubscriptionProfileName": "zOSS_SP_ServiceStartActual_Advance_Month", "PrimaryPartyId": 1001, "PrimaryPartyName": "A T & T SOLUTIONS INC", "PricedOnDate": "2020-09-14T00:00:00+00:00", "PricingStrategyId": null, "PricingStrategyExplanation": null, "PricingSegment": null, "PricingSegmentExplanation": null, "SegmentExplanationMessage": null, "Currency": "USD", "CurrencyName": "US Dollar", "CurrencyConversionRate": null, "CurrencyConversionRateType": null, "CurrencyConversionRateDate": null, "StartDate": "2019-01-01", "Duration": 6, "Period": "0zE", "EndDate": "2024-12-31", "DefinitionOrganizationId": 204, "DefinitionOrganizationName": "Vision Operations", "PartialPeriodType": "ORA_ACTUAL", "PartialPeriodStart": "ORA_SERVICE", "CloseReason": null, "ClosedDate": null, "CloseCreditMethod": null, "ApprovalNote": null, "CancelReason": null, "CanceledDate": null, "ApprovedDate": null, "RenewedDate": null, "ShortDescription": null, "Description": null, "Status": "ORA_DRAFT", "UserStatus": null, "BillService": "ORA_BILL", "BillServiceName": "Bill", "InvoicingRuleId": -2, "InvoicingRuleName": "Advance Invoice", "BillingDateCode": "ORA_PERIOD_START", "BillingDateName": "Period start", "BillOnDay": null, "BillingOffsetDays": null, "BillingFrequency": "0zG", "BillingFrequencyName": "MONTH", "AccountingRuleId": 300100033038413, "AccountingRuleName": "3 Months, Deferred", "TransactionTypeName": "ORA_OSS_Invoice", "BillingSystem": null, "SubscriptionInvoiceText": "[$Item Name]: [$Charge Name] [$Bill from Date]-[$Bill to Date]", "CoverageInvoiceText": null, "BillToAccountId": 1001, "BillToAccountNumber": "1001", "BillToAccountDescription": "A T & T SOLUTIONS INC", "BillToSiteUseId": 1006, "BillToAddress": "32 Ave of the Americas, , New York, NY 10013", "ShipToParty": null, "ShipToPartyName": null, "ShipToPartySiteId": null, "ShipToSite": null, "PaymentMethod": null, "PaymentMethodName": null, "PONumber": null, "WireNumber": null, "PaymentTermsId": 1064, "PaymentTermsName": "Immediate", "TaxClassificationCode": null, "TaxClassificationMeaning": null, "ExemptCertificateNumber": null, "ExemptReason": null, "ExemptReasonMeaning": null, "TaxExemptionHandling": "S", "TaxExemptionHandlingName": "Standard", "DocumentFiscalClassification": null, "CustomerAcceptance": null, "InternalApproval": "REQUIRED", "LayoutTemplate": null, "CommunicationChannel": null, "PrimarySalesPerson": null, "NegotiationLanguage": null, "QuoteToContactId": null, "EnableRenewalRemindersFlag": null, "RenewalProcess": null, "DaysBeforeExpiry": null, "QuoteToCcEmail": null, "RenewalPricingMethodUsed": null, "RenewalProcessUsed": null, "PriceAdjustmentPercentUsed": null, "DaysBeforeExpiryUsed": null, "AssigneeId": null, "AssigneeType": null, "TotalContractValue": null, "EstimatedTax": null, "CreditedAmount": null, "ClosedAmount": null, "CanceledAmount": null, "InvoicedAmount": null, "SourceSystem": null, "SourceKey": null, "SourceNumber": null, "RenewalTemplateId": null, "NotificationTemplateId": null, "RenewalSubscriptionProfileId": null, "DefaultLanguage": null, "GenerateBillingSchedule": null, "TransactionType": "ORA_SUBSCRIPTION", "PricingSystem": "ORA_FUSION", "PricingError": null, "CorpCurrencyCode": "USD", "CurcyConvRateType": "Corporate", "RenewalCustomerAcceptance": null, "RenewalInternalApproval": null, "RenewalPriceAdjustmentBasis": null, "RenewalPriceAdjustmentPercent": null, "RenewalPriceAdjustmentType": null, "AttachmentEntityName": "OSS_DOC_SUBSCRIPTION_AGREEMENT", "AttachmentEntityName1": "OSS_DOC_SUPPORTING_DOCUMENTS", "CreatedBy": "CONMGR", "CreationDate": "2020-09-14T07:40:27+00:00", "LastUpdatedBy": "CONMGR", "LastUpdateDate": "2020-09-14T07:40:27.289+00:00", "LastUpdateLogin": "AE71B091FD86A49DE0530740F00A31E4", "RenewalType": null, "CustomerTrxTypeSequenceId": 806, "UsageCapture": "ORA_THIRD_PARTY", "LineAutonumberEnabledYn": false, "RenewalPaymentMethod": null, "RenewalPoNumber": null, "RenewalWireNumber": null, "RenewalPaymentMethodName": null, "UserStatusName": null, ... }
Step 2: Activate the Subscription
Example URL
https://servername.fa.us2.oraclecloud.com/crmRestApi/resources/11.13.18.05/subscriptions/action/activate
Example of Response Body
{ "result": "success" }
Step 3: Create a Subscription Product With Its Associated Charges on an Existing Subscription.
This payload is used to create a new line (amended product), and it's used to establish the relationship between the source and target product.
Example URL:
https://servername.fa.us2.oraclecloud.com/crmRestApi/resources/11.13.18.05/subscriptionProducts
Example of Request Body
{ "Subscription Number": "KAN_12_01", "LineNumber": "P2", "ProductName": "Cloud Backup Service", "Quantity": 1, "StartDate": "2020-08-05", "EndDate": "2020-12-31", "GenerateBillingSchedule": "Y", "relationships": [ { "RelationshipTypeCode": "AMEND", "SourceProductPuid": "Test03082020-6-PRDT-9188" } ], "charges": [ { "ChargeName": "Activation Fee", "ChargeDefinition": "QP_SALE_PRICE", "PriceType": "ONE_TIME", "UnitListPrice": 250 }, { "ChargeName": "Service Fee", "ChargeDefinition": "QP_RECURRING_SALE_PRICE", "PricePeriodicity": "0zF", "PriceType": "RECURRING", "UnitListPrice": 100 }, { "ChargeName": "Annual Support Fee", "ChargeDefinition": "QP_RECURRING_SALE_PRICE", "PricePeriodicity": "0zF", "PriceType": "RECURRING", "UnitListPrice": 200 } ] }
Example of Response Body
{ "SubscriptionProductId": 300100543193176, "Subscription Id": 300100543193149, "LineNumber": "P2", "SubscriptionProductPuid": "KAN_12_01-PRDT-36025", "DefinitionOrganizationId": 204, "SubscriptionNumber": "KAN_12_01", "SalesProductType": "SUBSCRIPTION", "Description": "Cloud Backup Service", "InventoryItemId": 300100178580511, "ItemUnitOfMeasure": "Ea", "ProductName": "Cloud Backup Service", "Quantity": 1, "StartDate": "2020-08-05", "EndDate": "2020-12-31", "CloseReason": null, "CloseCreditMethod": null, "CancelReason": null, "ClosedDate": null, "CanceledDate": null, "RenewedDate": null, "PriceListId": null, "UnitPrice": null, "Status": "ORA_DRAFT", "Currency": "USD", "InvoicingRuleId": -2, "InvoicingRuleName": "Advance Invoice", "BillOnDay": null, "BillingOffsetDays": null, "BillingFrequency": "0zG", "BillingFrequencyName": "MONTH", "AccountingRuleId": 300100033038413, "AccountingRuleName": "3 Months, Deferred", "TransactionTypeName": "ORA_OSS_Invoice", "InvoiceText": "[$Item Name]: [$Charge Name] [$Bill from Date]-[$Bill to Date]", "BillToAccountId": 1001, "BillToAccountNumber": "1001", "BillToAccountDescription": "A T & T SOLUTIONS INC", "BillToSiteUseId": 1006, "BillToAddress": "32 Ave of the Americas,NEW YORK, NY 10013", "ShipToPartyId": null, "ShipToPartyName": null, "ShipToPartySiteId": null, "ShipToPartySiteName": null, "PaymentMethod": null, "PaymentMethodName": null, "PONumber": null, "WireNumber": null, "PaymentTermsId": 1064, "PaymentTermsName": "Immediate", "PrePaymentNumber": null, "TaxExemptionHandling": "S", "TaxExemptionHandlingName": "Standard", "ExemptCertificateNumber": null, "ExemptReason": null, "OutputTaxClassification": null, "ProductFiscClassification": null, "TaxError": null, "CoverageScheduleId": null, "RenewalType": "RENEW", "BillingDateCode": "ORA_PERIOD_START", "BillingDateName": "Period start", "TotalContractValue": 737.1, "EstimatedTax": 147.42, "PricingError": null, "PriceAsOf": "2021-07-12", "PriceTransactionOn": "2021-07-12", "InvoicedAmount": null, "CreditedAmount": null, "CanceledAmount": null, "ClosedAmount": null, "SourceSystem": null, "SourceKey": null, "SourceNumber": null, "SourceLineKey": null, "SourceLineNumber": null, "MonthlyRecurringRevenue": 100, "Duration": 149, "Period": "DY", "GenerateBillingSchedule": "Y", "ExternalAssetKey": null, "ExternalParentAssetKey": null, "ExternalPriceListId": null, "ExternalRootAssetKey": null, "PriceListName": null, "NextPricingDate": null, "PricingTermsStartDate": null, "PricingTermsPricingMethod": null, "PricingTermsPeriod": null, "PricingTermsDuration": null, "PricingTermsAdjustmentPCT": null, "CorpCurrencyCode": "USD", "CurcyConvRateType": "Corporate", "AmendCreditMethod": null, "AmendCreditMethodName": null, "AmendDescription": null, "AmendEffectiveDate": null, "AmendReason": null, "AmendReasonName": null, "StatusMeaning": "Draft", "EnablePricingTermsFlag": null, "NextBillStartDate": null, "TaxClassificationMeaning": null, "CreatedBy": "CONMGR", "CreationDate": "2021-07-12T05:46:38+00:00", "LastUpdatedBy": "CONMGR", "LastUpdateDate": "2021-07-12T05:46:39.189+00:00", "LastUpdateLogin": "C67A6758176886CCE0530740F00A24AB", "SummarizedBillingFlag": null, "InterfaceOffsetDays": null, "CoverageName": null, "SuspendReason": null, "SuspendedDate": null, "SuspendCreditMethod": null, "ResumeDate": null, "ResumeDuration": null, "ResumePeriod": null, "AutoExtendFlag": null, "ChurnProbability": null, "EarlyTerminationPenalty": null, "EarlyTerminationFee": null, "GracePeriod": null, "PenaltyValue": null, "PenaltyChargeName": "Penalty Fee", "EarlyTerminationPenaltyName": null, "ChurnPredictionTrend": null, "PriceAdjustmentType": null, "PriceAdjustmentBasis": null, "PriceAdjustmentPercent": null, "DisplaySequence": null, "RelatedInventoryItemId": null, "RelatedProductName": null, "ProductChangeReason": null, "ProductChangeSchedule": null, "ProductChangeScheduleFrom": null, "DropOneTimeChargeFlag": null, "RelatedProductDescription": null, "GenerateBillFullPeriodFlag": null, "RenewalPaymentMethod": null, "RenewalPoNumber": null, "RenewalWireNumber": null, "RenewalPaymentMethodName": null, "CustomerTrxTypeSequenceId": 806, "RepriceFlag": null, "AlignBillingFrom": null, "PendingActivationFlag": null, "RatePlanDocumentId": null, "RatePlanId": null, "RatePlanNumber": null, "RatePlanName": null, "BillToSiteNumber": null, "ShipToPartyNumber": null, "ShipToPartySiteNumber": null, "SalesOrderId": null, "SalesOrderNumber": null, "OrderFulfillLineId": null, "OrderFulfillLineNumber": null, "EnableUpfrontBillingFlag": null, "relationships": [ { "RelationshipTypeCode": "AMEND", "ObjectVersionNumber": 1, "CreatedBy": "CONMGR", "CreationDate": "2021-07-12T05:46:38.417+00:00", "LastUpdatedBy": "CONMGR", "LastUpdateDate": "2021-07-12T05:46:39.245+00:00", "LastUpdateLogin": "C67A6758176886CCE0530740F00A24AB", "SourceProductPuid": "Test03082020-6-PRDT-9188", "OperationLinksPuid": "KAN_12_01-PRDT-36025-OPRL-8007", "TargetProductPuid": "KAN_12_01-PRDT-36025", "SourceRootAssetKey": null, "SourceAssetKey": null, "TargetProdAssociationId": null, "TargetProdAssociationPuid": null, "SourceProdAssociationId": null, "SourceProdAssociationPuid": null, "links": [ ... }
Step 4: Activate the Subscription
Example URL
https://servername.fa.us2.oraclecloud.com/crmRestApi/resources/11.13.18.05/subscriptions/action/activate
Example of Response Body
{ "result": "success" }
Step 5: Close the Source Subscription Product
Example URL
https://servername.fa.us2.oraclecloud.com/crmRestApi/resources/11.13.18.05/subscriptionProducts/KAN_12_01-PRDT-36025
Example of Request Body
{ "name":"close", "parameters":[ { "closedDate":"2020-09-02" }, { "closeReason":"ORA_NON_COMPLIANCE" }, { "closeCreditMethod":"ORA_FULL" } ] }
Example of Response Body
{ "result": "Success" }
Note:
The amendment effectivity date and amendment reason will be not populated.