Help Article

How do I avoid duplicate transactions?

Blocking duplicate invoice IDs

To avoid duplicate transactions, you need to pass an invoice number to the PayPal system. This feature is available for PayPal Payments Standard (also known as Website Payments Standard) and PayPal Payments Pro (SOAP and NVP). Once you configure your profile to block duplicate invoice numbers, PayPal will check whether each passed invoice number has already been paid in your account. For example, if invoice 1001 has been paid, 1001 will be denied if it is passed to the PayPal account a second time.

Here's how to block duplicate invoice IDs in your profile:
  1. Log in to your PayPal account.
  2. Select Profile > Profile and settings.
  3. Click My selling tools.
  4. Click Update next to Block payments.
  5. Select Yes, block multiple payments per invoice ID under Block accidental payments.
  6. Click Save.
 

Passing invoice numbers to PayPal Payments Standard

To pass an invoice number to PayPal Payments Standard, add a line of code to your existing button code, similar to the following example:
 
<input type="hidden" name="invoice" value="001">

Note: You can't add this code to a button originally created as encrypted.
 
Passing invoice IDs to PayPal Payments Pro
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.

 


Preventing duplicate transactions and retrying REST API transactions using PayPal-Request-Id

To prevent duplicate REST API transactions, use the variable PayPal-Request-Id. When you add this variable to your integration, it prevents duplicate transactions with the same value. It also allows you to resubmit transactions if the system times out before you get an API response back to verify that a previous transaction completed. 

When a duplicate transaction uses the same PayPal-Request-Id, it will return the following example response:
 
    [name] => DUPLICATE_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

See REST API authentication and headers for more information on using PayPal-Request-Id.

PayPal Payments Pro returns API error code 10412 if it detects a duplicate invoice number. For a complete list of API error codes, and details regarding the 10412 error, see API error codes.
We’re sorry, the page you’re looking for is no longer available. Please try your search again in our Help Center if you have a question or want to contact us.