Sign Up Customers
Suppose that a new customer wants to subscribe to one of your products. This task includes the following sequential subtasks:
- The subscriber creates a new account or sign in to their account.
- The subscriber enters their payment method information on the checkout page.
- Your site authenticates the card details and returns a reference code.
- Your site sends the request (account ID, customer details, payment reference code, contact, plan to subscribe) to Zuora.
- Zuora handles the subscription flow and returns the sign-up result to your site.
Zuora offers a Sign up operation that allows you to perform the following tasks in one call:
- Create an account
- Create a payment method
- Create a subscription
- Generate an invoice
- Collect payment
Note that this easy sign-up API is scenario-based. Do not use it if the subscribers want to:
- Only create accounts and do not need to subscribe to any products immediately. Find instructions in Create an Account for this case.
- Only create payment methods for an existing account. Find instructions in Create payment methods for this case.
- Only create subscriptions for an existing account. Find instructions in Create subscriptions for this case.
In this guide, you will learn:
- How to set up an account for new customers, create a subscription, create invoice if needed and capture the payment if auth id is provided.
Step 1. Generate an OAuth token
See Create an OAuth token for details.
Step 2. Sign up a customer by using the "Sign up" API operation
The following cURL code sample performs the following tasks:
- Creates an account with account number AC-11001 and owned by "John Smith"
- Creates a PayPal Express Checkout payment method associated with the account
-
Creates a subscription to the product rate plan where
productRatePlanId
=8a90a9b784ae5f180184c6c4650446a1
-
Generate invoice automatically by setting
runBilling
=true
-
Collect payment automatically by setting
collectPayment
=true
curl --location --request POST 'https://rest.zuora.com/v1/sign-up' \
--header 'Authorization: Bearer ea5e5d28d03a4ed2892d4c22a80e858d' \
--header 'Content-Type: application/json' \
--data-raw '{
"accountData": {
"accountNumber": "AC-11001",
"name": "John Smith",
"currency": "USD",
"notes": "Online Payment",
"billCycleDay": 31,
"crmId": "SAP-LSCRM-01111",
"autoPay": true,
"billToContact": {
"address1": "1051 E Hillsdale Blvd",
"city": "Foster City",
"country": "United States",
"firstName": "John",
"lastName": "Smith",
"state": "CA",
"workEmail": "smith@example.com",
"zipCode": "94404",
"otherPhone": "",
"otherPhoneType": "Mobile",
"personalEmail": "user@example.com",
"postalCode": "00000",
"taxRegion": "",
"workPhone": ""
},
"soldToContact": {
"address1": "1051 E Hillsdale Blvd",
"city": "Foster City",
"country": "United States",
"firstName": "John",
"lastName": "Smith",
"state": "CA",
"workEmail": "smith@example.com",
"zipCode": "94404"
"otherPhone": "",
"otherPhoneType": "Mobile",
"personalEmail": "user@example.com",
"postalCode": "00000",
"taxRegion": "",
"workPhone": ""
},
"paymentMethod": {
"type": "PayPalEC"
}
},
"subscriptionData": {
"subscriptionNumber": "SUB-00000001",
"ratePlans": [
{
"productRatePlanId": "8a90a9b784ae5f180184c6c4650446a1"
}
],
"terms": {
"initialTerm": {
"startDate": "2022-11-29",
"period": 0,
"periodType": "Month",
"termType": "TERMED"
},
"renewalTerms": [
{
"period": 0,
"periodType": "Month"
}
],
"renewalSetting": "RENEW_WITH_SPECIFIC_TERM",
"autoRenew": true
},
"startDate": "2022-11-29",
"invoiceSeparately": true,
"notes": ""
},
"accountIdentifierField": "1",
"options": {
"runBilling": true,
"collectPayment": true,
"billingTargetDate": "2022-11-29",
"maxSubscriptionsPerAccount": 0
}
}'
Step 3. Verify the result
After the sign-up process is done, you can verify the result in the Zuora UI or through the GET API operations for the Account object and Subscription object.
To verify the result through the Zuora UI, you can find the created account displayed at the top of the All Customer Accounts page by navigating to Customers > Customer Accounts in the Zuora UI.
To verify the result through the API, See Retrieve Object Information for details.