Express Checkout API Clarification

chacken
New Community Member

Alright, I basically just need some clarification on the Express Checkout API steps.

 

The documentation sort-of points you in the right direction but it leaves you with several un-answered questions if you haven't used the API before..

 

From my understanding so far, GetExpressCheckout returns a token, which is supposed to be used to redirect the user to paypal, but what is the URL and POST/GET variables that you are supposed to include with this?  ((( I'm not sure, but it looks like you're supposed to redirect to https://www.paypal.com/cgi-bin/webscr? ??)))  (Also, How do you send the token that was returned in GetExpressCheckout?)..  And then after your user is redirected back to your site, DoExpressCheckoutPayment is supposed to be called?  I really don't understand why they couldn't do all of this in one request..

 

Anyway, clarification would be much appreciated.

 

 

 

Login to Me Too
1 REPLY 1

PayPal_RobG
PayPal Employee
PayPal Employee

Hi!

 

Express Checkout is based on three API calls; SetExpressCheckout, GetExpressCheckoutDetails and DoExpressCheckoutPayment.


1. The SetExpressCheckout API request sets up the payment. Such as the amount to be charged, name of the product, etcetera.

 

2. The SetExpressCheckout API response will return a token (EC-xxxxx). This token is valid for three hours.

 

3. You should redirect the buyer to https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=TOKEN-HERE, where TOKEN-HERE is the token you received earlier

 

3. After the buyer has agreed to the payment, he is returned back to your site (specifically, to the RETURNURL you specified in the initial SetExpressCheckout API request).

 

4. Now that he's back on your RETURNURL page, you can call GetExpressCheckoutDetails API and supply the token as a parameter to get the PAYERID of the buyer. Alternatively, the PayerID is also appended in the GET array of the RETURNURL page (PHP: $_GET['PayerID'])

 

5. Now you call DoExpressCheckoutPayment together with the TOKEN and PAYERID to finalize the payment.

 

You can find additional documentation for Express Checkout at https://www.x.com/developers/paypal/documentation-tools/api?qt-api_references=1#qt-api_references (Choose "API by products" > "PayPal: Express Checkout") as well as our SDK's and sample code at https://www.x.com/community/ppx/sdks#NVP

 

Hope this clears it up. Feel free to log a ticket with us directly in case you have any further questions.

----
For technical assistance with PayPal merchant product offerings, please file a ticket at https://www.paypal.com/mts/
Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.