All docs This doc
Skip to end of metadata
Go to start of metadata


The following operations allow you to work with captured payments. Click an operation name to see details on how to use it.

For a sample proxy service the illustrates how to work with captured payments, see Sample configuration.



Looks up details about a captured payment


Refunds a captured payment

Operation details

This section provides details on each of the operations.

Looking up a captured payment 

 Use this operation to get details about a captured payment.

  • captureId: Required - The capture ID.
Sample request

Following is a sample REST request that can be handled by the lookupCapturedPayment operation.

Sample request for lookupCapturedPayment
	"apiUrl" : "",
	"accessToken" : "FiUebZi3SkXRUVmVXOZr4N0yIshk6fIk4KkXbK40MpY",
	"captureId" : "2DC87612EK520411B"

Related PayPal documentation

Refunding a captured payment 

Use this operation to refund a captured payment.



  • captureId : Required - The capture ID.
  • total: Required - Total amount charged from the payer to the payee.  
  • currency: Required - 3-letter currency code.
  • details: Required - Additional details related to a payment amount.
Sample request

Following is a sample REST request that can be handled by the refundCapturedPayment operation.

Sample request for refundCapturedPayment

Following is more information on the details property:

  • subtotal: Required - Subtotal (amount) of items being paid for before tax and shipping. 10 characters max. with support for two decimal places.
  • tax: Required - Amount charged for tax. 10 characters max. with support for two decimal places.
  • shipping: Required - Amount charged for shipping. 10 characters max. with support for two decimal places.
Related PayPal documentation

Sample configuration

Following is a sample proxy service that illustrates how to connect to PayPal with the init operation and use the lookupCapturedPayment operation. The sample request for this proxy can be found in lookupCapturedPayment sample request. You can use this sample as a template for using other operations in this category.  

As a best practice, create a separate sequence for handling the response payload for errors. In the following sample, this sequence is "faultHandlerSeq".

Sample proxy
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns=""
      <inSequence onError="faultHandlerSeq">
         <property name="apiUrl"
		 <property name="accessToken"
         <property name="captureId"
		 <filter source="$axis2:HTTP_SC" regex="^[^2][\d][\d]">
               <property name="ERROR_CODE" expression="$axis2:HTTP_SC"/>
               <switch source="$axis2:HTTP_SC">
                  <case regex="401">
                     <property name="ERROR_MESSAGE" value="Unauthorized"/>
                  <case regex="404">
                     <property name="ERROR_MESSAGE" value="Not Found"/>
                     <property name="error_description" expression="json-eval($.message)"/>
				  <case regex="400">
                     <property name="ERROR_MESSAGE" value="Bad Request"/>
                     <property name="error_description" expression="json-eval($.message)"/>
               <sequence key="faultHandlerSeq"/>

  • No labels