Skip to main content

How do I add custom fields to my WSDL?

Zuora

How do I add custom fields to my WSDL?

Overview

Custom fields can be used with many objects in Z-Billing and Z-Payments. This article provides best practices and considerations when adding custom fields to the WSDL. See  Zuora WSDL for instructions on how to upload the latest WSDL. 

As of Zuora WSDL v61.0, downloading the WSDL supports custom fields. Re-adding custom fields after downloading the WSDL is no longer required.

Solution

 When adding custom fields to the WSDL, the custom fields must conform to the following rules:

  • Custom field names must append __c (double underscore and lowercase 'c') to the end of all custom field names (not display names)
  • The custom field name may not contain spaces
  • The custom field must be of type string
  • Custom fields must be added to the existing fields in alphabetical order

Example: If you have created two custom fields (MyCustomAccountField and AnotherCustomAccountField) for the account object, the field names in the WSDL should be:

  • AnotherCustomAccountField__c
  • MyCustomAccountField__c

Your WSDL for the Account object would look like the following with the custom fields in line 08 and line 23 respectively: 

<complexType name="Account">
  <complexContent>
     <extension base="ons:zObject">
        <sequence>
           <element minOccurs="0" name="AccountNumber" nillable="true" type="string" />
           <element minOccurs="0" name="AdditionalEmailAddresses" nillable="true" type="string" />
           <element minOccurs="0" name="AllowInvoiceEdit" nillable="true" type="boolean" />
           <element minOccurs="0" name="AnotherCustomAccountField__c" nillable="true" type="string" />
           <element minOccurs="0" name="AutoPay" nillable="true" type="boolean" />
           <element minOccurs="0" name="Balance" nillable="true" type="double" />
           <element minOccurs="0" name="Batch" nillable="true" type="string" />
           <element minOccurs="0" name="BillCycleDay" type="int" />
           <element minOccurs="0" name="BillToId" nillable="true" type="zns:ID" />
           <element minOccurs="0" name="CreatedDate" nillable="true" type="dateTime" />
           <element minOccurs="0" name="CrmId" nillable="true" type="string" />
           <element minOccurs="0" name="Currency" nillable="true" type="string" />
           <element minOccurs="0" name="CustomerServiceRepName" nillable="true" type="string" />
           <element minOccurs="0" name="DefaultPaymentMethodId" nillable="true" type="zns:ID" />
           <element minOccurs="0" name="Gateway" nillable="true" type="string" />
           <element minOccurs="0" name="InvoiceDeliveryPrefsEmail" nillable="true" type="boolean" />
           <element minOccurs="0" name="InvoiceDeliveryPrefsPrint" nillable="true" type="boolean" />
           <element minOccurs="0" name="InvoiceTemplateId" nillable="true" type="zns:ID"  />
           <element minOccurs="0" name="MyCustomAccountField__c" nillable="true" type="string" />
           <element minOccurs="0" name="Name" nillable="true" type="string" />
           <element minOccurs="0" name="Notes" nillable="true" type="string" />
           <element minOccurs="0" name="PaymentTerm" nillable="true" type="string" />
           <element minOccurs="0" name="PurchaseOrderNumber" nillable="true" type="string" />
           <element minOccurs="0" name="SalesRepName" nillable="true" type="string" />
           <element minOccurs="0" name="SoldToId" nillable="true" type="zns:ID" />
           <element minOccurs="0" name="Status" nillable="true" type="string" />
           <element minOccurs="0" name="UpdatedDate" nillable="true" type="dateTime" />
        </sequence>
     </extension>
  </complexContent>
</complexType>