You are here: API Reference > Calls > create

create

Use create to create one or more objects of a specific type. You can specify different types in different create calls, but each create call must only apply to one type of object.

Syntax and Argument

SaveResult[] = create(zObject[])

The argument is as shown in the following table. For information on the field types, see Field Types.

Argument Description
zObject[] An array of one or more objects of type zObject.

Using This Call

You can call create on an array of one or more zObjects. It returns an array of SaveResults indicating the success or failure of creating each object. The following information applies to this call:

Important!

Both the create and subscribe calls will create a new account; however, there are differences.

Response

SaveResult

Faults

InvalidTypeFault

UnexpectedErrorFault

Sample Code

// create account
Account acc = new Account();
acc.setName("Test Account");
acc.setBatch("Batch1");
acc.setBillCycleDay(1);
acc.setAllowInvoiceEdit(true);
acc.setCurrency("USD");
acc.setStatus("Draft");
ZObject[] objs = new ZObject[1];
objs[0] = acc;
Create create = new Create();
create.setZObjects(objs);
CreateResponse resp = stub.create(create, this.header);
SaveResult[] res = resp.getResult();
ID accountId = res[0].getId();

See Also

Creating a New Active Account with the create Call

SaveResult

Copyright © 2008-2009 Zuora, Inc.