Reply
Highlighted
marymunsell Valued Scholar

Valued Scholar

Valued Scholar
Posts: 15
Registered: ‎07-24-2017

Apply Discount to One Time Charge based on Volume

How do I apply a discount to a one time charge based on the volume?    For example, one widget cost $50, but if you order ten wedgets, we will discount the customer $45.   I do not want to use volume pricing, as we want the discount to be more visible.  

 

So invoice = $500 with a $45 discount  = $455.    Any help would be appreciated!

 

Need help with both API and UI on this one!

 

 

Richard Master ZEO

Master ZEO

Master ZEO
Posts: 47
Registered: ‎01-19-2016

Re: Apply Discount to One Time Charge based on Volume

While volume pricing, as you noted, 'buries' the discount in the small print, it does have the advantage that it's applied automatically. There are two other ways to discount in Zuora that will call out the discount as a separate charge so it will display clearly on the invoice.

 

The first of these is quite simple, just add a second negative price charge, one for -$50 in the case of your example. If the expectation is that few, if any, people will ever pay list, and that most will receive at least some discount, then a single rate plan with two one time charges should work. One one-time rate plan charge with a per unit charge of $50 and the other one-time charge a per unit charge of -$4.50. The downside to this approach is that you need to specify the quantity twice when adding this rate plan to a subscription but otherwise it should give you the behavior you are looking for. Also if the discount is more aggressive at higher quantities, say twenty widgets earns me a discount of $100 you'll also need to modify the discount charge from -$4.50 to -$5. This may be fine if you're negotiating the discount with every deal but if this is 'locked' discounting with no negotiation you either need to remember to tweak the negative one time charge or create another rate plan for the higher volume and discount. Not ideal, hence my earlier comment about the advantage of the volume model is that the discounts are locked into the rate plan and you only need the one rate plan where you've specified all the discounts.

 

A second approach is to use a discount charge model, either percentage or fixed amount, but from your example a percentage, 9% would work. While counter intuitive you'd create a second RECURRING charge, set the Charge Model to be DIscount-Percentage and once you do that you'll then be able to constrain the discount to operate only on one-time charges, there's a check box, it'll be obvious once you go into the UI. But using a recurring charge to define a one time discount is not one of Zuora's finest UI design choices. Otherwise this operates in a similar fashion to the first choice, with the same restriction in that if the discount is more aggressive at higher volumes you may need to edit the discount when adding to the subscription or have multiple rate plans based on volume.

 

While I've described the above using the UI, the same basic things happen in the API, you just add the rate plan as usual and if needed update the quantities/discount using the chargeOverrides section of the subscription POST:

https://www.zuora.com/developer/api-reference/#operation/POST_Subscription

 

One final comment on the volume charge model approach, since the discount isn't explicity called out using charges, in contrast to the two alternatives above, an effective, if blunt, alternative is to include the list price in the name of your rate plan or rate plan charge. So instead of having a rate plan charge called, 'Product X Charge', call it, 'Product X (DIscounted - $50/unit list) Charge'. Now the invoice line item can show the charge name,'Product X (DIscounted - $50/unit list) Charge', a quantity of 10 and an effective price of $455. Even my limited math skills can figure out I've gotten a nice discount. But this approach is not for everyone Smiley Happy

 

Hope this helps. 

mmunsell Tutor

Tutor

Tutor
Posts: 3
Registered: ‎07-18-2017

Re: Apply Discount to One Time Charge based on Volume

Good Afternoon, I am finally getting back to this task.   I decided to try to apply a discount charge model.    I have 3 One Time Charges, then attempting to apply the discount charge model rateplan with 5.5% discount.    I am getting an error:  

 

{
"success": false,
"processId": "958247C7EB0275B7",
"reasons": [
{
"code": 58560020,
"message": "Invalid field: applyDiscountTo for charge model PerUnit charge type OneTime"
}
]
}

  

 

