Happy Business Starts Here

Newly Enrolled

How Do you Create a Product Rate Plan Rate Charge Tiers via REST API

I can't seem to find the REST API documentation for creating a product rate plan charge tiers.  The documentaiton for Product Rate Plans includes only the Retrieve and Delete methods.  How can I create a product rate plan for an existing product?  I don't see how to add rate tiers to the product rate plan in the API documentation.   A

5 REPLIES 5
Zuora Alumni

Re: How Do you Create a Product Rate Plan Rate Charge Tiers via REST API

Hi @rulio

 

Have you visited our Developer Center?  Click to read more on Update Rate Plans! 



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

Master

Re: How Do you Create a Product Rate Plan Rate Charge Tiers via REST API

Hi @rulio 

 

As you say, there is no dedicated REST API to create Product Rate Plan Charge and Product Rate Plan Charge Tier so far.
In other words, the following call is NOT found in the current API reference.

POST: https://rest.apisandbox.zuora.com/v1/object/product-rate-plan-charge
POST: https://rest.apisandbox.zuora.com/v1/object/product-rate-plan-charge-tier

 

On the other hand, the REST API has the following call to create an arbitrary object:

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

 

Here is an example of using this call to create Product Rate Plan Charge and Product Rate Plan Charge Tier.

 

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

{
	"type": "ProductRatePlanCharge",
	"objects": [
		{
			"BillCycleType": "DefaultFromCustomer",
			"BillingPeriod": "Month",
			"ChargeModel": "Volume Pricing",
			"ChargeType": "Recurring",
			"Name": "REST API TEST CHARGE",
			"ProductRatePlanId": "2c92c0f85cee08f6015d018acbfb4838",
			"AccountingCode": "Deferred Software Revenue",
			"DeferredRevenueAccount": "Deferred Software Revenue",
			"RecognizedRevenueAccount": "Deferred Software Revenue",
			"TriggerEvent": "ContractEffective",
			"UOM": "License",
			"ProductRatePlanChargeTierData": {
				"ProductRatePlanChargeTier": [
					{
						"Currency": "JPY",
						"StartingUnit": "1.0",
						"EndingUnit": "50.0",
						"Price": "1000",
						"PriceFormat": "Per Unit"
					},
					{
						"Currency": "JPY",
						"StartingUnit": "51.0",
						"EndingUnit": "100.0",
						"Price": "500",
						"PriceFormat": "Per Unit"
					}
				]
			}
		}
	]
}

 

Caution:

  • ProductRatePlan already exists and needs to know the ID. It is specified in the "ProductRatePlanId" field.
  • Please specify a valid Accouting Code on your tenant for "AccountingCode", "DeferredRevenueAccount", "RecognizedRevenueAccount" (it seems that they must all make the same Code).
  • The Account Code can be checked from the following page: Tenant setting> Finance> Manage Chart of Accounts

 

I referred to the following pages:

----

 

(2018/02/05 Additional notes)

 

With the above mentioned endpoint and request we can create ProductRatePlanCharge (and Tier).

On the other hand, now, the same is possible with the following endpoints and requests.
(This was discovered by @bolaurent. The post is here)

 

POST: https://rest.apisandbox.zuora.com/v1/object/ProductRatePlanCharge

{
	"BillCycleType": "DefaultFromCustomer",
	"BillingPeriod": "Month",
	"ChargeModel": "Volume Pricing",
	"ChargeType": "Recurring",
	"Name": "REST API TEST CHARGE",
	"ProductRatePlanId": "2c92c0f96140e567016164fe487d5bd9",
	"AccountingCode": "Deferred Software Revenue",
	"DeferredRevenueAccount": "Deferred Software Revenue",
	"RecognizedRevenueAccount": "Deferred Software Revenue",
	"TriggerEvent": "ContractEffective",
	"UOM": "times",
	"ProductRatePlanChargeTierData": {
		"ProductRatePlanChargeTier": [
			{
				"Currency": "JPY",
				"StartingUnit": "1.0",
				"EndingUnit": "50.0",
				"Price": "1000",
				"PriceFormat": "Per Unit"
			},
			{
				"Currency": "JPY",
				"StartingUnit": "51.0",
				"EndingUnit": "100.0",
				"Price": "500",
				"PriceFormat": "Per Unit"
			}
		]
	}
}

 

Note:
I confirmed that the same result can be obtained by using the following endpoints:
POST: https://rest.apisandbox.zuora.com/v1/object/product-rate-plan-charge

 

----

 

(2018/05/22 Additional notes)

 

Now I noticed that the above endpoint is listed in the reference.

It was added at 2018/04/22: API Change log

Highlighted
Valued Scholar

Re: How Do you Create a Product Rate Plan Rate Charge Tiers via REST API

Hello,

 

Instead of creating a new post, I am asking a question here. Is it not possible to create product, rate plans and rate plan charges in one API call? Like when you retrieve a catalog for a product, we get a JSON structure hierarchy, what if we try to provide a hierarchical structure for a POST call, can't it create all three levels in one go?

Valued Scholar

Re: How Do you Create a Product Rate Plan Rate Charge Tiers via REST API

Master

Re: How Do you Create a Product Rate Plan Rate Charge Tiers via REST API

Hi @sumitbahukhandi

 

I think that there is no API call to create Product, Plan, Charge and Tier in one shot.
I am sorry I can not help you ...