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 8544303
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T12:31:28+00:00 2026-06-11T12:31:28+00:00

I am using the PayPal sandbox in ASP.Net C# 4.0. I added the following

  • 0

I am using the PayPal sandbox in ASP.Net C# 4.0. I added the following web references:

https://www.sandbox.paypal.com/wsdl/PayPalSvc.wsdl
https://www.paypalobjects.com/wsdl/PayPalSvc.wsdl 

When I run this code:

PayPalAPIHelper.PayPalSandboxWS.SetExpressCheckoutReq req = new PayPalAPIHelper.PayPalSandboxWS.SetExpressCheckoutReq()
        {
            SetExpressCheckoutRequest = new PayPalAPIHelper.PayPalSandboxWS.SetExpressCheckoutRequestType()
            {
                Version = Version,
                SetExpressCheckoutRequestDetails = reqDetails
            }
        };

        // query PayPal and get token
        PayPalAPIHelper.PayPalSandboxWS.SetExpressCheckoutResponseType resp = BuildPayPalSandboxWebservice().SetExpressCheckout(req);

In my resp object, the error message says:

Security header is not valid

I was told to give it correct API credentials. I signed up on developer.paypal.com and i’m assuming the email address and password i used are my valid credentials. How and where do I give it my API credentials? Thanks

  • 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-11T12:31:29+00:00Added an answer on June 11, 2026 at 12:31 pm

    Did you check the endpoint addresses in your web.config file

    Those should be referenced to following url’s

    For API Certificate => SOAP https://api.sandbox.paypal.com/2.0/

    For API Signature => SOAP https://api-3t.sandbox.paypal.com/2.0/

    If you are using Signature then use the following code

    CustomSecurityHeaderType type = new CustomSecurityHeaderType();
                type.Credentials = new UserIdPasswordType()
                {
                    Username = ConfigurationManager.AppSettings["PayPalUserName"], //Not paypal login username
                    Password = ConfigurationManager.AppSettings["PayPalPassword"], //not login password
                    Signature = ConfigurationManager.AppSettings["PayPalSignature"]
                };
    

    To get Paypal signature follow the link

    For more info click here

    Update:

    Please check the following code it is working for me

    CustomSecurityHeaderType type = new CustomSecurityHeaderType();
                type.Credentials = new UserIdPasswordType()
                {
                    Username = ConfigurationManager.AppSettings["PayPalUserName"],
                    Password = ConfigurationManager.AppSettings["PayPalPassword"],
                    Signature = ConfigurationManager.AppSettings["PayPalSignature"]
                };
    
    
                PaymentDetailsItemType[] pdItem = new PaymentDetailsItemType[1];
                pdItem[0] = new PaymentDetailsItemType() 
                { 
                    Amount = new BasicAmountType(){currencyID = CurrencyCodeType.USD,Value = ItemPrice},
                    Name = ItemName,
                    Number = ItemNumber,
                    Description = ItemDescription, 
                    ItemURL = ItemUrl
                };
    
                SetExpressCheckoutRequestDetailsType sdt = new SetExpressCheckoutRequestDetailsType();
                sdt.NoShipping = "1";
                PaymentDetailsType pdt = new PaymentDetailsType()
                {
                    OrderDescription = OrderDesc,
                    PaymentDetailsItem = pdItem,
                    OrderTotal = new BasicAmountType()
                    {                    
                        currencyID = CurrencyCodeType.USD,
                        Value = ItemPrice
                    }
                };
    
                sdt.PaymentDetails = new PaymentDetailsType[] { pdt };
                sdt.CancelURL = "http://localhost:62744/PaymentGateway/PaymentFailure.aspx";
                sdt.ReturnURL = "http://localhost:62744/PaymentGateway/ExpressCheckoutSuccess.aspx";
    
                SetExpressCheckoutReq req = new SetExpressCheckoutReq()
                {
                    SetExpressCheckoutRequest = new SetExpressCheckoutRequestType()
                    {
                        SetExpressCheckoutRequestDetails = sdt,
                        Version = "92.0"
                    }
                };
                var paypalAAInt = new PayPalAPIAAInterfaceClient();
                var resp = paypalAAInt.SetExpressCheckout(ref type, req);
                if (resp.Errors != null && resp.Errors.Length > 0)
                {
                    // errors occured
                    throw new Exception("Exception(s) occured when calling PayPal. First exception: " +
                        resp.Errors[0].LongMessage);
                }
    
                Response.Redirect(string.Format("{0}?cmd=_express-checkout&token={1}",
                    ConfigurationManager.AppSettings["PayPalOriginalUrl"], resp.Token));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

'm using the project http://www.codeproject.com/Articles/42894/Introduction-to-PayPal-for-C-ASP-NET-developers to test the PayPal's sandbox. I have a sandbox
I am using the PayPal sandbox in ASP.Net C# 4.0. I added the following
how can i make payment using this URL https://api-3t.sandbox.paypal.com/nvp and is there any difference
<form action=https://www.sandbox.paypal.com/cgi-bin/webscr method=post> <input type=hidden name=cmd value=_s-xclick> <input type=hidden name=hosted_button_id value=YYHZM9FTBZQGW> <input type=hidden name=amount
I am using the following code to accept payments for digital goods: https://www.x.com/blogs/Nate/2011/01/07/digital-goods-with-express-checkout-in-php I
I'm am using ASP.NET MVC to create a page that posts to the Paypal
I have tried to integrate paypal sandbox with my project in asp.net. Redirection to
I use PayPal in ASP.net and when I tested in sandbox everything was correct,
I'm successfully using Paypal Express Checkout in a marketplace web app passing for every
I'm trying to make Paypal's sandbox API work and I'm using a sample project

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.