{
  "orderNumber": null,
  "orderDate": "2017-08-02",
  "customFields": null,
  "existingAccountNumber": "5CDEEF88-D310-4756-984B-0012E8976A19",
  "newAccount": null,
  "subscriptions": [
    {
      "subscriptionNumber": null,
      "customFields": null,
      "orderActions": [
        {
          "type": "CreateSubscription",
          "triggerDates": [
            {
              "name": "ContractEffective",
              "triggerDate": "2017-08-02"
            }
          ],
          "customFields": null,
          "createSubscription": {
            "subscriptionOwnerAccountNumber": null,
            "subscriptionNumber": null,
            "terms": {
              "initialTerm": {
                "startDate": "2017-08-11",
                "period": 1,
                "periodType": "Day",
                "termType": "TERMED"
              },
              "renewalTerms": [
                {
                  "period": 1,
                  "periodType": "Day"
                }
              ],
              "renewalSetting": "RENEW_WITH_SPECIFIC_TERM",
              "autoRenew": false
            },
            "invoiceSeparately": true,
            "notes": null,
            "subscribeToRatePlans": [
              {
                "productRatePlanId": "2c92c0f85dc6901a015dd201baba2620",
                "chargeOverrides": [
                  {
                    "productRatePlanChargeId": "2c92c0f95dc6984b015dd202427906eb",
                    "pricing": {
                      "oneTimePerUnit": {
                        "listPrice": null,
                        "quantity": 3
                      }
                    }
                  }
                ]
              },
              {
                "productRatePlanId": "2c92c0f95e502699015e587bb41a3e24",
                "chargeOverrides": [
                  {
                    "productRatePlanChargeId": "2c92c0f85e501aa0015e5885e14056c2",
                    "pricing" : {
                       "discount": {
	                      "applyDiscountTo": "ONETIME",
	                      "discountAmount": 0,
	                      "discountLevel": "rateplan",
	                      "discountPercentage": 5.5
                    }
                    }
                  }
                ]
              }
            ]
          }
        }
      ]
    }
  ],
  "processingOptions": {
    "runBilling": true,
    "billingOptions": {
      "documentDate": "2017-08-02",
      "targetDate": "2017-08-02"
    },
    "collectPayment": true
  }
}

Please advise, as what might be wrong with my payload.    

yamasaki1ma Valued Scholar

Valued Scholar

Valued Scholar
Posts: 25
Registered: ‎02-22-2017

Re: Apply Discount to One Time Charge based on Volume

[ Edited ]

Hi @mmunsell

 

Do you need to use Order in your case?
My tenant does not use Order, so I can not try your payload.
If you use the "Create Subscription" call, I can show an example.
The call using the following payload will succeed and subscription will be created.
(If you have thought about using "Create Subscription" call already, please ignore this post)

 

[POST] https://rest.apisandbox.zuora.com/v1/subscriptions

{
  "accountKey": "A-00000001",
  "autoRenew": false,
  "contractEffectiveDate": "2017-08-01",
  "initialTerm": "1",
  "initialTermPeriodType": "Month",
  "renewalTerm": "1",
  "renewalTermPeriodType": "Month",
  "invoiceCollect": true,
  "invoiceTargetDate": "2017-08-01",
  "subscribeToRatePlans": [
    {
      "productRatePlanId": "2c92c0f95e5e8bf9015e653a98d016c1",
      "chargeOverrides": [
        {
          "productRatePlanChargeId": "Charge A's ID",
          "quantity": 3
        },
        {
          "productRatePlanChargeId": "Charge B's ID",
          "applyDiscountTo": "ONETIME",
          "discountLevel": "rateplan",
          "discountPercentage": 5.5
        }
      ]
    }
  ],
  "termType": "TERMED"
}

It is a premise that the ProductRatePlan contains the following ProductRatePlanCharge:
* Charge A -> Charge Type: One-Time, Charge Model: Per Unit
* Charge B -> Charge Type: Recurring, Charge Model: Discount-Percentage