Knowledge Center

Knowledge Center > API > REST API > REST API Reference > Accounts > Update account

Update account

This REST API reference describes how to update a customer account by specifying the account-key.

Request

  • Production: PUT https://api.zuora.com/rest/v1/accounts/{account-key}
  • API Sandbox: PUT https://apisandbox-api.zuora.com/rest/v1/accounts/{account-key}

Request parameters

account-key

required

path

Account number or account ID

Request body

name

optional

Account name, up to 255 characters

batch

optional

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

notes

optional

A string of up to 65,535 characters

crmId

optional

CRM account ID for the account, up to 100 characters

autoPay

optional

Specifies whether future payments are to be automatically billed when they are due. Possible values are: truefalse.

invoiceTemplateId

optional

Invoice template ID. See Manage Invoice Rules and Templates for more information.

communicationProfileId

optional

The ID of a communication profile

cf_txtn__c

optional

One or more optional custom fields

cf_pkn__c

optional

One or more optional custom fields

billToContact

optional

Container for bill-to contact information for this account:

address1

optional

First address line, 255 characters or less

address2

optional

Second address line, 255 characters or less

city

optional

City, 40 characters or less

country

optional

Country; must be a valid country name or abbreviation. If using Z-Tax, be aware that it requires a country in the sold-to contact to calculate tax, and that a bill-to contact may be used if no sold-to contact is provided.

county

optional

County; 32 characters or less. May optionally be used by Z-Tax to calculate county tax.

fax

optional

Fax phone number, 40 characters or less

firstName

required

First name, 100 characters or less

homePhone

optional

Home phone number, 40 characters or less

lastName

required

Last name, 100 characters or less

mobilePhone

optional

Mobile phone number, 40 characters or less

nickname

optional

NIckname for this contact

otherPhone

optional

Other phone number, 40 characters or less

otherPhoneType

optional

Possible values are: Work, Mobile, Home, Other.

personalEmail

optional

Personal email address, 80 characters or less

zipCode

optional

Zip code, 20 characters or less

state

optional

State; must be a valid state or province name or 2-character abbreviation. If using Z-Tax, be aware that Z-Tax requires a state (in the US) or province (in Canada) in this field for the sold-to contact to calculate tax, and that a bill-to contact may be used if no sold-to contact is provided.

taxRegion

optional

If using Z-Tax, a region string as optionally defined in your tax rules. Not required.

workEmail

optional

Work email address, 80 characters or less

workPhone

optional

Work phone number, 40 characters or less

cf_txtn__c

optional

One or more optional custom fields

cf_pkn__c

optional

One or more optional custom fields

soldToContact

optional

Container for optional sold-to contact; uses the same field structure as the bill-to contact (above).

paymentGateway

optional

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

taxInfo 

optional

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

companyCode

optional

Unique code that identifies a company account in Avalara. Use this field to calculate taxes based on origin and sold-to addresses in Avalara.

This feature is in Limited Availability. If you wish to have access to the feature, submit a request at Zuora Global Support

exemptCertificateId

optional

ID of the customer tax exemption certificate. Requires Z-Tax.

exemptCertificateType

optional

Type of tax exemption certificate that the customer holds. Requires Z-Tax.

exemptDescription

optional

Description of the tax exemption certificate that the customer holds. Requires Z-Tax.

exemptEffectiveDate

optional

Date when the customer tax exemption starts. Requires Z-Tax.

Format: yyyy-mm-dd. Defaults to the current date.

exemptExpirationDate

optional

Date when the customer tax exemption expires. Requires Z-Tax.

Format: yyyy-mm-dd. Defaults to the current date.

exemptIssuingJurisdiction

optional

Jurisdiction in which the customer tax exemption certificate was issued.

exemptStatus

conditional

 

Status of the account tax exemption. Requires Z-Tax.

Required if you use Z-Tax. This field is unavailable if Z-Tax is not used.

Values: Yes, No, pendingVerification

VATId

optional

EU Value Added Tax ID.

This feature is in Limited Availability. If you wish to have access to the feature, submit a request at Zuora Global Support

Response

success

Contains true if successful, otherwise false.

processId

Internal process ID to assist Zuora support. Only returned if success is false.

reasons

Information on one or more reasons for the result. Only returned if success is false.

code

Eight-digit numeric error code

message

Description of the error

Notes

  1. Only the fields to be changed should be specified.  Any field that's not included in the request body will not be changed.
  2. If an empty field is submitted with this call, the corresponding field in the account is emptied.
  3. Email addresses: If no email addresses are specified, no change is made to the email addresses on file or to the email delivery preference. If either the personalEmail or workEmail is specified (or both), the system updates the corresponding email address(es) on file and the email delivery preference is set to true. (In that case, emails go to the workEmail address, if it exists, or else the personalEmail.) On the other hand, if as a result of this call both of the email addresses for the account are empty, the email delivery preference is set to false.
  4. The bill-to and sold-to contacts are separate data entities; updating either one does not update the other.

Examples

HTTP request:

PUT https://api.zuora.com/rest/v1/accounts/{account-key}

JSON request:

{ 
  "paymentGateway" : "TestGateway" 
}
JSON response:
{
  "success": true
}

CURL request:

##
## update account
##
echo
echo "==========Update Account============="
echo
curl -i -k -H "apiAccessKeyId:$USER_NAME" -H "apiSecretAccessKey:$PASSWORD" -H "Content-Type:application/json" -H "Accept:application/json" -d '
{
    "name": "Sally Jones",
    "notes": "This is a test of the account update call.",
    "billToContact":{
        "firstName":"Howard",
        "workEmail":"howard@test.com"
    }
}' -X PUT $BASE_URL/v1/accounts/A00000001

 

JSON response:

{
  "success": true
}

 

Last modified
13:19, 17 Feb 2016

Tags

Classifications

(not set)