Subscribe
From API Documentation
NOTE: In versions 11.0+, you can use subscribe() call to create with subscriptions for accounts that already exist. subscribeWithExistingAccount is now merged with subscribe() call.
Contents |
Overview
The subscribe call is a combined call that you can use to do all of the following in a single call. This call bundles the information required to create one or more new subscriptions.
- Create accounts
- Create contacts
- Create payment methods
- Apply the first payment to a subscription
Syntax and Arguments
subscribe(SubscribeRequest[])
The argument is as shown in the following table. For information on the field types, see Field Types.
| Argument | Description |
|---|---|
| SubscribeRequest[] | An array of one or more objects of type zObject. |
Using the subscribe Call
This call performs a large number of actions. It takes in an array of SubscribeRequests. Because it takes an array, you can submit a batch of subscription requests at once. Note that If the effective date is in the future there won't be any invoice generation, and hence there will be no invoice number.
Both the create and subscribe calls will create a new account; however, there are differences between the two calls:
- To create an account without creating a subscription, use the create call.
- To create an account, you cannot create a subscription for that account.
- To create the account along with the subscription and the initial payment information, use the subscribe call.
Subscription Preview
You can preview invoices that would be generated by the subscribe() call. See Subscribe Preview for more information.
Invoice Subscriptions Separately
If you have enabled the invoice subscriptions separately feature, a subscribe will generate an invoice for each subscription for every subscription where the field IsInvoiceSeparate is set to true.
If the invoice subscriptions separately feature is disabled, a subscribe call will generate a single invoice for all subscriptions.
See Invoice Subscriptions Separately for more information.
Response
Returns an array of SubscribeResult.
Faults
Sample Code
See the sample code for XML, PHP, Java and .NET.
