Why did I get PDT error 4003?
PayPal returned PDT FAIL Error 4003.
If Payment Data Transfer (PDT) doesn't work during testing, you'll usually see an error 4003 or a FAIL response, assuming the email address is confirmed.
If you're having trouble setting up Payment Data Transfer, do the following:
- Check the script.
- When testing Payment Data Transfer (PDT) in the Sandbox, check that your PDT script POSTs back information to www.sandbox.paypal.com. If testing on the Live PayPal site, check that the script POSTs data back to www.paypal.com. Currently, all sample code on the Live and Sandbox sites points back to the Live PayPal site. Thus, if during testing in the Sandbox you used the sample code to get started, you must edit the postback URL to avoid an INVALID error.
- Use the correct token for the correct account in your script. The token your script refers to should be the token listed in the profile of the PayPal account that's receiving the payment. See the samples in GitHub for more information on getting your token.
- Check the token. For PDT to work, you must confirm the email address used as the value of business in your button code. If your email address isn't confirmed, you won't see the PDT query string appended to your return URL. Make sure that the token in your script is a continuous string with no line breaks. For some languages, this may make a difference.
- Check the Auto Return URL. When you enable PDT, the URL you use as the default Auto Return URL must be a valid hostname or IP address. If you use an invalid URL, you won't see the intended result.
- Check user behavior. You can get PDT error 4003 if you reference the token more than five times. For example, if a user refreshes the PDT page five times after seeing the details, they'll see FAIL on the last refresh. This isn't an error; it's done on purpose for security, so that the URL that PDT creates can't be accessed indefinitely to fetch transaction-specific data.
PDT isn't designed to work with subscriptions. PDT displays only payment data. Because the data for a subscription payment doesn't include data such as the effective date or the terms of the subscription, all you can display on the PDT page is the amount of the payment. Most merchants would probably want to display the date of the subscription, the effective data, the terms, and so on. Again, since this information won't be transmitted back to your PDT script for subscription payments, you may not want to use PDT for subscriptions.
Was this article helpful?