REST APIを使用したサブスクリプション製品の修正
REST APIを使用して、サブスクリプション製品を修正できます。 「修正」処理を使用して、アクティブなサブスクリプションの製品を更新できます。 製品を修正するときは、製品明細の複製がこの処理で作成されるので、その明細の複製を更新できます。 ただし、サブスクリプション製品を修正するAPIは1つもありません。 次のステップに従って、同じ結果を得ることができます:
- サブスクリプションを作成します。
- サブスクリプションをアクティブ化します。
- 既存のサブスクリプションに料金が関連付けられているサブスクリプション製品を作成します。
- サブスクリプションをアクティブ化します。
- ソース・サブスクリプション製品をクローズします。
ステップ1: サブスクリプションの作成
次の例は、サブスクリプションを作成する方法を示しています。
URLの例:
https://servername.fa.us2.oraclecloud.com/crmRestApi/resources/11.13.18.05/subscriptions
リクエスト本文の例
{
"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"
}
レスポンス本文の例
{
"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,
...
}
ステップ2: サブスクリプションのアクティブ化
「URLの例」
https://servername.fa.us2.oraclecloud.com/crmRestApi/resources/11.13.18.05/subscriptions/action/activate
レスポンス本文の例
{
"result": "success"
}
ステップ3: 既存のサブスクリプションに料金が関連付けられているサブスクリプション製品を作成します。
このペイロードは、新規明細(修正済製品)の作成に使用され、ソース製品とターゲット製品の間の関係を確立するために使用されます。
URLの例:
https://servername.fa.us2.oraclecloud.com/crmRestApi/resources/11.13.18.05/subscriptionProducts
リクエスト本文の例
{
"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
}
]
}
レスポンス本文の例
{
"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": [
...
}
ステップ4: サブスクリプションのアクティブ化
「URLの例」
https://servername.fa.us2.oraclecloud.com/crmRestApi/resources/11.13.18.05/subscriptions/action/activate
レスポンス本文の例
{
"result": "success"
}
ステップ5: ソース・サブスクリプション製品のクローズ
URLの例
https://servername.fa.us2.oraclecloud.com/crmRestApi/resources/11.13.18.05/subscriptionProducts/KAN_12_01-PRDT-36025
リクエスト本文の例
{
"name":"close",
"parameters":[
{
"closedDate":"2020-09-02"
},
{
"closeReason":"ORA_NON_COMPLIANCE"
},
{
"closeCreditMethod":"ORA_FULL"
}
]
}
レスポンス本文の例
{
"result": "Success"
}
ノート:
修正有効日および修正事由は移入されません。