Adding a Standard Billing Schedule

This example shows how to create a standard billing schedule. In this example, the frequency field is set to custom and recurrence sublist lines are created. Both of these conditions are required to populate the recurrence sublist. For more details, see Recurrence Sublist.

Because the request includes recurrence sublist lines, it is not necessary to set the numberRemaining body field. In fact, if you try to set a value for numberRemaining in this scenario, your input is ignored. In the user interface, the numberRemaining field is labeled Recurrence Count.

Java

          // Create billing schedule object.

BillingSchedule myBillingSchedule = new BillingSchedule();


// Set scheduleType and other needed body fields.

myBillingSchedule.setScheduleType(BillingScheduleType._standard);
myBillingSchedule.setFrequency(BillingScheduleFrequency._custom);
myBillingSchedule.setName("With recurrence sublist");
myBillingSchedule.setExternalId("1201A");
myBillingSchedule.setInitialAmount("500.00");


// Create the sublist and populate it with two lines.

BillingScheduleRecurrenceList myBillingScheduleRecurrenceList = new BillingScheduleRecurrenceList();
BillingScheduleRecurrence[] myBillingScheduleRecurrence = new BillingScheduleRecurrence[2];

myBillingScheduleRecurrence[0] = new BillingScheduleRecurrence();
myBillingScheduleRecurrence[0].setCount(3L);
myBillingScheduleRecurrence[0].setUnits(BillingScheduleRecurrenceRecurrenceUnits._months);
myBillingScheduleRecurrence[0].setAmount(10.0);

myBillingScheduleRecurrence[1] = new BillingScheduleRecurrence();
myBillingScheduleRecurrence[1].setCount(2L);
myBillingScheduleRecurrence[1].setUnits(BillingScheduleRecurrenceRecurrenceUnits._weeks);
myBillingScheduleRecurrence[1].setAmount(15.0);

myBillingScheduleRecurrenceList.setBillingScheduleRecurrence(myBillingScheduleRecurrence);
myBillingSchedule.setRecurrenceList(myBillingScheduleRecurrenceList);


// Execute the operation.

ns._port.add(myBillingSchedule); 

        

SOAP Request

          <soapenv:Body>
   <add xmlns="urn:messages_2017_1.platform.webservices.netsuite.com">
      <record xsi:type="ns1:BillingSchedule" externalId="1201A" xmlns:ns1="urn:accounting_2017_1.lists.webservices.netsuite.com">
         <ns1:scheduleType xsi:type="ns2:BillingScheduleType" xmlns:ns2="urn:types.accounting_2017_1.lists.webservices.netsuite.com">_standard</ns1:scheduleType>
         <ns1:name xsi:type="xsd:string">With recurrence sublist</ns1:name>
         <ns1:initialAmount xsi:type="xsd:string">500.00</ns1:initialAmount>
         <ns1:frequency xsi:type="ns3:BillingScheduleFrequency" xmlns:ns3="urn:types.accounting_2017_1.lists.webservices.netsuite.com">_custom</ns1:frequency>
         <ns1:recurrenceList xsi:type="ns1:BillingScheduleRecurrenceList" replaceAll="false">
            <ns1:billingScheduleRecurrence xsi:type="ns1:BillingScheduleRecurrence">
               <ns1:count xsi:type="xsd:long">3</ns1:count>
               <ns1:units xsi:type="ns4:BillingScheduleRecurrenceRecurrenceUnits" xmlns:ns4="urn:types.accounting_2017_1.lists.webservices.netsuite.com">_months</ns1:units>
               <ns1:amount xsi:type="xsd:double">10.0</ns1:amount>
            </ns1:billingScheduleRecurrence>
            <ns1:billingScheduleRecurrence xsi:type="ns1:BillingScheduleRecurrence">
               <ns1:count xsi:type="xsd:long">2</ns1:count>
               <ns1:units xsi:type="ns5:BillingScheduleRecurrenceRecurrenceUnits" xmlns:ns5="urn:types.accounting_2017_1.lists.webservices.netsuite.com">_weeks</ns1:units>
               <ns1:amount xsi:type="xsd:double">15.0</ns1:amount>
            </ns1:billingScheduleRecurrence>
         </ns1:recurrenceList>
      </record>
   </add>
</soapenv:Body> 

        

SOAP Response

          <soapenv:Body>
   <addResponse xmlns="urn:messages_2017_1.platform.webservices.netsuite.com">
      <writeResponse>
         <platformCore:status isSuccess="true" xmlns:platformCore="urn:core_2017_1.platform.webservices.netsuite.com"/>
         <baseRef xsi:type="platformCore:RecordRef" type="billingSchedule" externalId="1201A" internalId="98" xmlns:platformCore="urn:core_2017_1.platform.webservices.netsuite.com"/>
      </writeResponse>
   </addResponse>
</soapenv:Body> 

        

Related Topics

Billing Schedule
Billing Schedule Types
Billing Schedule Body Fields and Sublist Fields
Billing Schedule Supported Operations
Billing Schedule Code Samples
add
SuiteTalk SOAP Web Services Platform Overview
Enabling Advanced Billing
Creating Billing Schedules

General Notices