Import mass usage records
Learn how to import mass usage records into Zuora using the SOAP API, including prerequisites, setup, and handling potential errors.
You should have experience with web services client side programming and Java and XML handling to perform this task.
Download Zuora`s Java sample code and make sure the mail-1.4.jar file is included in the lib directory. You can download this file from the Oracle website. It is also included in the Axis package and in Zuora`s sample code package. We have tested mail-1.4.jar, but the latest version 1.4.5 should also work.
Download the latest Zuora WSDL. You must be using WSDL version 37.0 or higher.
Use the
ant clean
andant setup
commands to generate the Zuora Web Service Axis Stub. Use the instructions in thereadme.txt
file included with the sample code to run theant
command. To connect the server, generate the web service stub in the client side as the proxy to connect to the remote web service.Verify that you can find the
ZuoraServiceStub.Import
file inZuoraServiceStub.java
.If your programming language is not Java or if you are not using the Axis as the web service client, see the documentation for the language or tool that you are using for information about handling the SOAP message attachment with MTOM.
You can combine your mass usage records into a single file, and use the SOAP API call to create an Import object to import the file. The file is added as the attachment in the SOAP and transferred to the Zuora application server using Message Transmission Optimization Mechanism (MTOM).
4 MB (4,94304 bytes or 4096 KB) is the size limit for the import file.
To upload usage files through the Zuora API:
The create() call will return the import ID if the import is successful, or an error message if the usage import fails.
If the import fails, every result includes a message describing the reason the create() call failed.
Validation exception: Cannot detect the file name from your Content-Type. Use the
name
parameter to provide the file name.Validation exception: File MD5 verification error.
Validation exception: The import file exceeds the maximum file size of 4,194,304 bytes.
Validation exception: The zip file cannot contain a directory.