title: CreateRecurringPaymentsProfile giving Error 11502: Invalid Token
body: <p>I keep getting the Invalid Token Error when i call the CreateRecurringPaymentsProfile NVP API.</p>
  
  <p>Please find the sequence of my API calls below:</p>
  
  <p><strong>SetExpressCheckout</strong></p>
  
  <pre><code>METHOD = SetExpressCheckout
  VERSION = 98
  PWD = &lt;pwd&gt;
  USER = &lt;user&gt;
  SIGNATURE = &lt;signature&gt;
  ReturnUrl = http://google.com
  CANCELURL = http://google.com
  PAYMENTREQUEST_0_PAYMENTACTION = Authorization
  PAYMENTREQUEST_0_AMT = 100.00
  PAYMENTREQUEST_0_CURRENCYCODE = USD
  L_PAYMENTREQUEST_0_NAME0 = Item1
  L_PAYMENTREQUEST_0_QTY0 = 1
  L_PAYMENTREQUEST_0_AMT0 = 100.00
  PAYMENTREQUEST_0_SELLERPAYPALACCOUNTID = rahul.katikineni@sap.com
  LOCALECODE = US
  L_BILLINGTYPE0 = RecurringPayments
  L_BILLINGAGREEMENTDESCRIPTION0 = SameEveryTime
  </code></pre>
  
  <p>I get back a token with <strong>ACK</strong>=*<em>Success</em>* as response. I then navigate to the paypal website using the URL [<strong><a href="https://www.sandbox.paypal.com/webscr&amp;cmd=_express-checkout&amp;token=">https://www.sandbox.paypal.com/webscr&amp;cmd=_express-checkout&amp;token=</a><em>token</em></strong>] and login with a paypal account and click on "Agree and Continue".</p>
  
  <p>After agreeing and successfully redirecting to the redirect URL, I make the <strong>GetExpressCheckoutDetails</strong> API call with the following parameters</p>
  
  <pre><code>METHOD = GetExpressCheckoutDetails
  VERSION = 98
  PWD = &lt;pwd&gt;
  USER = &lt;user&gt;
  SIGNATURE = &lt;signature&gt;
  TOKEN = &lt;token from the SetExpressCheckout response&gt;
  </code></pre>
  
  <p>After successfully getting the the payer details as response, i make the <strong>DoExpressCheckoutPayment</strong> API call</p>
  
  <pre><code>METHOD = DoExpressCheckoutPayment
  VERSION = 98
  PWD = &lt;pwd&gt;
  USER = &lt;user&gt;
  SIGNATURE = &lt;signature&gt;
  TOKEN = &lt;token from the SetExpressCheckout response&gt;
  PAYERID = &lt;payer ID from the GetExpressCheckoutDetails response&gt;
  PAYMENTREQUEST_0_AMT = 100
  PAYMENTREQUEST_0_PAYMENTACTION = Sale
  PAYMENTREQUEST_0_CURRENCYCODE = USD
  L_PAYMENTREQUEST_0_NAME0 = Item1
  L_PAYMENTREQUEST_0_QTY0 = 1
  L_PAYMENTREQUEST_0_AMT0 = 100.00
  PAYMENTREQUEST_0_SELLERPAYPALACCOUNTID = rahul.katikineni@sap.com
  </code></pre>
  
  <p>I now make the <strong>CreateRecurringPaymentsProfile</strong> API call</p>
  
  <pre><code>METHOD = CreateRecurringPaymentsProfile
  VERSION = 98
  PWD = &lt;pwd&gt;
  USER = &lt;user&gt;
  SIGNATURE = &lt;signature&gt;
  TOKEN = &lt;token from the SetExpressCheckout response&gt;
  PAYERID = &lt;payer ID from the GetExpressCheckoutDetails response&gt;
  DESC = SameEveryTime
  BILLINGPERIOD = Month
  BILLINGFREQUENCY = 1
  PROFILESTARTDATE = 2013-05-16T00:00:00Z
  MAXFAILEDPAYMENTS = 1
  AMT = 100.00
  CURRENCYCODE = USD
  L_PAYMENTREQUEST_0_NAME0 = Item1
  L_PAYMENTREQUEST_0_QTY0 = 1
  L_PAYMENTREQUEST_0_AMT0 = 100.00
  AUTOBILLAMT = AddToNextBilling
  </code></pre>
  
  <p>I keep getting the following response</p>
  
  <pre><code>TIMESTAMP = 2013-04-17T05:31:24Z
  CORRELATIONID = d2c1d30c1d31
  ACK = Failure
  VERSION = 98
  BUILD = 5650305
  L_ERRORCODE0 = 11502
  L_SHORTMESSAGE0 = Invalid Token
  L_LONGMESSAGE0 = The token is invalid
  L_SEVERITYCODE0 = Error
  </code></pre>
  
  <p>I have tried looking for a solution in many forums but could not figure out if i have missed any parameters.</p>
  
  <p>Can anyone help me on this?</p>
  
  <p>Thanks in advance,
  Rahul</p>