The article describes the Order Builder
zamend() method. The
zamend() method uses the Zuora amend() method to apply amendments to a single subscription.
Zuora.zApi.AmendResult zamend ( List<Zuora.zApi.AmendRequest> amendRequests)
zamend() method takes the following input parameter.
|A list of the
AmendRequest object containing amendments for a single subscription.
Only one subscription can be amended per call. Thus the method accepts only one
AmendRequest, which can contain the
Amendment objects up to the following:
- For WSDL versions 69+: Up to ten Amendment objects
- For WSDL versions 42.0 through 68: Up to three Amendment objects
- For WSDL versions 29.0 through 41.0: Only one Amendment object
AmendOptions is used to provide the parameter values for amend options for the amend() call. It includes the following properties.
true if you want Zuora to generate an invoice after the
amend()call to immediately bill the customer for the new product.
true if you want Zuora to collect payment against the invoice. Note that the Account must have the AutoPay setting set to
|Specifies whether, and how, an invoice should be generated for a new amendment.
InvoiceProcessingOptions is used to provide the parameter values for the invoice processing options for the amend() call. It includes the following properties.
|Specifies a date for when an invoice should be generated.
|Specifies the date on which to generate the invoice. (WSDL 49.0+).
zApi.PreviewOptions is used to provide the parameter values for the preview options for the amend() call. It includes the following properties.
|Specifies whether the call should create a subscription/amendment, or whether it should return a preview of the order.
|Specifies the number of periods to show in a preview.
zamend() method returns a single
Zuora.zApi.AmendResult object that provides the results for the
Zuora.zApi.AmendResult has the following properties.
|The ID of the Amendment objects.
|An array of errors indicating why the amend request may have failed.
|A wrapper for an invoice and its line items. This field is returned only when settingPreviewMode for amend() to true.
|The system-generated Zuora invoice ID for the created Account.
|A payment transaction number associated with this amendment.
|Id of the subscription.
|Indicates whether the amend request succeeded (true) or did not succeed (false).
zamend() method uses the following exception classes to catch an exception when an error occurs in the call:
See the sample code at Github that demonstrates using the Order Builder
zApi.zAmend() call to implement the following use cases:
- Create an "Add New Product" amendment. Add a product rate plan that has two charges: a one-time charge and a monthly recurring charge.
- Preview the invoice for the next two months.