Create an account

Creates a customer account with a payment method, a bill-to contact, and an optional sold-to contact. Request and response field descriptions and sample code are provided. Use this operation to optionally create a subscription, invoice for that subscription, and collect payment through the default payment method. The transaction is atomic; if any part fails for any reason, the entire transaction is rolled back.

This operation is CORS Enabled, so you can use client-side Javascript to invoke the call.

Notes

  1. The account is created in active status.
  2. If the autoPay field is set to true in the request, you must provide one of the paymentMethod, creditCard, or hpmCreditCardPaymentMethodId field, but not multiple. The one provided becomes the default payment method for this account. If the credit card information is declined or cannot be verified, no account is created.
  3. Customer accounts created with this call are automatically be set to Auto Pay.
  4. If either the workEmail or personalEmail field is specified, then the account's email delivery preference is automatically set to true. (In that case, emails go to the workEmail address, if it exists, or else the personalEmail.) If neither field is specified, the email delivery preference is automatically set to false.

Defaults for customerAcceptanceDate and serviceActivationDate

Default values for customerAcceptanceDate and serviceActivationDate are set as follows.

serviceActivationDate(SA) specified serviceActivationDate (SA) NOT specified
customerAcceptanceDate (CA) specified SA uses value in the request call; CA uses value in the request call CA uses value in the request call;SA uses CE as default
customerAcceptanceDate (CA) NOT specified SA uses value in the request call; CA uses SA as default SA and CA use CE as default
Request
header Parameters
Idempotency-Key
string <= 255 characters

Specify a unique idempotency key if you want to perform an idempotent POST or PATCH request. Do not use this header in other request types.

With this header specified, the Zuora server can identify subsequent retries of the same request using this value, which prevents the same operation from being performed multiple times by accident.

Accept-Encoding
string

Include the Accept-Encoding: gzip header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response.

If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a Content-Encoding header with the compression algorithm so that your client can decompress it.

Content-Encoding
string

Include the Content-Encoding: gzip header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload.

Authorization
string

The value is in the Bearer {token} format where {token} is a valid OAuth token generated by calling Create an OAuth token.

Zuora-Track-Id
string <= 64 characters

A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue.

