Create delivery adjustments
This article uses an example to explain the steps required for creating delivery adjustments.
Example
An end customer subscribes to newspapers delivered every Saturday and Sunday and thus is charged at the same frequency as follows:
- Terms subscription with period type is week and period is 4
- Delivery pricing charges:
- Recurring charge of 2 USD every Saturday
- Recurring charge of 5 USD every Sunday
- Contract Effective Date: 2023-04-01
For some reason, the end customer received wet newspapers from 2023-04-01 (Saturday) to 2023-04-02 (Sunday) and initiated a refund for the poor deliveries.
You can now create delivery adjustments to refund the end customers.
Prerequisites
Before creating delivery adjustments, ensure the following tasks are completed:
-
The following features must be enabled. For more information, see Enable billing features by yourself.
- Delivery Pricing: For creating delivery charges.
- Billing Adjustment: For accessing the Adjustments API.
- Invoice Settlement: For credit memos or debit memos auto-generation.
- An invoice for the current billing period has been created and posted.
- The Post Credit Memo billing permission has been enabled for the billing role specified in Profiles > Billing Role so as to generate and post credit memos for the refund. For more information, see Billing Role.
- The option of the Invoice/Credit Memo generation rule in Billing Settings > Define Billing Rules > Billing Document is either of the following to ensure the positive charge amount is still within an invoice.
- Put all negative charges on a credit memo
- Put all negative charges and zero credit charges on a credit memo
- The default credit memo reason code is created.
Create default reason code for credit memos
You must set the default reason code before creating delivery adjustments. To create the default reason code for credit memos, perform the following steps:
- Click your username at the top right in the Zuora UI and then navigate to Payments > Configure Reason Codes.
- Select the Credit Memo from the drop-down list under Define Reason Codes.
- Click Add New Reason Code, enter your customized reason code, for example, "Delivery Complaint", and click Save.
- Navigate to Billing > Default Subscription and Order Settings.
- In the Default Subscription Settings section, click Edit.
- In the row of the Default Reason Code for Credit Memo created by Delivery Adjustment setting, select your customized reason code from the drop-down list. The default reason code will be used for all credit memos generated through delivery adjustment creation. Once selected, you cannot edit or deactivate the reason code from Payments > Configure Reason Codes.
After completing all prerequisite tasks, you can create delivery adjustments through Zuora UI or API.
Create delivery adjustments using the Zuora UI
To create delivery adjustments using the Zuora UI, complete the following steps:
-
Navigate to the subscription details page, click the More option icon on the top right, and select the Create New Adjustment option.
-
Enter the following fields:
Field Description Start Date Required. In this example, the start date of the delivery adjustment is
2023-04-01
.Your start and end dates could be any dates in the past and today, the default number of days eligible for adjustment is 14 days. To change the number of days, submit a request to Zuora Global Support.
End Date In this example, the end date of the delivery adjustment is 2023-04-02
.
In our example, the delivery adjustments are created from 2023-04-01 to 2023-04-02. However, if you create a new delivery adjustment only for one day, you only need to specify the adjustment start date without specifying this field.
Reason The reason for creating the delivery adjustment
-
Optional. In the Finance Information area, specify the following fields from the corresponding drop-down lists.
For the credit memo generated by the delivery adjustment, if the following options are not specified, the values inherit from the subscription rate plan charge.
Field Description Revenue Recognition Rule
The name of the revenue recognition rule governing the revenue scheduleDeferred Revenue Accounting Code The accounting code for the deferred revenue, such as Monthly Recurring Liability Recognized Revenue Accounting Code The accounting code for the recognized revenue, such as Monthly Recurring Charges or Overage Charges - Click Create Delivery Adjustment. The Created Delivery Adjustment Result page pops up.
-
Ineligible delivery adjustments are indicated by the Failed status. You can hover over the red Failed icon to display the detailed failure reason.
-
Eligible delivery adjustments are listed with the following information:
Field Description Adjustment Number The system-generated delivery adjustment number Delivery Date The delivery adjustment creation date Reason The reason for creating the delivery adjustment Product Name The product name Rate Plan Name The product rate plan name Charge Name The product rate plan charge name and number for which delivery adjustments are created Amount The amount of the delivery adjustment Credit Memo Number The number of the credit memo generated for the delivery adjustment Status The delivery adjustments are in Billed status
-
- Do one of the following:
-
Click Go To The Delivery Adjustment List page.
-
Click Stay On Current Page to close the pop-up page.
-
Preview and create delivery adjustments using the API
To preview and create delivery adjustments using the API, complete the following steps:
-
Verify eligible and ineligible delivery adjustments for the subscription through the Preview an adjustment operation, specifying the start date and end date of the adjustment period as 2023-04-01 and 2023-04-02, respectively, and then decide whether to create new delivery adjustments. If yes, perform the next step.
-
Determine the values of the following variables:
Variable Description subscriptionNumber The subscription number for which the delivery adjustments are created.
You can also specify the
accountNumber
field instead of this field. If you specify an account number, the account number must be of the subscription owner.chargeNumbers The charge numbers in the subscription for which the delivery adjustment needs to be created.
If you don’t specify a charge number, delivery adjustments are created for all charges in the specified subscription or account.
startDate Required. In this example, the start date of the delivery adjustment is 2023-04-01
.endDate Required. In this example, the end date of the delivery adjustment is
2023-04-02
.exclusion In case you don’t want to create delivery adjustments for other rate plan charges in the same subscription or account, you can use this field to exclude these charges from your adjustment. You must specify the charge numbers and the corresponding dates for excluding the charges, using the following nested fields:
chargeNumbers
: The charge numbers to be excluded from delivery adjustment on the specified delivery date.deliveryDate
: The date on which the delivery adjustment has to be excluded, inyyyy-mm-dd
format.
In this example, the charges you want to exclude from the adjustment may be the charges whose delivery dates are
2023-04-01
and2023-04-02
.type The value is DeliveryCredit
. -
Use the Create a delivery adjustment operation to create two delivery adjustments for 2023-04-01 and 2023-04-02 for the subscription.
Request POST /v1/adjustments
Request Body { "chargeNumbers": [ "C-00000210", "C-00000211" ], "deferredRevenueAccountingCode": "Unearned Revenues", "endDate": "2023-04-02", "exclusion": [ { "chargeNumbers": [ "C-00000212", "C-00000213" ], "deliveryDate": "2023-04-01" }, { "chargeNumbers": [ "C-00000212", "C-00000213" ], "deliveryDate": "2023-04-02" } ], "reason": "string", "recognizedRevenueAccountingCode": "Earned Revenues", "revenueRecognitionRuleName": "recognized upon invoice", "startDate": "2023-04-01", "subscriptionNumber": "SM-00002", "type": "DeliveryCredit", "creditMemoCustomFields": { "someField__c": "string" } }
API process result
After your operations, Zuora proceeds with the following steps:
- Creates two delivery adjustments. Each is a one-day adjustment, and the first adjustment amount is 2 USD and the second adjustment amount is 5 USD.
- Creates two credit memos, each for a delivery adjustment, then posts the credit memos.
The result of a delivery adjustment depends on whether the credit memo generation succeeds, as follows:
- If succeeded, the credit memo status changes to
Posted
and the delivery adjustment status changes toBilled
. The applied amount of the credit memo equals the delivery adjustment amount, and the service period of the credit memo equals the adjustment period. - If failed, the failure is returned in the response, and no delivery adjustment is created.