Happy Business Starts Here

ProductRatePlanCharge Error: Blank accounting code is not allowed MISSING_REQUIRED_VALUE

Partner
Partner

ProductRatePlanCharge Error: Blank accounting code is not allowed MISSING_REQUIRED_VALUE

I'm unable to create a ProductRatePlanCharge object due to error shown below.. Viewing the object I can see that  the accounting code is in the object..

 

Create zuora.ProductRatePlanCharge
: MISSING_REQUIRED_VALUE  Blank accounting code is not allowed. Please select a valid accounting code.

 

     ProductRatePlanCharge zprpc = new ProductRatePlanCharge();
            zprpc.Name = "ApiJrdTestRatePlanCharge";
            zprpc.AccountingCode = "A Testing Accounting Code";
            zprpc.TriggerEvent = "ContractEffective";
            zprpc.ProductRatePlanId = zprpid;
            zprpc.BillingPeriod = "Month";
            zprpc.BillCycleDaySpecified = true;
            zprpc.BillCycleDay = 1;
            zprpc.BillingPeriodAlignment = "AlignToCharge";
            zprpc.ProductRatePlanChargeTierData = makeProductRatePlanChargeTierData();
            zprpc.ChargeType = "Recurring";
            zprpc.ChargeModel = "Per Unit Pricing";

3 REPLIES 3
Zuora Alumni

Re: ProductRatePlanCharge Error: Blank accounting code is not allowed MISSING_REQUIRED_VALUE

Hi---Is "Testing Accounting Code" an accounting code in your Zuora environment? If not, then it won't allow you to pass that under your current rules. If you are in Zuora and navigate to Settings---ZFinance Settings---Configure Accounting Rules. The very first rule states "Allow Blank Accounting Codes". If you want to run your test, you can temporarily turn the rule to "Yes". 

 

Partner
Partner

Re: ProductRatePlanCharge Error: Blank accounting code is not allowed MISSING_REQUIRED_VALUE

Hi Matt

 

The accounting code “"Testing Accounting Code" is defined in the sandbox… I later used another one call "Revenue"

 

It seems to be working the opposite –  I am passing a ‘Accounting Code” (which is on file in my tenant).  It turns out that if I do turn the option "Allow Blank Accounting code" to "ON"  the object creates…

Zuora Staff

Re: ProductRatePlanCharge Error: Blank accounting code is not allowed MISSING_REQUIRED_VALUE

Hi James. We have gone over this on the ticket but i would like to post this in case other customers encounter the same issue. 

 

Under the Finance field:

When you create the call you are creating only 1 account code which is Revenue. However, under the configure accounting rules you also had Allow blank Accounting Codes - No. By selecting No, we will help you enforce having non-blank accounting codes when you configure new accounting codes for various transactions (payments, refunds etc) and on product rate plan charge. The screenshot i provided, the areas highlighted in red have blank accounting codes and this is why you received the errorMISSING_REQUIRED_VALUE Blank accounting code is not allowed. Please select a valid accounting code. So changing the allow blank accounting codes to Yes will allow you to create.

 

Option 2:

 

If you don't want to change the Allow blank accounting codes to Yes then you also need to include the DeferredRevenueAccount and RecognizedRevenueAccount tags in the apex request.

 

Example:

 

<ns1:create>
<ns1:zObjects xsi:type="ns1:ProductRatePlanCharge">
<ns2:AccountingCode>tax_b</ns2:AccountingCode>
<ns2:BillCycleDay>1</ns2:BillCycleDay>
<ns2:BillCycleType>SubscriptionStartDay</ns2:BillCycleType>
<ns2:BillingPeriod>Three Years</ns2:BillingPeriod>
<ns2:BillingPeriodAlignment>AlignToTermStart</ns2:BillingPeriodAlignment>
<ns2:ChargeModel>FlatFee</ns2:ChargeModel>
<ns2:ChargeType>Recurring</ns2:ChargeType>
<ns2:DeferredRevenueAccount>tax_b</ns2:DeferredRevenueAccount>
<ns2:Name>Anti-Virus Test - 3 Years</ns2:Name>
<ns2:ProductRatePlanChargeTierData>
<ns1:ProductRatePlanChargeTier>
<ns2:Price>129.99</ns2:Price>
</ns1:ProductRatePlanChargeTier>
</ns2:ProductRatePlanChargeTierData>
<ns2:ProductRatePlanId>2c92c0f84de0fa68014df6fa5dc36a2a</ns2:ProductRatePlanId>
<ns2:RecognizedRevenueAccount>tax_b</ns2:RecognizedRevenueAccount>
<ns2:TriggerEvent>ContractEffective</ns2:TriggerEvent>
</ns1:zObjects>
</ns1:create>


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