Skip to main content

Log in to the SOAP API


Log in to the SOAP API

Your first step before making any SOAP API calls is to log in as an API user. Use the login() call to establish your session and get you a ID for the session. Use that session ID for your subsequent API calls during your session.

Do you have an API User Account?

Do you have an API user account? If not, then someone with administration privileges can set it up for you. To determine whether you have administration privileges, log in to the Zuora application and click your username in the upper right corner of the UI. If you can see the Administration menu option, you have administrative privileges.

Follow this quick procedure to set up your API user account.

 If an API user account is used to log in to the UI, it becomes subject to periodic forced password expirations. This automatic security feature may eventually cause API authentication failures that can be hard to diagnose. For this reason, it is suggested that the API user account is never used to log in to the UI.

Send a login Call Request

Send a login() request to one of the following endpoints: 

  • Production:<wsdl version>
  • Sandbox:<wsdl version>
  • Performance Test:<wsdl version>

The <wsdl version> denotes  the API or WSDL version that you are using, such as 68.0.

The login() call requires the following fields in the order they are listed:

  1. username
  2. password

Use your API login credentials, not your credentials to log in to the Zuora application. 

The username must come before the password. If you reverse the order, then you receive the following error: Unexpected subelement username

Establishing a Session

When you send a login() request to your tenant, a session is established for you, and you receive a response that includes a unique ID for your session. Use this session ID in subsequent API calls during your session. The session ID is good for the duration specified in Administration Settings > Security Policies > Session timeout. Once the ID expires, you must send a new login() request to continue making SOAP calls.

See How do I prevent session tokens from expiring in the API for more information.

Receiving a Session ID

The login() call is successful when you receive a response that includes your session ID.

If the call fails, you will receive one of the following errors:

  • LoginFault
    This error means that there is a mistake in your user name and password combination. Check both your user name and your password, then try again.
  • UnexpectedErrorFault
    This error means that something happened during the call that interfered with your call being properly sent. Try the call again.

Both of these errors are faults, which are are fatal, call-level errors. When a fault occurs, nothing is processed because the entire call was invalid. Often the problem is that the login credentials were incorrect or there was a server error.


The example request and response demonstrate a login() call and response. The example query demonstrates using the session ID in your subsequent API calls.

See How do I capture SOAP API Requests and Responses for more information.

Example Request

This example uses the following fields and values:

  • username:
  • password: 17parRot8sox
<!-- sample login call -->
<SOAP-ENV:Envelope xmlns:SOAP-ENV="" xmlns:ns2="" xmlns:xsi="" xmlns:ns1="">

Example Response

This example sends you the session ID, LiUBQF ... ugxg2jJuCA==, which you need to use for your subsequent API calls during this session. This example session ID is a truncated example of a real session ID: your session ID is substantially longer. 

<!-- sample login response -->
<soapenv:Envelope xmlns:soapenv="">
        <ns1:loginResponse xmlns:ns1="">

Example Subsequent API Call

This particular example call is a query. Notice the session ID. You need to pass the session ID from the login() response for every call that you make during your session.

<!-- sample API query -->
<SOAP-ENV:Envelope xmlns:SOAP-ENV="" xmlns:ns2="" xmlns:xsi="" xmlns:ns1="">
            <ns1:queryString>select id from account</ns1:queryString>