Refund for PayPal Deposit


This page is about the V2 integration

For information on PayPalExpressCheckoutDeposit see here.


PayPal refunds should be used by the merchant to initiate a refund for the already made deposits and captured payments.

The merchant can decide to refund the full or a partial amount but it must sum up to a maximum of the total captured amount of the PayPal payment.

This chapter describes sending PayPal Refund requests for the following payment methods:

  • PayPal Reference Deposit (393)
  • PayPal Redirect Deposit (394)

To initiate a refund for a PayPal Reference Deposit or PayPal Redirect Deposit, the initiatePaymentFromReference API call must be used.

The paymentID of the original PayPal payment (received in the initiatePaymentResponse for initiating a new PayPal payment) must be used as originalPaymentID in the initiatePaymentFromReferenceRequest for creating the refund.

To support PayPal Refund functionality, PXP Financial offers the following payment method:

400PayPal Refund


Capture payments must be in state DepositedByProvider

Refunds can only be done for PayPal payments which were already captured with provider PayPal (Capture payments must be in state DepositedByProvider).

The following table contains the fields which have to/can be sent in the initiatePaymentFromReference :

Field (value type, required)Description
originalPaymentIDThe PaymentID received in the initiatePaymentResponse for initiating a new PayPal payment
(positiveMoney, required)
The amount of the refund must be lower than or equal to the total captured amount of the original PayPal Deposit payment and above 0. In case of partial refunds it must be lower than or equal to the total captured amount minus previous successful refunds.
(string, optional)
Description of the refund (e.g. Invoice ID) shown to the customer by PayPal in the payment history and in email communication.
Maximum 255 characters.
(positiveInt,, required)
Should contain value 400 for the "PayPal Refund" payment method.
(string, required)
Merchant’s transaction ID (order ID, purchase ID, sale ID ...). This ID will be shown as "PaymentID" in the merchants settlement report generated by PXP Financial and can be used for mapping/reconciliation purpose in the merchant system if applicable.
This ID must be unique per payment to allow for idempotency. If a merchant requires/wants to to send the same merchantTransactionID for refunds of a PayPal Deposit, please contact the PXP Financial Account Developer.


Remaining authorised amount

The remaining authorisation amount which could be captured still does not increase because of a refund.

Example initiatePaymentfromReference for refunding a PayPal Deposit with a partial amount

<initiatePaymentFromReferenceRequest xmlns="" xmlns:xsi="" xmlns:xsd="">
    <amount currencyCode="eur">2.00</amount>
        <data xsi:type="keyStringValuePair">
            <value>My refund payment</value>

The PayPal payment for which the initiatePaymentFromReference request was sent will remain in state ExecutedByProvider (142). A new payment which is linked to the original PayPal payment will be created.

IDNameSuccessful State
400PayPal RefundRefunded (125)

The response for the initiatePaymentFromReference request will contain all relevant data about the new payment which was created for the refund.

Example initiatePaymentFromReference response for refunding a PayPal payment (partially):

<initiatePaymentFromReferenceResponse xmlns="" xmlns:xsd="" xmlns:xsi="">
    <payment xsi:type="paymentWithPaymentAccount">
            <value>PayPal Refund</value>
        <amount currencyCode="EUR">2.00</amount>
                <detail xsi:type="keyStringValuePair">
        <baseAmount currencyCode="EUR">2</baseAmount>

Payment State Flow for all PayPal Partial Refund payments:


If a refund cannot be done due to invalid data (e.g. unknown originalPaymentID) the following error codes are returned:

Error CodeReasonDescription
504Missing fieldNot all required fields necessary for specific payment method have been sent.
e.g. amount or PaymentDescription (mandatory for refunds)
1002Invalid refund amountThere are 2 possible reasons for this error:
The amount of the refund is higher than the amount of the original payment
The amount of the refund is higher than the allowed refundable amount (calculated as [original payment amount] - sum [all partial refunds])
1003Original payment is refundable / not in a refundable stateRefund not possible
1004Invalid payment methodThe specified refund payment method ID is not allowed for the original deposit’s payment method.


Generic Error Codes

Find here more information about Error Handling and generic error codes.

Refund initiated via PXP Admin or via Paypal Account (not triggerd by merchant system)

It is possible, that Paypal Refunds are created by an operator via the PXP Admin or the Paypal account. In this case, the PXP system

  • creates the refund
  • notifies the merchant (The standard notification mechanism is used for notifying the merchant in the background (asynchronously) about payment state changes. For more information see PaymentStateChangedNotification. )

Example handlePaymentStateChangedNotificationRequest for a refund of a PayPal payment, if it was created via PXP Admin or Paypal Account and not via the merchant system:

<?xml version="1.0" encoding="utf-16"?>
<handlePaymentStateChangedNotificationRequest xmlns:xsd= xmlns:xsi=>
  <payment xmlns:q1= xsi:type="paymentWithPaymentAccount">
      <value>PayPal Refund<value>
    <amount currencyCode="EUR">11.0000<amount>
      <paymentStateDetails xsi:nil="true" />
    <baseAmount currencyCode="EUR">11.0000<baseAmount>
      <detail xsi:type="keyStringValuePair">
      <detail xsi:type="keyIntValuePair">

How to create PayPal Refunds manually

Create a PayPal Refund via PSA

It is also possible to initiate a PayPal refund via PXP Payment Service Admin tool.

Create a PayPal Refund via the merchants PayPal Account.

It is also possible to initiate a PayPal refund via the merchant PayPal account.

How to test PayPal Refunds

  • Test-Cases applicable for PayPal Refunds:
    Test Scenarios can be found here: PayPal Test Cases
  • Information how to manipulate a PayPal capture payment for testing purposes using the PXP Admin tool: