New Student

New REST API document and sample code

Hello,

 

I have been integrating your new REST API into our solution and using the codelibrary-dot net starter kit that is provide by Zuora. Here are some reference links:

 

https://github.com/zuora
Code library - https://github.com/zuora/codelibrary-dotnet

 

So far I have had great success with the code libraries and the new REST interface. It seems a bit faster than SOAP. However, I think there is a (documentation) problem with some of the required fields when creating an account via CRUD. If you want to create an account, the first thing you do is create a ProxyCreateAccount object. This object requires BALANCE field, as per the documentation here:

 

https://www.zuora.com/developer/api-reference/#operation/Object_POSTAccount

 

The ProxyCreateAccount enforces this requirement and will not allow null values in the constructor:

 

// to ensure "Balance" is required (not null)
if (Balance == null)
{
      throw new InvalidDataException("Balance is a required property for ProxyCreateAccount and cannot be null");
}
else
{
      this.Balance = Balance;
}

 

Note: The functionality in the constructor above matches the documentation - which says the field is required. However, if you actually try to submit a new account request when the Balance field specified, it will error. This makes sense, it is an autogenerated field. It is similar to other required balance fields (invoice balance, credit balance). They are marked as required, but they are required to be absent for a new account. 

 

I got past this easily - simply comment out the code in the constructor that would require it. When I did this, the accounts created without issue.

 

Note: I recognize that the code codelibrary is "as is" - so far it has been great. The intent here is just to improve things.

 

Thanks,

Dirk