{"_id":"59dfa5858b51880010b74aeb","category":{"_id":"59dfa5828b51880010b74ab9","version":"59dfa5828b51880010b74ab6","project":"57336fd5a6a9c40e00e13a0b","__v":0,"sync":{"url":"","isSync":false},"reference":true,"createdAt":"2016-01-13T18:31:11.123Z","from_sync":false,"order":2,"slug":"paypal-transaction-service","title":"PayPal Transactions"},"project":"57336fd5a6a9c40e00e13a0b","parentDoc":null,"user":"560d5913af97231900938124","version":{"_id":"59dfa5828b51880010b74ab6","project":"57336fd5a6a9c40e00e13a0b","__v":1,"createdAt":"2017-10-12T17:25:22.850Z","releaseDate":"2017-10-12T17:25:22.850Z","categories":["59dfa5828b51880010b74ab7","59dfa5828b51880010b74ab8","59dfa5828b51880010b74ab9","59dfa5828b51880010b74aba","59dfa5828b51880010b74abb","59dfa5828b51880010b74abc","59dfa5828b51880010b74abd","59dfa5828b51880010b74abe","59dfa5828b51880010b74abf","59dfa5828b51880010b74ac0","59dfa5828b51880010b74ac1","59dfa5828b51880010b74ac2","59dfa5828b51880010b74ac3","59dfa5828b51880010b74ac4","59dfa5828b51880010b74ac5"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":false,"codename":"3.23 Release","version_clean":"8976.0.0-JSON","version":"8976-JSON"},"__v":0,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-01-18T17:46:08.834Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[]},"method":"get","results":{"codes":[{"code":"","language":"text"}]},"settings":"57ee593a21ceb20e0061959e","auth":"optional","params":[{"_id":"56953ff3fe18811700c9bfcc","ref":"","in":"path","required":true,"desc":"order ID received in the response","default":"","type":"string","name":"orderId"}],"url":"/alt-transactions/resolve?orderId=:orderId"},"isReference":true,"order":2,"body":"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.\n\n<a class=\"btn btn-success\" href=\"#section-api-explorer-for-request-based-on-order-id-\" role=\"button\">Try it in the API Explorer</a>\n\n###Request Content\nNo content is required in the request body. Enter the relevant IDs in the request URL, as follows:\n\n**Retrieve based on Order ID**\nEnter the PayPal Order ID into the web service URL, in the format:\n`services/2/alt-transactions/resolve?orderId={orderId}`\n\nFor example:\n`services/2/alt-transactions/resolve?orderId=5666625`\n\n**Retrieve based on Transaction ID**\nEnter the `transactionId` into the web service URL, in the format:\n`services/2/alt-transactions/{transactionId}`\n\nFor example:\n`services/2/alt-transactions/38430646`\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"The transaction ID is created only after the PayPal transaction is complete. It is then returned in the `altTransaction` object.\"\n}\n[/block]\n**Retrieve based on Merchant Transaction ID and Merchant ID**\nEnter the `merchantTransactionId` and `merchantId` into the web service URL, in the format:\n`services/2/alt-transactions/{merchantTransactionId},{merchantId}`\n\nFor example:\n`services/2/alt-transactions/3,456`\n\n###Response Details\nIf successful, the response HTTP status code is 200 OK.\nThe response contains the retrieved **[altTransaction](doc:alt-transaction)** object.\n\nIf you passed metadata in the original transaction request, this metadata will also be retrieved.\n\nIf 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](/v2.0/docs/subscription-management#section-processing-merchant-managed-paypal-subscription-payments).\n\n<hr>\n\n##Examples\n\n###Request Examples\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -v -X GET https://sandbox.bluesnap.com/services/2/alt-transactions/resolve?orderId=3979639 \\\\\\n-H 'Content-Type: application/json' \\\\\\n-H 'Accept: application/json' \\\\ \\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\",\n      \"language\": \"curl\",\n      \"name\": \"Retrieve PayPal Transaction Request: by Order ID\"\n    },\n    {\n      \"code\": \"curl -v -X GET https://sandbox.bluesnap.com/services/2/alt-transactions/38501970 \\\\\\n-H 'Content-Type: application/json' \\\\\\n-H 'Accept: application/json' \\\\ \\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\",\n      \"language\": \"curl\",\n      \"name\": \"by Transaction ID\"\n    },\n    {\n      \"code\": \"curl -v -X GET https://sandbox.bluesnap.com/services/2/alt-transactions/12345,395608 \\\\\\n-H 'Content-Type: application/json' \\\\\\n-H 'Accept: application/json' \\\\ \\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\",\n      \"language\": \"curl\",\n      \"name\": \"by Merchant Transaction ID and Merchant ID\"\n    }\n  ]\n}\n[/block]\n###Response Examples\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"amount\\\": 100,\\n    \\\"vaultedShopperId\\\": 1234,\\n    \\\"payerInfo\\\": {\\n        \\\"firstName\\\": \\\"John\\\",\\n        \\\"lastName\\\": \\\"Doe\\\"\\n    },\\n    \\\"processingInfo\\\": {\\\"processingStatus\\\": \\\"SUCCESS\\\"},\\n    \\\"softDescriptor\\\": \\\"ABC COMPANY\\\",\\n    \\\"currency\\\": \\\"USD\\\",\\n    \\\"transactionId\\\": 38501970,\\n    \\\"paypalTransaction\\\": {\\n        \\\"paypalUrl\\\": \\\"https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_express-checkout&token=EC-1H0778387R312591N\\\",\\n        \\\"orderId\\\": 3979639\\n    }\\n}\",\n      \"language\": \"json\",\n      \"name\": \"Retrieve PayPal Transaction Reponse: 200 OK - by Order ID (Success)\"\n    },\n    {\n      \"code\": \"{\\n    \\\"amount\\\": 100,\\n    \\\"vaultedShopperId\\\": 1234,\\n    \\\"payerInfo\\\": {\\n        \\\"firstName\\\": \\\"John\\\",\\n        \\\"lastName\\\": \\\"Doe\\\"\\n    },\\n    \\\"processingInfo\\\": {\\\"processingStatus\\\": \\\"PENDING\\\"},\\n    \\\"softDescriptor\\\": \\\"ABC COMPANY\\\",\\n    \\\"currency\\\": \\\"USD\\\",\\n    \\\"paypalTransaction\\\": {\\n        \\\"paypalUrl\\\": \\\"https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_express-checkout&token=EC-5XL55248WK026621X\\\",\\n        \\\"orderId\\\": 3979303\\n    }\\n}\",\n      \"language\": \"json\",\n      \"name\": \"200 OK - by Order ID (Pending)\"\n    },\n    {\n      \"code\": \"{\\n    \\\"amount\\\": 100,\\n    \\\"vaultedShopperId\\\": 1234,\\n    \\\"payerInfo\\\": {\\n        \\\"firstName\\\": \\\"John\\\",\\n        \\\"lastName\\\": \\\"Doe\\\"\\n    },\\n    \\\"processingInfo\\\": {\\\"processingStatus\\\": \\\"SUCCESS\\\"},\\n    \\\"softDescriptor\\\": \\\"ABC COMPANY\\\",\\n    \\\"currency\\\": \\\"USD\\\",\\n    \\\"transactionId\\\": 38501970,\\n    \\\"paypalTransaction\\\": {\\n        \\\"paypalUrl\\\": \\\"https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_express-checkout&token=EC-1H0778387R312591N\\\",\\n        \\\"orderId\\\": 3979639\\n    }\\n}\",\n      \"language\": \"json\",\n      \"name\": \"200 OK - by Transaction ID\"\n    },\n    {\n      \"code\": \"{\\n    \\\"amount\\\": 100,\\n    \\\"vaultedShopperId\\\": 1234,\\n    \\\"processingInfo\\\": {\\\"processingStatus\\\": \\\"SUCCESS\\\"},\\n    \\\"softDescriptor\\\": \\\"ABC COMPANY\\\",\\n    \\\"currency\\\": \\\"USD\\\",\\n    \\\"transactionId\\\": 38500786,\\n    \\\"paypalTransaction\\\": {\\n        \\\"paypalUrl\\\": \\\"https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_express-checkout\\\",\\n        \\\"orderId\\\": 980111,\\n        \\\"paypalSubscriptionId\\\": 1234567\\n    }\\n}\",\n      \"language\": \"json\",\n      \"name\": \"200 OK - by Transaction ID for a subscription payment\"\n    },\n    {\n      \"code\": \"{\\n    \\\"amount\\\": 100,\\n    \\\"vaultedShopperId\\\": 1234,\\n    \\\"payerInfo\\\": {\\n        \\\"firstName\\\": \\\"John\\\",\\n        \\\"lastName\\\": \\\"Doe\\\"\\n    },\\n    \\\"merchantTransactionId\\\": 12345,\\n    \\\"processingInfo\\\": {\\\"processingStatus\\\": \\\"PENDING\\\"},\\n    \\\"softDescriptor\\\": \\\"ABC COMPANY\\\",\\n    \\\"currency\\\": \\\"USD\\\",\\n    \\\"transactionMetaData\\\": {\\\"metaData\\\": [\\n        {\\n            \\\"metaValue\\\": 20,\\n            \\\"metaKey\\\": \\\"cityTaxAmount\\\",\\n            \\\"metaDescription\\\": \\\"City Tax Amount\\\"\\n        },\\n        {\\n            \\\"metaValue\\\": 10,\\n            \\\"metaKey\\\": \\\"shippingAmount\\\",\\n            \\\"metaDescription\\\": \\\"Shipping Amount\\\"\\n        },\\n        {\\n            \\\"metaValue\\\": 20,\\n            \\\"metaKey\\\": \\\"stateTaxAmount\\\",\\n            \\\"metaDescription\\\": \\\"State Tax Amount\\\"\\n        }\\n    ]},\\n    \\\"paypalTransaction\\\": {\\n        \\\"paypalUrl\\\": \\\"https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_express-checkout&token=EC-2RK67425NC888032A\\\",\\n        \\\"orderId\\\": 3979665\\n    }\\n}\",\n      \"language\": \"json\",\n      \"name\": \"200 OK - by Merchant Transaction ID & Merchant ID with metadata\"\n    },\n    {\n      \"code\": \"{\\n  \\\"transactionId\\\": \\\"38417606\\\",\\n  \\\"softDescriptor\\\": \\\"ABC COMPANY\\\",\\n  \\\"amount\\\": 50,\\n  \\\"currency\\\": \\\"USD\\\",\\n  \\\"vaultedShopperId\\\": 19490082,\\n  \\\"paypalTransaction\\\": {\\n    \\\"paypalUrl\\\": \\\"https&#x3a;&#x2f;&#x2f;www.sandbox.paypal.com&#x2f;us&#x2f;cgi-bin&#x2f;webscr&#x3f;cmd&#x3d;_express-checkout&#x26;token&#x3d;EC-7YD07100DG923212M\\\",\\n    \\\"orderId\\\": 3906757\\n  },\\n  \\\"processingInfo\\\": {\\n    \\\"processingStatus\\\": \\\"REFUNDED\\\"\\n  },\\n  \\\"refunds\\\": {\\n    \\\"refund\\\": [\\n      {\\n        \\\"amount\\\": 1,\\n        \\\"currency\\\": \\\"USD\\\",\\n        \\\"date\\\": \\\"2016-09-03\\\"\\n      },\\n      {\\n        \\\"amount\\\": 1,\\n        \\\"currency\\\": \\\"USD\\\",\\n        \\\"date\\\": \\\"2016-09-03\\\"\\n      },\\n      {\\n        \\\"amount\\\": 48.05,\\n        \\\"currency\\\": \\\"USD\\\",\\n        \\\"date\\\": \\\"2016-09-03\\\"\\n      }\\n    ]\\n  }\\n}\",\n      \"language\": \"json\",\n      \"name\": \"200 OK - with refunds\"\n    }\n  ]\n}\n[/block]\n<hr>\n\n##Example Descriptions\n\n###Retrieve based on Order ID\nThis is a retrieval based on the `orderId`, which is provided by PayPal and appears in the response from the API for that transaction.\n\n###Retrieve based on Transaction ID\nThis is a retrieval based on the `transactionId`. This ID is created after the PayPal transaction has been completed.\n\n###Retrieve based on Merchant Transaction ID and Merchant ID\nThis is a retrieval based on the `merchantTransactionId` and `merchantId`. It is applicable to merchants who pass their own Merchant Transaction IDs with each transaction.\n\n###Response for transaction with refunds\nIf one or more refunds (including partial refunds) have been applied to the transaction, the refund details appear in the [refunds](doc:refunds) element.\n\n<br>\n<a class=\"btn btn-primary\" href=\"#\" role=\"button\">Back to Top</a>\n\n<hr>\n\n##API Explorer (for request based on Order ID)\nTo 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.","excerpt":"","slug":"paypal-retrieve","type":"get","title":"Retrieve PayPal Transaction"}

getRetrieve PayPal Transaction


Definition

{{ api_url }}{{ page_api_url }}

Parameters

Path Params

orderId:
required
string
order ID received in the response

Documentation

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.

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,
    "vaultedShopperId": 1234,
    "payerInfo": {
        "firstName": "John",
        "lastName": "Doe"
    },
    "processingInfo": {"processingStatus": "SUCCESS"},
    "softDescriptor": "ABC COMPANY",
    "currency": "USD",
    "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,
    "vaultedShopperId": 1234,
    "payerInfo": {
        "firstName": "John",
        "lastName": "Doe"
    },
    "processingInfo": {"processingStatus": "SUCCESS"},
    "softDescriptor": "ABC COMPANY",
    "currency": "USD",
    "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,
    "processingInfo": {"processingStatus": "SUCCESS"},
    "softDescriptor": "ABC COMPANY",
    "currency": "USD",
    "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",
  "vaultedShopperId": 19490082,
  "paypalTransaction": {
    "paypalUrl": "https&#x3a;&#x2f;&#x2f;www.sandbox.paypal.com&#x2f;us&#x2f;cgi-bin&#x2f;webscr&#x3f;cmd&#x3d;_express-checkout&#x26;token&#x3d;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.


User Information

Try It Out


get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}