Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9130693
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:00:29+00:00 2026-06-17T08:00:29+00:00

I am trying to integrate payapl through sandbox for my website. I am able

  • 0

I am trying to integrate payapl through sandbox for my website.

I am able to send multiple items to paypal and it works fine. however i want to set CART-WIDE shipping cost and send it to paypal.

I am getting error code:

10413 ("ErrorCode=10413&Desc=Transaction refused because of an invalid argument. See additional error messages for details.& Desc2=The totals of the cart item amounts do not match order amounts.")

My CART:
Item: Mens Jackets
Price: 14.99
DESC: "SAMPLE"
QTY: 1
ITEM TOTAL: 14.99
SHIPPING: 5.99

CART TOTAL: 20.94

I am setting the following variables and i dont know what i am doing wrong.

NVPCodec encoder = new NVPCodec();
                        encoder["METHOD"] = "SetExpressCheckout";
                        encoder["RETURNURL"] = returnURL;
                        encoder["CANCELURL"] = cancelURL;
                        encoder["BRANDNAME"] = "Mountain Warehouse Sample Application";
                        encoder["PAYMENTREQUEST_0_PAYMENTACTION"] = "Sale";
                        encoder["PAYMENTREQUEST_0_CURRENCYCODE"] = "GBP";

                        // Get the Shopping Cart Products
                        int i = 0;
                        Decimal totalItemAmt = 0.00M;
                        string cartShippingAmt = "";
                        foreach (BasketItem item in basket.Items)
                        {
                                    if (item.OrderItemType == OrderItemType.Product)
                                    {
                                                encoder["L_PAYMENTREQUEST_0_NAME" + i] = item.Name.ToString();
                                                encoder["L_PAYMENTREQUEST_0_AMT" + i] = item.Price.ToString("0.00");
                                                encoder["L_PAYMENTREQUEST_0_QTY" + i] = item.Quantity.ToString();
                                                i++;
                                                totalItemAmt += Convert.ToDecimal(item.Price.ToString("0.00"));
                                    }

                                    if (item.OrderItemType == OrderItemType.Shipping)
                                    {
                                                cartShippingAmt = item.Price.ToString("0.00");
                                    }
                        }

                        encoder["PAYMENTREQUEST_0_ITEMAMT"] = totalItemAmt.ToString();
                        encoder["PAYMENTREQUEST_0_AMT"] = amt;
                        encoder["HANDLING_CART"] = cartShippingAmt;

Here is the query that gets send to paypal

METHOD=SetExpressCheckout&
RETURNURL=http%3a%2f%2flocalhost%3a1234%2fCheckout%2fCheckoutReview.aspx&
CANCELURL=http%3a%2f%2flocalhost%3a1234%2fCheckout%2fCheckoutCancel.aspx&
BRANDNAME=Sample+Application&
PAYMENTREQUEST_0_PAYMENTACTION=Sale&
PAYMENTREQUEST_0_CURRENCYCODE=GBP&
L_PAYMENTREQUEST_0_NAME0=MENS+JACKETS&
L_PAYMENTREQUEST_0_AMT0=14.99&
L_PAYMENTREQUEST_0_QTY0=1&
PAYMENTREQUEST_0_ITEMAMT=14.99&
HANDLING_CART=5.95&
PAYMENTREQUEST_0_AMT=20.94

