Happy Business Starts Here

Zuora Staff

MISSING_REQUIRED_VALUE, Message=Missing required value: Type

Issue:

Getting an error 'Missing required value: Type' when creating a subscription thru Salesforce / Zuora API integration. Below is the sample call:

 

 

SubscribeRequest:[BillToContact=zObject:[PREDEFINED_ZOBJECT_MAP={}, arrayfields={}, fields={FirstName=FirstName, LastName=LastName, State=null, WorkEmail=test@zuora.com}, isPredefined=false, namespace=http://object.api.zuora.com/, zType=Contact], PaymentMethod=zObject:[PREDEFINED_ZOBJECT_MAP=(already output), arrayfields={}, fields={Id=2c92c0f83e7d4a49013e84b02c43xxxx}, isPredefined=false, namespace=http://object.api.zuora.com/, zType=PaymentMethod], PreviewOptions=null, SoldToContact=zObject:[PREDEFINED_ZOBJECT_MAP=(already output), arrayfields={}, fields={FirstName=FirstName, LastName=LastName, State=null, WorkEmail=test@zuora.com, isPredefined=false, namespace=http://object.api.zuora.com/, zType=Contact], SubscribeOptions=SubscribeOptions:[GenerateInvoice=true, ProcessPayments=true], SubscriptionData=SubscriptionData:[RatePlanData=(zObject:[PREDEFINED_ZOBJECT_MAP=(already output), arrayfields={RatePlanChargeData=(zObject:[PREDEFINED_ZOBJECT_MAP=(already output), arrayfields={}, fields={RatePlanCharge=zObject:[PREDEFINED_ZOBJECT_MAP=(already output), arrayfields={}, fields={ProductRatePlanChargeId=4028e69636e2c65901370968dc92xxxx, Quantity=1}, isPredefined=false, namespace=http://object.api.zuora.com/, zType=RatePlanCharge]}, isPredefined=false, namespace=http://api.zuora.com/, zType=RatePlanChargeData])}, fields={RatePlan=zObject:[PREDEFINED_ZOBJECT_MAP=(already output), arrayfields={}, fields={ProductRatePlanId=4028e69636e2c6590137096837e8xxxx}, isPredefined=false, namespace=http://object.api.zuora.com/, zType=RatePlan]}, isPredefined=false, namespace=http://api.zuora.com/, zType=RatePlanData]), Subscription=zObject:[PREDEFINED_ZOBJECT_MAP=(already output), arrayfields={}, fields={ContractEffectiveDate=2016-09-01T10:16:15, TermType=EVERGREEN}, isPredefined=false, namespace=http://object.api.zuora.com/, zType=Subscription]], zAccount=zObject:[PREDEFINED_ZOBJECT_MAP=(already output), arrayfields={}, fields={Batch=Batch1, BcdSettingOption=AutoSet, BillCycleDay=0, CrmId=001e0000005O25xxxxx, Currency=USD, Name=not submitted test@zuora.com, PaymentTerm=Due Upon Receipt}, isPredefined=false, namespace=http://object.api.zuora.com/, zType=Account]]

 

 

Salesforce results:

SubscribeResult:[AccountId=null, AccountNumber=null, Errors=(zObject:[PREDEFINED_ZOBJECT_MAP={}, arrayfields={}, fields={Code=MISSING_REQUIRED_VALUE, Message=Missing required value: Type}, isPredefined=false, namespace=http://api.zuora.com/, zType=Error]), InvoiceDatas=null, InvoiceId=null, InvoiceNumber=null, PaymentTransactionNumber=null, SubscriptionId=null, SubscriptionNumber=null, Success=false, subscribeResult=zObject:[PREDEFINED_ZOBJECT_MAP=(already output), arrayfields={Errors=((already output))}, fields={AccountId=null, AccountNumber=null, InvoiceId=null, InvoiceNumber=null, InvoiceResult=null, SubscriptionId=null, SubscriptionNumber=null, Success=false}, isPredefined=false, namespace=http://api.zuora.com/, zType=SubscribeResult]]



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
Zuora Staff

Re: MISSING_REQUIRED_VALUE, Message=Missing required value: Type

Explanation:

 

The error 'Missing required value: Type' when creating a subscription thru your Salesforce / Zuora API integration, your "SubscribeRequest" is passing the field ID on the PaymentMethod object, thus, the field "Type" should be required in your subscribe() call.

 

When using the HPM payment method ID as part of the subscribe() call, you need to consider:

(1) if the PaymentMethod ID is populated, Zuora will look it up in the database, and set it as the default PaymentMethod of the account

(2) if PaymentMethod ID is NOT populated, Zuora will try to create the PM, and set it as the default PaymentMethod of the account

 

Since the PaymentMethod with the ID of 2c92c0f83e7d4a49013e84b02c43xxxx is not existing, the subscribe() call will try to create a payment method. And since the required field "Type" of the PaymentMethod object is not passed, the subscribe() call returned an error.

 



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