Skip to main content

Order Builder Reference

Zuora

Order Builder Reference

Overview

This article presents the overview of the Order Builder classes and methods that are described in the articles following.

The article in this section assume that:

  • You have the experience with development on the Force.com platform.
  • You are familiar with Zuora functionality and the Zuora SOAP API.

Order Builder Apex Methods

Order Builder supports many of the calls used in the Zuora SOAP API, and exposes them as "Apex wrapper methods". You can access these methods through the zApi class once you've installed the Zuora 360 managed package in your Salesforce org.

All components of the Zuora 360 managed package are prefixed with the "Zuora" namespace qualifier.

Order Builder supports the following Zuora SOAP API calls:

Zuora SOAP API Call Order Builder Apex Method Description
login() Zuora.zApi.zlogin() Logs in to the API service
create() Zuora.zApi.zcreate() Creates one or more objects of a specified type
update() Zuora.zApi.zupdate() Updates the information in one or more objects of the same type
query()   Zuora.zApi.zquery() Executes a ZOQL query
queryMore() Zuora.zApi.zqueryMore() Retrieves additional results for a ZOQL query
delete() Zuora.zApi.zdelete() Deletes one or more objects of the same type
subscribe() Zuora.zApi.zsubscribe() Creates a subscription and, optionally, related objects such as account, invoice
amend() Zuora.zApi.zamend() Changes a subscription
generate() Zuora.zApi.zgenerate() Invoices specified account(s) on demand

Additional non-API methods and classes are also available. See the articles in this section for more information.

Unsupported Calls

The subscribeWithExistingAccount() call is not supported.

Order Builder Apex Classes

The Zuora 360 managed package includes the following global classes that you can use to invoke the Order Builder methods.

Exception Classes

The following Exception classes are supported in Order Builder:

  • zWSDLException
  • zRemoteException
  • zForceException
  • zAPIException

The above exeption classes have the following attributes of String type:

  • code
  • message

Unit Tests and Code Coverage

The Apex code that you develop using the Order Builder must be tested. Salesforce requires the creation and execution of unit tests to facilitate and promote the development of robust, error-free code. In addition, Salesforce also requires that test methods must provide at least 75% code coverage.

Order Builder requires you to declare your test classes and test methods with the following annotation to grant test classes and individual test methods access to all data in the organization:

isTest(SeeAllData=true)

If the annotationisTest(SeeAllData=false)is configured, the WSDL file will be inaccessible to the Order Builder, resulting in the following error: Zuora.zAPIException: Please upload Zuora WSDL at first.

For more information, see the Salesforce documentation, Testing Apex.