Creating Usages

From API Documentation

Jump to: navigation, search

In this use case, usage will be created programmatically for an account.

To create a Usage object:

Set the following fields:

  • Specify the AccountId or AccountNumber. One of these values is required when creating usage.
  • Set the Quantity.
  • Set the StartDateTime. Please note that this date/time specifies which billing period this usage will be counted under.
  • Set the UOM (Unit of Measure). This must match one of the UOM's configured in the Zuora tenant.

Next, create the new usage object. See the create() API call.

Note: This use case uses the minimum required fields. Other fields, like SubscriptionNumber or ChargeNumber, may be required for proper processing.

The SOAP call envelope payload should look like the following:

<ns1:create>
 <ns1:zObjects xsi:type="ns2:Usage">
   <ns2:AccountId>4028e485225d1d5f0122662fd6b249c8</ns2:AccountId>
   <ns2:Quantity>500</ns2:Quantity>
   <ns2:StartDateTime>2009-11-04T15:00:00</ns2:StartDateTime>
   <ns2:UOM>Each</ns2:UOM>
 </ns1:zObjects>
</ns1:create>