Retrieve PayPal Transaction

Retrieve is a request that gets details about a past PayPal transaction, such as the transaction ID, amount, currency, payer info or vaulted shopper, PayPal URL, order ID and so on.

Note: If you are using the API + Hosted Page Hybrid solution, this can also return transactions created in Hosted Payment Pages.

Try it in the API Explorer

Request Content

No content is required in the request body. Enter the relevant IDs in the request URL, as follows:

Retrieve based on Order ID
Enter the PayPal Order ID into the web service URL, in the format:
services/2/alt-transactions/resolve?orderId={orderId}

For example:
services/2/alt-transactions/resolve?orderId=5666625

Retrieve based on Transaction ID
Enter the transactionId into the web service URL, in the format:
services/2/alt-transactions/{transactionId}

For example:
services/2/alt-transactions/38430646

📘

The transaction ID is created only after the PayPal transaction is complete. It is then returned in the altTransaction object.

Retrieve based on Merchant Transaction ID and Merchant ID
Enter the merchantTransactionId and merchantId into the web service URL, in the format:
services/2/alt-transactions/{merchantTransactionId},{merchantId}

For example:
services/2/alt-transactions/3,456

Response Details

If successful, the response HTTP status code is 200 OK.
The response contains the retrieved altTransaction object.

If you passed metadata in the original transaction request, this metadata will also be retrieved.

If the payment was for a subscription, the 'paypalSubscriptionId' will also be included in the response. For more information, see the guide to processing merchant-managed PayPal subscriptions.


Examples

Request Examples

curl -v -X GET https://sandbox.bluesnap.com/services/2/alt-transactions/resolve?orderId=3979639 \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \ 
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
curl -v -X GET https://sandbox.bluesnap.com/services/2/alt-transactions/38501970 \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \ 
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
curl -v -X GET https://sandbox.bluesnap.com/services/2/alt-transactions/12345,395608 \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \ 
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '

Response Examples

{
    "amount": 100,
    "currency": "USD",
    "transactionApprovalDate": "09/29/2020",
    "transactionApprovalTime": "13:08:47",
    "vaultedShopperId": 1234,
    "payerInfo": {
        "firstName": "John",
        "lastName": "Doe"
    },
    "processingInfo": { "processingStatus": "SUCCESS" },
    "softDescriptor": "ABC COMPANY",
    "transactionId": 38501970,
    "paypalTransaction": {
        "paypalUrl": "https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_express-checkout&token=EC-1H0778387R312591N",
        "orderId": 3979639
    }
}
{
    "amount": 100,
    "vaultedShopperId": 1234,
    "payerInfo": {
        "firstName": "John",
        "lastName": "Doe"
    },
    "processingInfo": {"processingStatus": "PENDING"},
    "softDescriptor": "ABC COMPANY",
    "currency": "USD",
    "paypalTransaction": {
        "paypalUrl": "https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_express-checkout&token=EC-5XL55248WK026621X",
        "orderId": 3979303
    }
}
{
    "amount": 100,
    "currency": "USD",
    "transactionApprovalDate": "09/29/2020",
    "transactionApprovalTime": "13:08:47",
    "vaultedShopperId": 1234,
    "payerInfo": {
        "firstName": "John",
        "lastName": "Doe"
    },
    "processingInfo": { "processingStatus": "SUCCESS" },
    "softDescriptor": "ABC COMPANY",
    "transactionId": 38501970,
    "paypalTransaction": {
        "paypalUrl": "https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_express-checkout&token=EC-1H0778387R312591N",
        "orderId": 3979639
    }
}
{
    "amount": 100,
    "currency": "USD",
    "transactionApprovalDate": "09/29/2020",
    "transactionApprovalTime": "13:08:47",
    "vaultedShopperId": 1234,
    "processingInfo": { "processingStatus": "SUCCESS" },
    "softDescriptor": "ABC COMPANY",
    "transactionId": 38500786,
    "paypalTransaction": {
        "paypalUrl": "https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_express-checkout",
        "orderId": 980111,
        "paypalSubscriptionId": 1234567
    }
}
{
    "amount": 100,
    "vaultedShopperId": 1234,
    "payerInfo": {
        "firstName": "John",
        "lastName": "Doe"
    },
    "merchantTransactionId": 12345,
    "processingInfo": {"processingStatus": "PENDING"},
    "softDescriptor": "ABC COMPANY",
    "currency": "USD",
    "transactionMetaData": {"metaData": [
        {
            "metaValue": 20,
            "metaKey": "cityTaxAmount",
            "metaDescription": "City Tax Amount"
        },
        {
            "metaValue": 10,
            "metaKey": "shippingAmount",
            "metaDescription": "Shipping Amount"
        },
        {
            "metaValue": 20,
            "metaKey": "stateTaxAmount",
            "metaDescription": "State Tax Amount"
        }
    ]},
    "paypalTransaction": {
        "paypalUrl": "https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_express-checkout&token=EC-2RK67425NC888032A",
        "orderId": 3979665
    }
}
{
    "transactionId": "38417606",
    "softDescriptor": "ABC COMPANY",
    "amount": 50,
    "currency": "USD",
    "transactionApprovalDate": "09/29/2020",
    "transactionApprovalTime": "13:08:47",
    "vaultedShopperId": 19490082,
    "paypalTransaction": {
        "paypalUrl": "https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_express-checkout&token=EC-7YD07100DG923212M",
        "orderId": 3906757
    },
    "processingInfo": {
        "processingStatus": "REFUNDED"
    },
    "refunds": {
        "refund": [
            {
                "amount": 1,
                "currency": "USD",
                "date": "2016-09-03"
            },
            {
                "amount": 1,
                "currency": "USD",
                "date": "2016-09-03"
            },
            {
                "amount": 48.05,
                "currency": "USD",
                "date": "2016-09-03"
            }
        ]
    }
}

Example Descriptions

Retrieve based on Order ID

This is a retrieval based on the orderId, which is provided by PayPal and appears in the response from the API for that transaction.

Retrieve based on Transaction ID

This is a retrieval based on the transactionId. This ID is created after the PayPal transaction has been completed.

Retrieve based on Merchant Transaction ID and Merchant ID

This is a retrieval based on the merchantTransactionId and merchantId. It is applicable to merchants who pass their own Merchant Transaction IDs with each transaction.

Response for transaction with refunds

If one or more refunds (including partial refunds) have been applied to the transaction, the refund details appear in the refunds element.


Back to Top

API Explorer (for request based on Order ID)

To test out a call, enter an existing order ID (e.g 5666625) in the orderId field. This will automatically insert the ID into the request URL. Leave the Body Content field empty.

Language
Credentials
:
Click Try It! to start a request and see the response here!