Use the create() call to create one or more objects of a specific type. You can specify different types in different create() calls, but each create() call must apply to only one type of object. This SOAP API reference includes syntax, call wrappers and container descriptions, requirements, and examples.
50 objects are supported in a single call.
SaveResult = create(zObject)
The call takes the following arguments.
|zObject||An array of one or more objects of type zObject.|
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:
Both the create() and subscribe() calls will create a new account. However, there are differences between the calls.
Use the create() call to create an account independent of a subscription.
Use the subscribe() to create the account with the subscription and the initial payment information.
See subscribe() for more information.
The CallOptions complex type is used when using the create() call with an amendment. It is only used in versions 25.0+ of the API, and is used when creating amendments in a single call. This insures that if one of the operations fails (either create or activate), the entire action will be rolled back.
See the CallOptions complex type for more information.
// 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; objs = acc; Create create = new Create(); create.setZObjects(objs); CreateResponse resp = stub.create(create, this.header); SaveResult res = resp.getResult(); ID accountId = res.getId();