Help Center - Personal Account
  • Home
  • Payments and Transfers
  • Disputes and Limitations
  • My Account
  • My Wallet
  • Login & Security
  • Seller Tools

How do I avoid duplicate transactions?

To avoid duplicate transactions, you need to pass an invoice ID in your API payment request. This feature is available for PayPal Payments Standard, and PayPal Payments Pro (SOAP and NVP). Configure your profile to block duplicate invoice numbers. We will check whether the passed invoice ID has already been paid to your account. For example, if invoice ID 1001 has been paid, 1001 will be denied if it is passed in a subsequent API payment request.

To pass an invoice number to PayPal Payments Standard, add a line of HTML code to your existing button code, like the following example: 

<inpute type="hidden" name="invoice" value="001">

Note: You can't add this code to a button originally created as encrypted. 

For PayPal Payments Pro, the parameter you pass depends on the type of API calls you're making:

  • For SOAP, use InvoiceID
  • For NVP, use INVNUM

For REST API transactions, use the PayPal-Request-ID header variable to prevent duplicate transactions. When you add this variable to your integration, it prevents duplicate transactions with the same value. 

If a transaction uses the same PayPal-Request-Id, it will return the following example API response: 

[name] => DUPLICAT_REQUEST_ID

[message] => The value of PayPal-Request-Id header has already been used

[information_link] => https://developer.paypal.com/webapps/developer/docs/api/#DUPLICATE_REQUEST_ID

[debug_id] => b008929a73c5f

PayPal Payments Pro returns API error code 10412 if it detects a duplicate invoice number. 

See the Developer Portal for a complete list of NVP/SOAP API error codes.

More ways we can help

We use cookies to improve your experience on our site. May we use marketing cookies to show you personalized ads? Manage all cookies