Happy Business Starts Here

Highlighted
Support SME

How to create subcription with Features via REST API

Question: When trying to create a subscription with feature (via REST), we received this error even after making sure that the ID exists under Product Feature object.

"Errors": [
{
"Code": "INVALID_VALUE",
"Message": "Invalid FeatureId: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'."
}
],
"Success": false
}
]






If you found my answer helpful, please give me a kudo ↑
Help others find answers faster by accepting my post as a solution √

1 REPLY 1
Support SME

Re: How to create subcription with Features via REST API

Solution: Please make sure to use ID returned from Feature object not ProductFeature.

 

Sample Query payload:

 POST : https://rest.apisandbox.zuora.com/v1/action/query 

{
  "queryString": "select Id from Feature"
}

Results:

{
    "records": [
        {
            "Id": "2c92c0f95b7a81bc015b85139542495e"
        }...
    ],
    "size": 1,
    "done": true
}

 

 

 

Sample REST API payload to create subcription with feature.

POST https://rest.apisandbox.zuora.com/v1/action/subscribe

Payload:

{ 
"subscribes": [ { 
"Account" : {"Id":"xxx" }, 
"SubscribeOptions" : { "GenerateInvoice" : false, "ProcessPayments":false}, 
"PreviewOptions":
{
"EnablePreviewMode": "false"
},
"SubscriptionData" : 
{ "RatePlanData": [ { 
"RatePlan": {"ProductRatePlanId" :"xxxxxx"} , 
"SubscriptionProductFeatureList" : { 
"SubscriptionProductFeature" : [ 
{"FeatureId" : "2c92c0f95b7a81bc015b85139542495e" } 
] 
} 
} 
], 
"Subscription" : { "InitialTerm":0,"TermType":"EVERGREEN", 
"ContractEffectiveDate":"2017-01-01","ServiceActivationDate":"2017-01-01"} } } ] }

 

 






If you found my answer helpful, please give me a kudo ↑
Help others find answers faster by accepting my post as a solution √