PHP Paypal SOAP SetExpressCheckout Request Message Example

This Paypal SOAP API operation page and this Paypal SOAP API Basic page are developed by in order to tell us how to use SetExpressCheckOut Request message in SOAP way.

However, the page does not tell us "EXACTLY HOW" to write the XML because they do not provide any exact example on how to format the XML (It only mention a little bit in the soap api basic page, but I get little value from reading this...).

I personally think that this document is badly written, because you still don't know how to get start by reading that.  Therefore, I test a lot of things in this poorly written documentation, and supplement it by an example here.

If you want to find out how do you format your XML correctly, here is the example.


  1. This example DOES NOT CONTAIN ALL options.  It covers around 60 - 70% options in the page.  But you should be comfortable on how to make use of that Paypal documentation easily.
  2. If you define a list of items in XML, but it does not display in paypal page, chances are you defined some other paypal parameters that stop the display of purchased items.  Please refer to the XML below to find out which parameters do so.
  3. This paypal XML is for version 87.0.  Therefore some parameters are deprecated if you refer the paypal soap api operation page.

Let's started:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="" xmlns:xsi="
instance" xmlns:xsd="">
        <RequesterCredentials xmlns="urn:ebay:api:PayPalAPI">
            <Credentials xmlns="urn:ebay:apis:eBLBaseComponents">
                <Password> enter-your-paypal-api-password</Password>
        <SetExpressCheckoutReq xmlns="urn:ebay:api:PayPalAPI">

                <Version xmlns="urn:ebay:apis:eBLBaseComponents">87.0</Version>

                <SetExpressCheckoutRequestDetails xmlns="urn:ebay:apis:eBLBaseComponents">



                        <OrderTotal currencyID="USD">555</OrderTotal>
                        <!-- This amount does not include tax, even if it is defined in PaymentDetailsItem-->
                        <ItemTotal currencyID="USD">500</ItemTotal>

                        <ShippingTotal currencyID="USD">15</ShippingTotal>
                        <HandlingTotal currencyID="USD">35</HandlingTotal>
                        <TaxTotal currencyID="USD">5</TaxTotal>

                        <!--This will not show if items are shown-->
                        <OrderDescription>(Optional) Description of items the buyer is purchasing.</OrderDescription>

                        <!--These items will make the item list disappear/not show-->
                        <NoteText>(Optional) Note to the merchant.</NoteText>
                        <ShippingDiscount currencyID="USD">-5</ShippingDiscount>
                        <InsuranceTotal currencyID="USD">20</InsuranceTotal>

                            <Name>I love you</Name>
                            <Street1>1  1  1, Unit 1</Street1>
                        <!--Total amount is 101-->
                            <Name>Name 1</Name>
                            <Amount currencyID="USD">100</Amount>
                            <Description>Description 1</Description>
                            <Tax currencyID="USD">1</Tax>

                        <!--Total amount 404-->
                            <Name>Name 2</Name>
                            <Amount currencyID="USD">200</Amount>
                            <Description>Description 2</Description>
                            <Tax currencyID="USD">2</Tax>


Popular posts from this blog

TCPDF How to show/display Chinese Character?

Using wget bypass htaccess username password 401 authorization

Wordpress Load balancing: 2 web servers 1 MySQL without any Cloud services