You are here: API Foundations > Use Cases > Invoking the subscribe Call

Invoking the subscribe Call

For information on this topic, see subscribe. Essentially, first you populate all the data (account, contact, payment method, etc.), then you call subscribe.

Important!

Both the create and subscribe calls will create a new account; however, there are differences.

To use the subscribe call,

  1. Populate all the required fields for the Account object.
  2. Populate all the required fields for the Contact object to be used as the BillTo.
  3. Populate all the required fields for the Contact object to be used as the SoldTo. If this is not set,the BillTo will also be used as the SoldTo contact.
  4. Populate all the required fields for the PaymentMethod object.
  5. Populate all the required fields for the SubscriptionData object. This includes the following tasks:
    1. Populate all the required fields for the Subscription object.
    2. Populate all the required fields for the RatePlan object. Use a valid ID for ProductRatePlanId.
    3. Populate all the required fields for the RatePlanCharge objects that needs to be updated for Name or Quantity. Use a valid ID for ProductRatePlanChargeId. If no RatePlanCharge objects are passed, the default RatePlanCharges will copied from the RatePlan object whose ID is passed in the RatePlan object in step b.
  6. Create a SubscribeRequest object and set all the objects created in the previous steps.
  7. Call the subscribe method, passing in the SubscribeRequest object and the SessionHeader object returned by the login call.
  8. A SubscribeResponse object is returned. Get the SubscribeResult object from the returned response object and check for the value of the success field.
    1. If the success value is true, read the other values returned in the SubscribeResult such as the AccountId, AccountNumber, SubscriptionId, SubscriptionNumber, InvoiceNumber, PaymentTransactionNumber.
    2. If the success value is false, then process the Errors by getting the Code and Message from the Error objects.

See Also

subscribe

Copyright © 2008-2009 Zuora, Inc.