I think i am assigning wrong variable Shipping cost for entire cart.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T08:00:30+00:00Added an answer on June 17, 2026 at 8:00 am

    You’ve got a few things wrong here.

    First, some of the request parameters you’re using aren’t right. HANDLING_CART is not a valid request parameter. I think what you’re looking for there is HANDLINGAMT (which would actually be PAYMENTREQUEST_0_HANDLINGAMT).

    In each payment, the total of ITEMAMT + SHIPPINGAMT + HANDLINGAMT + TAXAMT needs to equal AMT. In your case, PayPal is ignoring the invalid parameter you’re sending, so it ends up seeing the following…

    PAYMENTREQUEST_0_ITEMAMT = 14.99
    PAYMENTREQUEST_0_AMT = 20.94

    It’s not seeing your handling amount because that parameter is invalid, therefore, the totals don’t match up according to what they’re seeing. You just need to change HANDLING_CART to PAYMENTREQUEST_0_HANDLINGAMT and that should fix your issue.

    Here’s a sample of a working SetExpressCheckout request with multiple items and some additional options included…

    [USER] => ****
    [PWD] => ****
    [VERSION] => 97.0
    [BUTTONSOURCE] => AngellEYE_PHPClass
    [SIGNATURE] => ****
    [METHOD] => SetExpressCheckout
    [MAXAMT] => 200.00
    [RETURNURL] => http://paypal.angelleye.com/standard/samples/DoExpressCheckoutPayment.php
    [CANCELURL] => http://paypal.angelleye.com/paypal/class/cancel.php
    [ALLOWNOTE] => 1
    [HDRIMG] => http://paypal.angelleye.com/images/hdrimg.jpg
    [SOLUTIONTYPE] => Sole
    [LANDINGPAGE] => Billing
    [BRANDNAME] => Angell EYE
    [CUSTOMERSERVICENUMBER] => 555-555-5555
    [GIFTMESSAGEENABLE] => 1
    [GIFTRECEIPTENABLE] => 1
    [GIFTWRAPENABLE] => 1
    [GIFTWRAPNAME] => Box with Ribbon
    [GIFTWRAPAMOUNT] => 2.50
    [BUYEREMAILOPTIONENABLE] => 1
    [SURVEYQUESTION] => Did you like this checkout?
    [SURVEYENABLE] => 1
    [BUYERREGISTRATIONDATE] => 2012-07-14T00:00:00Z
    [L_SURVEYCHOICE0] => Yes
    [L_SURVEYCHOICE1] => No
    [PAYMENTREQUEST_0_AMT] => 100.00
    [PAYMENTREQUEST_0_CURRENCYCODE] => USD
    [PAYMENTREQUEST_0_ITEMAMT] => 80.00
    [PAYMENTREQUEST_0_SHIPPINGAMT] => 15.00
    [PAYMENTREQUEST_0_TAXAMT] => 5.00
    [PAYMENTREQUEST_0_DESC] => This is a test order.
    [PAYMENTREQUEST_0_NOTETEXT] => This is a test note before ever having left the web site.
    [PAYMENTREQUEST_0_PAYMENTACTION] => Sale
    [L_PAYMENTREQUEST_0_NAME0] => Widget 123
    [L_PAYMENTREQUEST_0_DESC0] => Widget 123
    [L_PAYMENTREQUEST_0_AMT0] => 40.00
    [L_PAYMENTREQUEST_0_NUMBER0] => 123
    [L_PAYMENTREQUEST_0_QTY0] => 1
    [L_PAYMENTREQUEST_0_ITEMURL0] => http://www.angelleye.com/products/123.php
    [L_PAYMENTREQUEST_0_NAME1] => Widget 456
    [L_PAYMENTREQUEST_0_DESC1] => Widget 456
    [L_PAYMENTREQUEST_0_AMT1] => 40.00
    [L_PAYMENTREQUEST_0_NUMBER1] => 456
    [L_PAYMENTREQUEST_0_QTY1] => 1
    [L_PAYMENTREQUEST_0_ITEMURL1] => http://www.angelleye.com/products/456.php
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to integrate Paypal Express checkout into my website. Everything worked fine
I am trying to integrate a PayPal Website Payments Standard > Cart Upload payment
I'm trying to integrate PayPal into my Magento 1.6 store, preferably the Website Payments
I am trying to integrate PayPal buttons to a website. It was a really
While trying to integrate Yahoo Media Player into my own website, I want to
I'm trying to integrate paypal in a php website but I'm not sure how
I'm trying to integrate PayPal into my website using their PHP API. I've gone
I'm trying to integrate Paypal and I'm using sandbox in the process. I follow
I am currently trying to integrate Paypal's MECL in an already existing IOS project
I have a php application , and I'm trying to integrate with paypal payment

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.