In SetExpressCheckout response, you obtain a
TOKEN that uniquely identifies this three-step transaction. You pass this
TOKEN in the request to
GetExpressCheckoutDetails and
DoExpressCheckoutPayment. Both
GetExpressCheckoutDetails and
DoExpressCheckoutPayment return this
TOKEN in the response.
The SetExpressCheckout request method notifies PayPal that you are using Express Checkout to obtain payment from your customer.
|
[requiredSecurityParameters]& METHOD=SetExpressCheckout&AMT=10.00& RETURNURL=https://www.anycompany.com/orderprocessing/orderreview.html& CANCELURL=https://www.anycompany.com/orderprocessing/shippinginfo.html
|
After you receive a successful response from SetExpressCheckout, add the TOKEN from
SetExpressCheckout response as a name/value pair to the following URL, and redirect your customer’s browser to it:
For redirecting the customer’s browser to the PayPal login page, PayPal recommends that you use the HTTPS response 302 “Object Moved” with the URL above as the value of the Location header in the HTTPS response. Ensure that you use an SSL-enabled server to prevent browser warnings about a mix of secure and insecure graphics.
The GetExpressCheckoutDetails method returns information about the customer, including name and address stored on PayPal.
l
|
TOKEN: use the value from SetExpressCheckout response
|
The response contains this TOKEN and customer details.
|
[successResponseFields]&TOKEN=EC-3DJ78083ES565113B&EMAIL=abcdef@anyemail.com& PAYERID=95HR9CM6D56Q2&PAYERSTATUS=verified&FIRSTNAME=John& LASTNAME=Smith&COUNTRYCODE=US& SHIPTONAME=John Smith&SHIPTOSTREET=144+Main+St.& SHIPTOCITY=San+Jose&SHIPTOSTATE=CA&SHIPTOCOUNTRYCODE=US& SHIPTOZIP=99221&ADDRESSID=PayPal& ADDRESSSTATUS=Confirmed
|
Make sure TOKEN matches the value in SetExpressCheckout response.
Save PAYERID for use on the next call.
By default, you make a final sale with DoExpressCheckoutPayment request. You can also request authorization for later capture of payment. For more information, see
“Authorizing for Multiple Captures”.
TOKEN: use the value from
GetExpressCheckoutDetails response
PAYERID: use the value from
GetExpressCheckoutDetails response
PAYMENTACTION: set to Sale. This is the default value in
SetExpressCheckout.
AMT: use the same value as in
SetExpressCheckout request
|
[successResponseFields]&TOKEN=EC‑0E881823PA052770A& TRANSACTIONID=8SC56973LM923823H&TRANSACTIONTYPE=expresscheckout& PAYMENTTYPE=instant&ORDERTIME=2006-08-22T20:16:05Z&AMT=10.00& CURRENCYCODE=USD&FEEAMT=0.59&TAXAMT=0.00& PAYMENTSTATUS=Completed&PENDINGREASON=None&REASONCODE=None
|
Note:
|
The value of REQCONFIRMSHIPPING overrides the setting in your Merchant Account Profile
|
|
[requiredSecurityParameters]& METHOD=SetExpressCheckout&AMT=10.00& RETURNURL=https://www.anycompany.com/orderprocessing/orderreview.html& CANCELURL=https://www.anycompany.com/orderprocessing/shippinginfo.html & REQCONFIRMSHIPPING=1
|
To suppress the display of the customer’s shipping address on the PayPal web pages, set NOSHIPPING to
1 in
SetExpressCheckout request. You might want to do this if you are selling a product or service that does not require shipping.
|
[requiredSecurityParameters]& METHOD=SetExpressCheckout&AMT=10.00& RETURNURL=https://www.anycompany.com/orderprocessing/orderreview.html& CANCELURL=https://www.anycompany.com/orderprocessing/shippinginfo.html & NOSHIPPING=1
|
GetExpressCheckoutDetails does not return the shipping address.
|
[successResponseFields]&TOKEN=EC-17C76533PL706494P&EMAIL=abcdef@anycompany.com&PAYERID=95HR9CM6D56Q2& PAYERSTATUS=verified&FIRSTNAME=John&LASTNAME=Smith&COUNTRYCODE=US& ADDRESSID=PayPal&ADDRESSSTATUS=None
|
|
[requiredSecurityParameters]&METHOD= SetExpressCheckout&AMT=10.00& RETURNURL=https://www.anycompany.com/orderprocessing/orderreview.html& CANCELURL=https://www.anycompany.com/orderprocessing/shippinginfo.html & SHIPTONAME=Peter+Smith& SHIPTOSTREET=144+Main+St.& SHIPTOCITY=SAN+JOSE
& SHIPTOSTATE=CA& SHIPTOCOUNTRYCODE=US& SHIPTOZIP=99911& ADDROVERRIDE=1
|
GetExpressCheckoutDetails returns the overridden shipping address.
|
[successResponseFields]&TOKEN=EC-17C76533PL706494P& PAYER=abcdef@anycompany.com&PAYERID=95HR9CM6D56Q2&PAYERSTATUS=verified& FIRSTNAME=John&LASTNAME=Smith& COUNTRYCODE=US& SHIPTONAME=Peter+Smith& SHIPTOSTREET=144+Main+St.& SHIPTOCITY=SAN+JOSE& SHIPTOSTATE=CA& SHIPTOCOUNTRYCODE=US& SHIPTOZIP=95112& ADDRESSID=PayPal& ADDRESSSTATUS=Unconfirmed
|
|
[requiredSecurityParameters]& METHOD=SetExpressCheckout&AMT=10.00& CURRENCYCODE=EUR& RETURNURL=https://www.anycompany.com/orderprocessing/orderreview.html& CANCELURL=https://www.anycompany.com/orderprocessing/shippinginfo.html & LOCALECODE=fr_FR
|
The following example sets PAGESTYLE to
DesignerFotos-Yellow in the
SetExpressCheckout method
|
[requiredSecurityParameters]& METHOD=SetExpressCheckout&AMT=10.00& RETURNURL=https://www.anycompany.com/orderprocessing/orderreview.html& CANCELURL=https://www.anycompany.com/orderprocessing/shippinginfo.html& PAGESTYLE=DesignerFotos-Yellow
|
l
|
HDRIMG: specify an image to appear at the top left of the payment page
|
l
|
HDRBORDERCOLOR: set the border color around the header of the payment page
|
l
|
HDRBACKCOLOR: set the background color for the background of the header of the payment page
|
|
[requiredSecurityParameters]& METHOD=SetExpressCheckout&AMT=10.00& RETURNURL=https://www.anycompany.com/orderprocessing/orderreview.html& CANCELURL=https://www.anycompany.com/orderprocessing/shippinginfo.html& HDRIMG=https://www.anycompany.com/images/HeaderImage.gif& HDRBORDERCOLOR=3366FF& HDRBACKCOLOR=D3EFF5& PAYFLOWCOLOR=F8F5F5
|
Use the payer name and shipping address returned by GetExpressCheckoutDetails response to fill in form fields on your payment review page which you display after the customer returns from PayPal.
|
[successResponseFields]&TOKEN=EC-3DJ78083ES565113B&EMAIL=abcdef@anyemail.com& PAYERID=95HR9CM6D56Q2&PAYERSTATUS=verified&FIRSTNAME=John&LASTNAME=Smith& COUNTRYCODE=US&SHIPTONAME=John Smith&SHIPTOSTREET=144+Main+St.& SHIPTOCITY=San+Jose&SHIPTOSTATE=CA&SHIPTOCOUNTRYCODE=US&SHIPTOZIP=99221& ADDRESSID=PayPal&ADDRESSSTATUS=Confirmed
|
|
[requiredSecurityParameters]& METHOD=SetExpressCheckout&AMT=10.00& RETURNURL=https://www.anycompany.com/orderprocessing/orderreview.html& CANCELURL=https://www.anycompany.com/orderprocessing/shippinginfo.html& PAYMENTACTION=Authorization
|
|
[requiredSecurityParameters]& METHOD=DoExpressCheckoutPayment& TOKEN=EC-30P862430W113011F&PAYERID=95HR9CM6D56Q2&AMT=10.00 PAYMENTACTION=Authorization
|
|
[successResponseFields]&TOKEN=EC-30P862430W113011F& TRANSACTIONID=4D479374VP578364Y&TRANSACTIONTYPE=expresscheckout& PAYMENTTYPE=instant&ORDERTIME=2006-08-22T22:02:42Z&AMT=10.00& CURRENCYCODE=USD&TAXAMT=0.00& PAYMENTSTATUS=Pending& PENDINGREASON=authorization& REASONCODE=None
|
Setting PAYMENTACTION to
Order verifies that the customer account exists, but does not hold funds. To authorize the funds, you must additionally call the
DoAuthorization API, specifying the amount of be authorized. In most cases, you call
DoAuthorization directly after
DoExpressCheckout in your payment flow in order to minimize the risk of capture declines.
Use the TRANSACTIONID from the
DoExpressCheckoutPayment response as the value of
TRANSACTIONID in the
DoAuthorization request. Then use the
AUTHORIZATIONID contained in the
DoAuthorization response in the
DoCapture request when capturing against the order. See
“Making a Single Capture Using DoCapture” for more information on Authorization and Capture.
|
[requiredSecurityParameters]& METHOD=SetExpressCheckout&AMT=1.00& RETURNURL=https://www.anycompany.com/orderprocessing/orderreview.html& CANCELURL=https://www.anycompany.com/orderprocessing/shippinginfo.html& PAYMENTACTION=Order
|
|
[successResponseFields]&TOKEN=EC-8NB10343BA3562027& TRANSACTIONID=O-2YX05090CA6454418&TRANSACTIONTYPE=expresscheckout& PAYMENTTYPE=None&ORDERTIME=2006-08-22T22:22:03Z&AMT=1.00& CURRENCYCODE=USD&TAXAMT=0.00&P AYMENTSTATUS=None& PENDINGREASON=order& REASONCODE=None
|
Before making a capture against the order, you should first call DoAuthorization to authorize the amount of the tranaction. Use the
TRANSACTIONID from
DoExpressCheckoutPayment and use it for the value of
TRANSACTIONID in
DoAuthorization request.If most cases, you should call
DoAuthorization directly after
DoExpressCheckout in your payment flow.
Use the AUTHORIZATIONID contained in the
DoAuthorization response in the
DoCapture request when capturing against the order. See
“Making Multiple Partial Captures Using DoCapture” for more information on Authorization and Capture.
|
[requiredSecurityParameters]& METHOD=DoExpressCheckoutPayment& TOKEN=EC-8AX1275942659774U&PAYERID=95HR9CM6D56Q2&AMT=10.00& PAYMENTACTION=Sale& NOTIFYURL=https://www.anycompany.com/process-ipn/
|
|
[successResponseFields]&TOKEN=EC-8AX1275942659774U& TRANSACTIONID=1MA55216691247718&TRANSACTIONTYPE=expresscheckout& PAYMENTTYPE=instant&ORDERTIME=2006-08-22T22:39:13Z&AMT=10.00& CURRENCYCODE=USD&FEEAMT=0.59&TAXAMT=0.00&PAYMENTSTATUS=Completed& PENDINGREASON=None&REASONCODE=None
|
l
|
L_NAMEn: item name or description
|
You can detail as many items as you want. Beginning with 0, append an index number to the field name and increment that index number by one for each item.
|
[requiredSecurityParameters]& METHOD=DoExpressCheckoutPayment& TOKEN=EC-4XH62109C8044521N&PAYERID=95HR9CM6D56Q2&PAYMENTACTION=Sale& AMT=6.24& ITEMAMT=5.75& TAXAMT=0.49& L_NUMBER0=1& L_NAME0=A+Tale+of+Two+Cities& L_AMT0=2.50& L_QTY0=1& L_TAXAMT0=0.21& L_NAME1=Oliver+Twist& L_NUMBER1=2& L_AMT1=3.25& L_QTY1=1& L_TAXAMT1=0.28
|
|
[successResponseFields]&TOKEN=EC-4XH62109C8044521N& TRANSACTIONID=77U91743M2649930P&TRANSACTIONTYPE=expresscheckout& PAYMENTTYPE=instant&ORDERTIME=2006-08-22T22:49:50Z& AMT=6.24& CURRENCYCODE=USD&FEEAMT=0.48&TAXAMT=0.28&PAYMENTSTATUS=Completed& PENDINGREASON=None&REASONCODE=None
|
If you specify L_AMTn, you must specify the
ITEMAMT parameter. The values for
L_AMTn and
L_QTYn should add up to the
ITEMAMT.
If you specify L_TAXAMTn, you must specify the
TAXAMT parameter. The values for
L_TAXAMTn and
L_QTYn should add up to
TAXAMT.
Here are examples of ITEMAMT and
TAXAMT:
Note:
|
If the line item details do not add up to ITEMAMT or TAXAMT, the line item details are discarded, and the transaction is processed using the values of ITEMAMT or TAXAMT. The ACK value in the response is set to SuccessWithWarning.
|
If you specify values for any of these subtotal amounts, the total of the values must equal the AMT field specified in the request. For example, in the example below, the sum of
ITEMAMT,
SHIPPINGAMT,
HANDLINGAMT, and
TAXAMT equals the value for
AMT.
If one or more of the subtotals is zero, you can either include the field in the request with a value of zero, pass an empty string, or leave the field out of the request altogether. However, the sum of the remaining subtotal fields, if any are specified, must add up to
AMT.
|
[requiredSecurityParameters]& METHOD=DoExpressCheckoutPaymentTOKEN=EC-0EU150885J108392M&PAYERID=95HR9CM6D56Q2&PAYMENTACTION=Sale& AMT=192.22&I TEMAMT=176.02& SHIPPINGAMT=14.34& HANDLINGAMT=1.10& TAXAMT=0.76
|
|
[successResponseFields]&TOKEN=EC-0EU150885J108392M&TRANSACTIONID=29W817045L6797418&TRANSACTIONTYPE=expresscheckout&PAYMENTTYPE=instant&ORDERTIME=2006-08-23T16:20:22Z& AMT=192.22&CURRENCYCODE=USD&FEEAMT=5.87& TAXAMT=0.76&PAYMENTSTATUS=Completed&PENDINGREASON=None&REASONCODE=None
|
You may need to update transaction details on PayPal if the customer makes a change to the transaction after returning to your order review page. If the change causes new values for one or more of the following parameters, you need to update the transaction details on PayPal using
DoExpressCheckoutPayment:
l
|
CUSTOM: field for your own use
|
l
|
INVNUM: your invoice or tracking number
|
|
[requiredSecurityParameters]& METHOD=DoExpressCheckoutPayment& TOKEN=EC-5JA9268562132991T&PAYERID=95HR9CM6D56Q2&PAYMENTACTION=Sale&AMT=10.00& DESC=Order+for+5+books& CUSTOM=Thank+you+for+your+business!& INVNUM=ABC1234567
|
|
[successResponseFields]&TOKEN=EC-5JA9268562132991T&TRANSACTIONID=9JJ517146A732773R&TRANSACTIONTYPE=expresscheckout&PAYMENTTYPE=instant&ORDERTIME=2006-08-23T16:14:54Z&AMT=10.00&CURRENCYCODE=USD&FEEAMT=0.59&TAXAMT=0.00&PAYMENTSTATUS=Completed&PENDINGREASON=None&REASONCODE=None
|
You may need to update the shipping address on PayPal if the customer updates the shipping address after returning to your order review page. If this happens, you need to update the shipping address for this transaction on PayPal.
|
[requiredSecurityParameters]& METHOD=DoExpressCheckoutPayment& TOKEN=EC‑47C20533CU265432F&PAYERID=95HR9CM6D56Q2&PAYMENTACTION=Sale&AMT=10.00& SHIPTONAME=Michael+Brown& SHIPTOSTREET=22+First+Street& SHIPTOCITY=Chicago& SHIPTOCOUNTRYCODE=US& SHIPTOSTATE=IL& SHIPTOZIP=60605
|
|
[successResponseFields]&TOKEN=EC‑47C20533CU265432F& TRANSACTIONID=59L39584YA765250B&TRANSACTIONTYPE=expresscheckout& PAYMENTTYPE=instant&ORDERTIME=2006-08-23T16:08:12Z&AMT=10.00& CURRENCYCODE=USD&FEEAMT=0.59&TAXAMT=0.00&PAYMENTSTATUS=Completed& PENDINGREASON=None&REASONCODE=None
|
In the SetExpressCheckout request:
In the DoExpressCheckoutPayment request, you must set
PAYMENTACTION to
Sale. You must also provide line item details for each eBay auction so that the payment is properly reflected in My eBay.
L_EBAYITEMNUMBERn and
L_EBAYITEMAUCTIONTXNIDn
|
[requiredSecurityParameters]& METHOD=DoExpressCheckoutPayment& METHOD=DoExpressCheckoutPayment&TOKEN=EC‑47C20533CU265432F& PAYERID=95HR9CM6D56Q2&PAYMENTACTION=Sale&AMT=14.99&ITEMAMT=14.99& LNAME0=Item0&LAMT0=19.99&L_EBAYITEMNUMBER0=230128323048& L_EBAYITEMAUCTIONTXNID0=0&
|
|
[successResponseFields]&TOKEN=EC‑47C20533CU265432F& TRANSACTIONID=59L39584YA765250B&TRANSACTIONTYPE=expresscheckout& PAYMENTTYPE=instant&ORDERTIME=2006-08-23T16:08:12Z&AMT=14.99& CURRENCYCODE=USD&FEEAMT=0.00&TAXAMT=0.00&PAYMENTSTATUS=Completed& PENDINGREASON=None&REASONCODE=None
|