The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (:), semicolon (;), double quote ("), and quote (').

Zuora-Entity-Ids
string

An entity ID. If you have Zuora Multi-entity enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header.

zuora-version
string

The minor version of the Zuora REST API.

You only need to set this parameter if you use the following fields:

  • invoice
  • collect
  • runBilling
  • targetDate
Request Body schema: application/json
accountNumber
string

A unique account number, up to 50 characters that do not begin with the default account number prefix. If no account number is specified, one is generated.

additionalEmailAddresses
Array of strings

A list of additional email addresses to receive email notifications. Use commas to separate email addresses.

applicationOrder
Array of strings

The priority order to apply credit memos and/or unapplied payments to an invoice. Possible item values are: CreditMemo, UnappliedPayment.

Note:

  • This field is valid only if the applyCredit field is set to true.
  • If no value is specified for this field, the default priority order is used, ["CreditMemo", "UnappliedPayment"], to apply credit memos first and then apply unapplied payments.
  • If only one item is specified, only the items of the spedified type are applied to invoices. For example, if the value is ["CreditMemo"], only credit memos are used to apply to invoices.
applyCredit
boolean

Whether to automatically apply credit memos or unapplied payments, or both to an invoice.

If the value is true, the credit memo or unapplied payment, or both will be automatically applied to the invoice. If no value is specified or the value is false, no action is taken.

Note: This field is only available if you have Invoice Settlement enabled. The Invoice Settlement feature is generally available as of Zuora Billing Release 296 (March 2021). This feature includes Unapplied Payments, Credit and Debit Memo, and Invoice Item Settlement. If you want to enable Invoice Settlement, see Invoice Settlement Enablement and Checklist Guide for more information.

applyCreditBalance
boolean

Applies a credit balance to an invoice.

If the value is true, the credit balance is applied to the invoice. If the value is false, no action is taken.

Prerequisite: invoice must be true.

To view the credit balance adjustment, retrieve the details of the invoice using the Get Invoices method.

Note:

  • If you are using the field invoiceCollect rather than the field invoice, the invoiceCollect value must be true.
  • This field is deprecated if you have the Invoice Settlement feature enabled.
autoPay
boolean

Whether future payments are to be automatically billed when they are due.

  • If this field is set to true, you must specify either the creditCard field or the hpmCreditCardPaymentMethodId field, but not both.
  • If this field is set to false, you can specify neither the creditCard field nor the hpmCreditCardPaymentMethodId field.
batch
string

The alias name given to a batch. A string of 50 characters or less.

billCycleDay
integer <int64>

The account's bill cycle day (BCD), when bill runs generate invoices for the account. Specify any day of the month (1-31, where 31 = end-of-month), or 0 for auto-set.

Required if no subscription will be created.

Optional if a subscription is created and defaults to the day-of-the-month of the subscription's contractEffectiveDate.

required
object (Contact)

Container for bill-to contact information for this account. If you do not provide a sold-to contact, the bill-to contact is copied to sold-to contact. Once the sold-to contact is created, changes to billToContact will not affect soldToContact and vice versa.

collect
boolean
Default: true

Collects an automatic payment for a subscription. The collection generated in this operation is only for this subscription, not for the entire customer account.

If the value is true, the automatic payment is collected. If the value is false, no action is taken.

Prerequisite: The invoice or runBilling field must be true.

Note: This field is only available if you set the zuora-version request header to 196.0 or later.

communicationProfileId
string

The ID of a communication profile.

object (creditCard)

Note: This field has been deprecated, and is currently available only for backward compatibility. Use the paymentMethod field instead to create a payment method associated with this account.

Container for information on a credit card to associate with this account. If the autoPay field is set to true, you must provide one of the paymentMethodcreditCard, or hpmCreditCardPaymentMethodId field, but not multiple.

After a credit card payment method is created, it is recommended to enable the support for stored credential transactions for this payment method. See Migrate an existing payment method for stored credential transactions or Migrate all existing payment methods for stored credential transactions for more information.

creditMemoReasonCode
string

A code identifying the reason for the credit memo transaction that is generated by the request. The value must be an existing reason code. If you do not pass the field or pass the field with empty value, Zuora uses the default reason code.

creditMemoTemplateId
string

Note: This field is only available if you have Invoice Settlement enabled. The Invoice Settlement feature is generally available as of Zuora Billing Release 296 (March 2021). This feature includes Unapplied Payments, Credit and Debit Memo, and Invoice Item Settlement. If you want to enable Invoice Settlement, see Invoice Settlement Enablement and Checklist Guide for more information.

The unique ID of the credit memo template, configured in Billing Settings > Manage Billing Document Configuration through the Zuora UI. For example, 2c92c08a6246fdf101626b1b3fe0144b.

crmId
string

CRM account ID for the account, up to 100 characters.

currency
required
string

A currency as defined in Billing Settings in the Zuora UI.

For payment method authorization, if the paymentMethod > currencyCode field is specified, currencyCode is used. Otherwise, this currency field is used for payment method authorization. If no currency is specified for the account, the default currency of the account is then used.

debitMemoTemplateId
string

Note: This field is only available if you have Invoice Settlement enabled. The Invoice Settlement feature is generally available as of Zuora Billing Release 296 (March 2021). This feature includes Unapplied Payments, Credit and Debit Memo, and Invoice Item Settlement. If you want to enable Invoice Settlement, see Invoice Settlement Enablement and Checklist Guide for more information.

The unique ID of the debit memo template, configured in Billing Settings > Manage Billing Document Configuration through the Zuora UI. For example, 2c92c08d62470a8501626b19d24f19e2.

documentDate
string <date>

The date of the billing document, in yyyy-mm-dd format. It represents the invoice date for invoices, credit memo date for credit memos, and debit memo date for debit memos.

  • If this field is specified, the specified date is used as the billing document date.
  • If this field is not specified, the date specified in the targetDate is used as the billing document date.
hpmCreditCardPaymentMethodId
string

The ID of the payment method associated with this account. The payment method specified for this field will be set as the default payment method of the account.

If the autoPay field is set to true, you must provide the credit card payment method ID for either this field or the creditCard field, but not both.

For the Credit Card Reference Transaction payment method, you can specify the payment method ID in this field or use the paymentMethod field to create a CC Reference Transaction payment method for an account.

For a specified credit card payment method, it is recommended that the support for stored credential transactions for this payment method is already enabled.

invoice
boolean
Default: true

Note: This field has been replaced by the runBilling field. The invoice field is only available for backward compatibility.

Creates an invoice for a subscription. The invoice generated in this operation is only for this subscription, not for the entire customer account.

If the value is true, an invoice is created. If the value is false, no action is taken.

Note: This field is only available if you set the zuora-version request header to 196.0 or 207.0.

invoiceCollect
boolean
Default: true

Note: This field has been replaced by the invoice field and the collect field. invoiceCollect is available only for backward compatibility.

If this field is set to true, and a subscription is created, an invoice is generated at account creation time and payment is immediately collected using the account's default payment method.

Note: This field is only available if you set the zuora-version request header to 186.0, 187.0, 188.0, or 189.0.

invoiceDeliveryPrefsEmail
boolean
Default: false

Whether the customer wants to receive invoices through email.

invoiceDeliveryPrefsPrint
boolean
Default: false

Whether the customer wants to receive printed invoices, such as through postal mail.

invoiceTargetDate
string <date>

Note: This field has been replaced by the targetDate field. The invoiceTargetDate field is only available for backward compatibility.

Date through which to calculate charges if an invoice is generated, as yyyy-mm-dd. Default is current date.

This field is in REST API minor version control. To use this field in the method, you can set the zuora-version parameter to the minor version number in the request header. Supported minor versions are 207.0 and earlier.

invoiceTemplateId
string

Invoice template ID, configured in Billing Settings in the Zuora UI.

name
required
string

Account name, up to 255 characters.

notes
string

A string of up to 65,535 characters.

parentId
string

Identifier of the parent customer account for this Account object. The length is 32 characters. Use this field if you have customer hierarchy enabled.

paymentGateway
string

The name of the payment gateway instance. If null or left unassigned, the Account will use the Default Gateway.

object (paymentMethod)

Container for information on payment methods to associate with this account. To associate a credit card payment method when creating an account, Zuora recommends that you use this field instead of the creditCard field.

Note that you can not use this field together with creditCard or hpmCreditCardPaymentMethodId to associate a payment method to an account.

When creating a credit card payment method, it is recommended to enable the support for stored credential transactions for this payment method. Specify the required fields to enable the support.

paymentTerm
string

Payment terms for this account. Possible values are: Due Upon Receipt, Net 30, Net 60, Net 90.

runBilling
boolean
Default: true

Creates an invoice for a subscription. If you have the Invoice Settlement feature enabled, a credit memo might also be created based on the invoice and credit memo generation rule.

The billing documents generated in this operation is only for this subscription, not for the entire customer account.

Possible values:

  • true: An invoice is created. If you have the Invoice Settlement feature enabled, a credit memo might also be created.

  • false: No invoice is created.

Note: This field is in Zuora REST API version control. Supported minor versions are 211.0 or later. To use this field in the method, you must set the zuora-version parameter to the minor version number in the request header.

Enum: true false
salesRep
string

The name of the sales representative associated with this account, if applicable. Maximum of 50 characters.

sequenceSetId
string

The ID of the billing document sequence set to assign to the customer account.

The billing documents to generate for this account will adopt the prefix and starting document number configured in the sequence set.

If a customer account has no assigned billing document sequence set, billing documents generated for this account adopt the prefix and starting document number from the default sequence set.

object (Contact)

Container for optional sold-to contact; uses the same field structure as the bill-to contact (above). If a sold-to contact is not specified, one is created from the bill-to contact. Once created, these are two separate data entities, and future changes to one do not affect the other.

soldToSameAsBillTo
boolean

Whether the sold-to contact and bill-to contact are the same entity.

The created account has the same bill-to contact and sold-to contact entity only when all the following conditions are met in the request body:

  • This field is set to true.
  • A bill-to contact is specified.
  • No sold-to contact is specified.
object (subscription)

Container for subscription information, used if creating a subscription for the new account at the time of account creation.

tagging
string
targetDate
string <date>

Date through which to calculate charges if an invoice or a credit memo is generated, as yyyy-mm-dd. Default is current date.

Note: The credit memo is only available only if you have the Invoice Settlement feature enabled.

This field is in Zuora REST API version control. Supported minor versions are 211.0 and later. To use this field in the method, you must set the zuora-version parameter to the minor version number in the request header.

object

Container for tax exempt information, used to establish the tax exempt status of a customer account.

Class__NS
string <= 255 characters

Value of the Class field for the corresponding customer account in NetSuite. Only available if you have installed the Zuora Connector for NetSuite.

CustomerType__NS
string

Value of the Customer Type field for the corresponding customer account in NetSuite. The Customer Type field is used when the customer account is created in NetSuite. Only available if you have installed the Zuora Connector for NetSuite.

Enum: "Company" "Individual"
Department__NS
string <= 255 characters

Value of the Department field for the corresponding customer account in NetSuite. Only available if you have installed the Zuora Connector for NetSuite.

IntegrationId__NS
string <= 255 characters

ID of the corresponding object in NetSuite. Only available if you have installed the Zuora Connector for NetSuite.

IntegrationStatus__NS
string <= 255 characters

Status of the account's synchronization with NetSuite. Only available if you have installed the Zuora Connector for NetSuite.

Location__NS
string <= 255 characters

Value of the Location field for the corresponding customer account in NetSuite. Only available if you have installed the Zuora Connector for NetSuite.

Subsidiary__NS
string <= 255 characters

Value of the Subsidiary field for the corresponding customer account in NetSuite. The Subsidiary field is required if you use NetSuite OneWorld. Only available if you have installed the Zuora Connector for NetSuite.

SyncDate__NS
string <= 255 characters

Date when the account was sychronized with NetSuite. Only available if you have installed the Zuora Connector for NetSuite.

SynctoNetSuite__NS
string

Specifies whether the account should be synchronized with NetSuite. Only available if you have installed the Zuora Connector for NetSuite.

Enum: "Yes" "No"
property name*
additional property
any

Custom fields of the Account object. The name of each custom field has the form customField__c. Custom field names are case sensitive. See Manage Custom Fields for more information.

Responses
200
post/v1/accounts
Request samples
application/json
{
  • "additionalEmailAddresses": [
    ],
  • "autoPay": false,
  • "billCycleDay": 0,
  • "billToContact": {
    },
  • "creditMemoReasonCode": "Unsatisfactory service",
  • "currency": "USD",
  • "hpmCreditCardPaymentMethodId": "2c92c0f93cf64d94013cfe2d20db61a7",
  • "invoiceDeliveryPrefsEmail": true,
  • "invoiceDeliveryPrefsPrint": false,
  • "name": "Zuora Test Account",
  • "notes": "This account is for demo purposes.",
  • "paymentTerm": "Due Upon Receipt",
  • "subscription": {
    }
}
Response samples
application/json
{
  • "success": true,
  • "accountId": "402892c74c9193cd014c96bbe7c101f9",
  • "accountNumber": "A00000004",
  • "billToContactId": "2c92c8fb68a28d180168a7ccedba1c4c",
  • "soldToContactId": "2c92c8fb68a28d180168a7ccedc61c4e",
  • "paymentMethodId": "402892c74c9193cd014c96bbe7d901fd"
}