GetUserAgreement API Operation

API

Last updated: Aug 15th, 7:15am

Gets the user agreement for the customer to approve the new PayPal account.

User agreement management

PayPal requires account holders to agree to its User Agreement when they sign up for an account. You can use the GetUserAgreement API operation to obtain the agreement before or after the account has been created. For example, you might want to enable a potential account holder to view the agreement before you redirect them to PayPal to confirm account creation, or you might want to enable an existing PayPal account holder to view the user agreement without logging in to PayPal. The terms of the user agreement depend on the country associated with the account, which is specified when the account is created. The user agreement is typically available in the most common languages used within a country. You can specify the contents and language of the user agreement by specifying one of the following sets of information in the request of the GetUserAgreement API operation:

  • The account key returned in the response to the CreateAccount API operation
  • The country and language of the account

The response to the GetUserAgreement API operation contains the text of the user agreement as a text string. If an account key is specified in the request, the user agreement is appropriate for the country and language of the account; otherwise, the user agreement is for the specified country and language.Typically, you use country and language to display an agreement before the account has been created and use the account key after the account has been created. You can format the text to match the presentation characteristics of your site.

GetUserAgreement request

The GetUserAgreement request functions to request the PayPal's user agreement for the user to approve during account creation. The type of user agreement that is presented depends on the country and the language selected. For example, the PayPal account user may be a native Spanish speaker in the United States. In this case, the GetUserAgreement method presents a version of the agreement tailored for the United States in Spanish.

GetUserAgreement fields

The following table lists the required and optional fields for the GetUserAgreement request. The user agreement is tailored to the PayPal user's language and country code settings. You can either pass the country code and language code, or you can simply pass the createAccountKey that was returned in the CreateAccountResponse message.

FieldDescription
countryCodexs:string(Optional) The code for the country in which the user account is located. You do not need to provide this country code if you are passing the createAccount key. Allowable values are:
  • Australia - AU
  • Canada - CA
  • Czech Republic - CZ
  • France - FR
  • Germany - DE
  • Greece - GR
  • Israel - IL
  • Italy - IT
  • Japan - JP
  • Netherlands - NL
  • Poland - PL
  • Spain - ES
  • United Kingdom - GB
  • United States - US
createAccountKeyxs:string(Optional) The key returned for this account in the CreateAccountResponse message in the createAccountKey field. If you specify this key, do not pass a country code or language code. Doing so will result in an error.
languageCodexs:string(Optional) The code indicating the language to be used for the agreement.
requestEnvelopecommon:RequestEnvelope(Required) Information common to each API operation, such as the language in which an error message is returned.

RequestEnvelope fields

FieldDescription
detailLevelcommon:DetailLevelCode(Optional) The level of detail required by the client application for component such as Item, Transaction. Value is:
  • ReturnAll - This value provides the maximum level of detail (default)
errorLanguagexs:string(Required) The RFC 3066 language in which error messages are returned; by default it is en_US, which is the only language currently supported

GetUserAgreement response

The GetUserAgreement response includes the string with the text of the user agreement in the language requested for the country in which the account is located.

GetUserAgreement Response Fields

FieldDefinition
agreementxs:string This is the text of the actual PayPal user agreement.
responseEnvelopecommon:ResponseEnvelope Common response information, including a time stamp and the response acknowledgment status.

ResponseEnvelope fields

FieldDescription
ackcommon:AckCode Acknowledgment code. Value is:
  • Success - Operation completed successfully
  • Failure - Operation failed
  • Warning - warning
  • SuccessWithWarning - Operation completed successfully; however, there is a warning message
  • FailureWithWarning - Operation failed with a warning message
buildBuild number; used only by Merchant Technical Support.
correlationIdCorrelation ID; used only by Merchant Technical Support.
timestampThe date when the response was sent. The time is not supported.

SOAP GetUserAgreement example

This example shows how to set up a request to obtain the user agreement associated with a specific country and language. The response contains the agreement itself.

SOAP request

In this example, the country is US and the language is en_US.

    1<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    2<soapenv:Body>
    3<ns2:GetUserAgreementRequest xmlns:ns2="https://svcs.paypal.com/services">
    4<requestEnvelope>
    5<errorLanguage>en_US</errorLanguage>
    6</requestEnvelope>
    7<countryCode>US</countryCode>
    8<languageCode>en_US</languageCode>
    9<agreementType>Personal</agreementType>
    10</ns2:GetUserAgreementRequest>
    11</soapenv:Body>
    12</soapenv:Envelope>

    SOAP response

    The response contains the actual agreement, which you typically format before presenting to the user.

      1<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
      2<soapenv:Header />
      3<soapenv:Body>
      4<ns2:GetUserAgreementResponse xmlns:ns2="https://svcs.paypal.com/types/aa">
      5<responseEnvelope>
      6<timestamp>2009-09-03T15:09:25.101-07:00</timestamp>
      7<ack>Success</ack>
      8<correlationId>860b4b0d476df</correlationId>
      9<build>1033575</build>
      10</responseEnvelope>
      11<agreement>
      12
      13This User Agreement ("Agreement") is a contract between you and PayPal and applies to your use of PayPal's Services. You must read, agree with and accept all of the terms and conditions contained in this Agreement. In addition, you must read, agree with and accept any applicable agreements on the Legal Agreements page.
      14...
      15"Viewable Online Signature Confirmation" means documentation that can be viewed online at the Approved Shipper's website and includes the signature of the person who received the package.
      16"User," "you," or "your" means you and any other person or entity using the Service.
      17</agreement>
      18</ns2:GetUserAgreementResponse>
      19</soapenv:Body>
      20</soapenv:Envelope>

      GetUserAgreement errors

      VariableDescription
      520002Internal error
      520003Username/Password is incorrect
      550005The application ID does not exist
      550006The application is not authorized for the app caller
      580022Request parameter is invalid:
      • line1 cannot be null
      • city cannot be null
      • countryCode cannot be null
      • firstName cannot be null
      • lastName cannot be null
      • Invalid request: address
      For invalid requests regarding address, the postal code is required for the country, or the city is missing from the address.
      580029Required parameter is missing in the request:
      • Invalid request: emailAddress
      • Invalid request: sandboxEmailAddress
      580001Invalid request:
      • accountType does not match the pattern Personal/Premier/ Business
      • citizenshipCountryCode
      • countryCode
      • currencyCode
      • dateofBirth
      • firstName is not between 1 and 192 characters long
      • ipAddress
      • preferredLanguageCode
      • line1 is not between 1 and 300 characters long
      • notificationUrl is not between 1 and 1024 characters long
      • notificationUrl does not match the pattern <[a-aZ-Z]+\://) 1 \S+
      • state is not between 0 and 120 characters long
      580022Account already existsSince 1.3.0
      580029Required parameter is missing in the request:
      • Invalid request: emailAddress
      • Invalid request: sandboxEmailAddress

      If you accept cookies, we’ll use them to improve and customize your experience and enable our partners to show you personalized PayPal ads when you visit other sites. Manage cookies and learn more