Happy Business Starts Here

Master

Create ProductRatePlanCharge via REST: MISSING_REQUIRED_VALUE ProductRatePlanChargeTier

I'm trying to create a ProductRatePlanCharge via REST, with a POST to /object/ProductRatePlanCharge.

 

I get the following error response.

 

{  
   "Errors":[  
      {  
         "Code":"MISSING_REQUIRED_VALUE",
         "Message":"Missing required value: ProductRatePlanChargeTier."
      }
   ],
"Success":false }

Here's my request. I can't see what the problem is.

 

{   'AccountingCode': 'Support Deferred',
    'ChargeModel': 'Flat Fee Pricing',
    'ChargeType': 'OneTime',
    'DefaultQuantity': '1',
    'DeferredRevenueAccount': 'Support Deferred',
    'ListPriceBase': 'Per Billing Period',
    'Name': 'Ubuntu Advantage Guest Embedded Public Cloud - Standard fee',
    'OverageCalculationOption': 'EndOfSmoothingPeriod',
    'OverageUnusedUnitsCreditOption': 'NoCredit',
    'PriceChangeOption': 'NoChange',
    'PriceIncreasePercentage': '0',
    'ProductRatePlanChargeTierData': [   {   'ProductRatePlanChargeTier': {   'Currency': 'USD',
                                                                              'Price': '1',
                                                                              'Tier': '1'}},
                                         {   'ProductRatePlanChargeTier': {   'Currency': 'GBP',
                                                                              'Price': '1',
                                                                              'Tier': '1'}},
                                         {   'ProductRatePlanChargeTier': {   'Currency': 'EUR',
                                                                              'Price': '1',
                                                                              'Tier': '1'}},
                                         {   'ProductRatePlanChargeTier': {   'Currency': 'CAD',
                                                                              'Price': '1',
                                                                              'Tier': '1'}}],
    'ProductRatePlanId': '2c92c0f96140e5670161644e684b53b7',
    'RecognizedRevenueAccount': 'Support Revenue',
    'RevenueRecognitionRuleName': 'Manual - Unlimited Billings Recognition',
    'TaxCode': 'EU-Tax',
    'TaxMode': 'TaxExclusive',
    'Taxable': 'true',
    'TriggerEvent': 'ContractEffective',
    'UpToPeriodsType': 'Billing Periods',
    'UseTenantDefaultForPriceChange': 'true'}

 

If you are investigating this for me, the following threads might be useful:

 

https://community.zuora.com/t5/Billing-Payments/Error-in-Creating-Product-rate-plan-charge/td-p/1703...

https://community.zuora.com/t5/API/ProductRatePlanCharge-Error-MISSING-REQUIRED-VALUE-For-Name/td-p/...

 

3 REPLIES 3
Master

Re: Create ProductRatePlanCharge via REST: MISSING_REQUIRED_VALUE ProductRatePlanChargeTier

Hi @bolaurent

 

This Endpoint (/object/ProductRatePlanCharge) does not seem to be accepting "POST" requests.
Actually, only the example of "GET" and "DELETE" are listed in the Reference.

 

I once created ProductRatePlanCharge (and Tier) with /action/create.
Hopefully this will be an alternative.
https://community.zuora.com/t5/API/How-Do-you-Create-a-Product-Rate-Plan-Rate-Charge-Tiers-via-REST/...

Highlighted
Master

Re: Create ProductRatePlanCharge via REST: MISSING_REQUIRED_VALUE ProductRatePlanChargeTier

Thank you yamasaki1ma. Your post helped me, because looking at your payload I realized that mine was structured slightly wrong (ProductRatePlanChargeTierData contains a map, with ProductRatePlanChargeTier as the sole key, and its value is a list).

 

I had ProductRatePlanChargeTierData containing a list. When I fixed that, my code worked, and it works with either /object/ProductRatePlanCharge or  /action/create (I tested my code both ways).

 

I think that the documentation is incomplete in this regard.

 

Here is my corrected payload structure:

 

{   'AccountingCode': 'Support Deferred',
    'ChargeModel': 'Flat Fee Pricing',
    'ChargeType': 'OneTime',
    'DefaultQuantity': '1',
    'DeferredRevenueAccount': 'Support Deferred',
    'ListPriceBase': 'Per Billing Period',
    'Name': 'Ubuntu Advantage Guest Embedded Public Cloud - Standard fee',
    'OverageCalculationOption': 'EndOfSmoothingPeriod',
    'OverageUnusedUnitsCreditOption': 'NoCredit',
    'PriceChangeOption': 'NoChange',
    'PriceIncreasePercentage': '0',
    'ProductRatePlanChargeTierData': {   'ProductRatePlanChargeTier': [   {   'Currency': 'EUR',
                                                                              'Price': '1',
                                                                              'Tier': '1'},
                                                                          {   'Currency': 'CAD',
                                                                              'Price': '1',
                                                                              'Tier': '1'},
                                                                          {   'Currency': 'GBP',
                                                                              'Price': '1',
                                                                              'Tier': '1'},
                                                                          {   'Currency': 'USD',
                                                                              'Price': '1',
                                                                              'Tier': '1'}]},
    'ProductRatePlanId': '2c92c0f86140d9b2016164dda91712ef',
    'RecognizedRevenueAccount': 'Support Revenue',
    'RevenueRecognitionRuleName': 'Manual - Unlimited Billings Recognition',
    'TaxCode': 'EU-Tax',
    'TaxMode': 'TaxExclusive',
    'Taxable': 'true',
    'TriggerEvent': 'ContractEffective',
    'UpToPeriodsType': 'Billing Periods',
    'UseTenantDefaultForPriceChange': 'true'}
Master

Re: Create ProductRatePlanCharge via REST: MISSING_REQUIRED_VALUE ProductRatePlanChargeTier

@bolaurent

 

I am happy that I can help you.
I also checked that I can call POST to /object/ProductRatePlanCharge. I did not know ...