{"_id":"59a45d467ee621000fc9d40a","category":{"_id":"59a45d447ee621000fc9d3ba","version":"59a45d437ee621000fc9d3b7","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"},"user":"560d5913af97231900938124","project":"57336fd5a6a9c40e00e13a0b","parentDoc":null,"version":{"_id":"59a45d437ee621000fc9d3b7","project":"57336fd5a6a9c40e00e13a0b","__v":1,"createdAt":"2017-08-28T18:13:23.840Z","releaseDate":"2017-08-28T18:13:23.840Z","categories":["59a45d447ee621000fc9d3b8","59a45d447ee621000fc9d3b9","59a45d447ee621000fc9d3ba","59a45d447ee621000fc9d3bb","59a45d447ee621000fc9d3bc","59a45d447ee621000fc9d3bd","59a45d447ee621000fc9d3be","59a45d447ee621000fc9d3bf","59a45d447ee621000fc9d3c0","59a45d447ee621000fc9d3c1","59a45d447ee621000fc9d3c2","59a45d447ee621000fc9d3c3","59a45d447ee621000fc9d3c4","59a45d447ee621000fc9d3c5","59a45d447ee621000fc9d3c6","59a45d447ee621000fc9d3c7"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":false,"codename":"3.22.1","version_clean":"8976.0.0-XML","version":"8976-XML"},"__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":[{"language":"text","code":""}]},"settings":"","auth":"optional","params":[{"_id":"56953ff3fe18811700c9bfcc","ref":"","in":"path","required":true,"desc":"order ID received in the response","default":"","type":"string","name":"order-id"}],"url":"/alt-transactions/resolve?orderId=:order-id"},"isReference":true,"order":8,"body":"This request 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={order-id}`\n\nFor example:\n`services/2/alt-transactions/resolve?orderId=5666625`\n\n**Retrieve based on Transaction ID**\nEnter the `transaction-id` into the web service URL, in the format:\n`services/2/alt-transactions/{transaction-id}`\n\nFor example:\n`services/2/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 can then be found in the `return-url` as query parameter or under the `alt-transaction` resource.\"\n}\n[/block]\n**Retrieve based on Merchant Transaction ID and Merchant ID**\nEnter the `merchant-id` and `merchant-transaction-id` into the web service URL, in the format:\n`services/2/alt-transactions/{merchant-transaction-id},{merchant-id}`\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 `alt-transaction` resource (see [alt-transaction](doc:alt-transaction)).\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 'paypal-subscription-id' 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/xml' \\\\\\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ='\",\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/xml' \\\\\\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ='\",\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/xml' \\\\\\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ='\",\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\": \"HTTP/ 1.1 200 OK\\n\\n<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"yes\\\"?>\\n<alt-transaction xmlns=\\\"http://ws.plimus.com\\\">\\n    <transaction-id>38501970</transaction-id>\\n    <soft-descriptor>ABC COMPANY</soft-descriptor>\\n    <amount>100</amount>\\n    <currency>USD</currency>\\n    <vaulted-shopper-id>1234</vaulted-shopper-id>\\n    <payer-info>\\n        <first-name>John</first-name>\\n        <last-name>Doe</last-name>\\n    </payer-info>\\n    <paypal-transaction>\\n        <paypal-url>https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_express-checkout&token=EC-1H0778387R312591N</paypal-url>\\n        <order-id>3979639</order-id>\\n    </paypal-transaction>\\n    <processing-info>\\n        <processing-status>SUCCESS</processing-status>\\n    </processing-info>\\n</alt-transaction>\",\n      \"language\": \"xml\",\n      \"name\": \"Retrieve PayPal Transaction Reponse: 200 OK - by Order ID (Success)\"\n    },\n    {\n      \"code\": \"HTTP/ 1.1 200 OK\\n\\n<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"yes\\\"?>\\n<alt-transaction xmlns=\\\"http://ws.plimus.com\\\">\\n    <soft-descriptor>ABC COMPANY</soft-descriptor>\\n    <amount>100</amount>\\n    <currency>USD</currency>\\n    <vaulted-shopper-id>1234</vaulted-shopper-id>\\n    <payer-info>\\n        <first-name>John</first-name>\\n        <last-name>Doe</last-name>\\n    </payer-info>\\n    <paypal-transaction>\\n        <paypal-url>https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_express-checkout&token=EC-5XL55248WK026621X</paypal-url>\\n        <order-id>3979303</order-id>\\n    </paypal-transaction>\\n    <processing-info>\\n        <processing-status>PENDING</processing-status>\\n    </processing-info>\\n</alt-transaction>\",\n      \"language\": \"xml\",\n      \"name\": \"200 OK - by Order ID (Pending)\"\n    },\n    {\n      \"code\": \"HTTP/ 1.1 200 OK\\n\\n<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"yes\\\"?>\\n<alt-transaction xmlns=\\\"http://ws.plimus.com\\\">\\n    <transaction-id>38501970</transaction-id>\\n    <soft-descriptor>ABC COMPANY</soft-descriptor>\\n    <amount>100</amount>\\n    <currency>USD</currency>\\n    <vaulted-shopper-id>1234</vaulted-shopper-id>\\n    <payer-info>\\n        <first-name>John</first-name>\\n        <last-name>Doe</last-name>\\n    </payer-info>\\n    <paypal-transaction>\\n        <paypal-url>https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_express-checkout&token=EC-1H0778387R312591N</paypal-url>\\n        <order-id>3979639</order-id>\\n    </paypal-transaction>\\n    <processing-info>\\n        <processing-status>SUCCESS</processing-status>\\n    </processing-info>\\n</alt-transaction>\",\n      \"language\": \"xml\",\n      \"name\": \"200 OK - by Transaction ID\"\n    },\n    {\n      \"code\": \"HTTP/ 1.1 200 OK\\n\\n<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n<alt-transaction xmlns=\\\"http://ws.plimus.com\\\">\\n   <transaction-id>38500786</transaction-id>\\n   <soft-descriptor>ABC COMPANY</soft-descriptor>\\n   <amount>100.00</amount>\\n   <currency>USD</currency>\\n   <vaulted-shopper-id>1234</vaulted-shopper-id>\\n   <paypal-transaction>\\n      <paypal-url>https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_express-checkout</paypal-url>\\n      <paypal-subscription-id>1234567</paypal-subscription-id>\\n      <order-id>980111</order-id>\\n   </paypal-transaction>\\n   <processing-info>\\n      <processing-status>SUCCESS</processing-status>\\n   </processing-info>\\n</alt-transaction>\",\n      \"language\": \"xml\",\n      \"name\": \"200 OK - by Transaction ID for a subscription payment\"\n    },\n    {\n      \"code\": \"HTTP/ 1.1 200 OK\\n\\n<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"yes\\\"?>\\n<alt-transaction xmlns=\\\"http://ws.plimus.com\\\">\\n    <merchant-transaction-id>12345</merchant-transaction-id>\\n    <soft-descriptor>ABC COMPANY</soft-descriptor>\\n    <amount>100</amount>\\n    <currency>USD</currency>\\n    <vaulted-shopper-id>1234</vaulted-shopper-id>\\n    <payer-info>\\n        <first-name>John</first-name>\\n        <last-name>Doe</last-name>\\n    </payer-info>\\n    <paypal-transaction>\\n        <paypal-url>https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_express-checkout&token=EC-2RK67425NC888032A</paypal-url>\\n        <order-id>3979665</order-id>\\n    </paypal-transaction>\\n    <transaction-meta-data>\\n        <meta-data>\\n            <meta-key>cityTaxAmount</meta-key>\\n            <meta-value>20.00</meta-value>\\n            <meta-description>City Tax Amount</meta-description>\\n        </meta-data>\\n        <meta-data>\\n            <meta-key>shippingAmount</meta-key>\\n            <meta-value>10.00</meta-value>\\n            <meta-description>Shipping Amount</meta-description>\\n        </meta-data>\\n        <meta-data>\\n            <meta-key>stateTaxAmount</meta-key>\\n            <meta-value>20.00</meta-value>\\n            <meta-description>State Tax Amount</meta-description>\\n        </meta-data>\\n    </transaction-meta-data>\\n    <processing-info>\\n        <processing-status>PENDING</processing-status>\\n    </processing-info>\\n</alt-transaction>\",\n      \"language\": \"xml\",\n      \"name\": \"200 OK - by Merchant Transaction ID & Merchant ID with metadata\"\n    },\n    {\n      \"code\": \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"yes\\\"?>\\n<alt-transaction xmlns=\\\"http://ws.plimus.com\\\">\\n    <transaction-id>38417606</transaction-id>\\n    <soft-descriptor>ABC COMPANY</soft-descriptor>\\n    <amount>50</amount>\\n    <currency>USD</currency>\\n    <vaulted-shopper-id>19490082</vaulted-shopper-id>\\n    <paypal-transaction>\\n        <paypal-url>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</paypal-url>\\n        <order-id>3906757</order-id>\\n    </paypal-transaction>\\n    <processing-info>\\n        <processing-status>REFUNDED</processing-status>\\n    </processing-info>\\n    <refunds>\\n        <refund>\\n            <amount>1.00</amount>\\n            <currency>USD</currency>\\n            <date>2016-09-03</date>\\n        </refund>\\n        <refund>\\n            <amount>1.00</amount>\\n            <currency>USD</currency>\\n            <date>2016-09-03</date>\\n        </refund>\\n        <refund>\\n            <amount>48.05</amount>\\n            <currency>USD</currency>\\n            <date>2016-09-03</date>\\n        </refund>\\n    </refunds>\\n</alt-transaction>\",\n      \"language\": \"xml\",\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 `order-id`, 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 `transaction-id`. 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 `merchant-transaction-id` and `merchant-id`. 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 `order-id` 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

order-id:
required
string
order ID received in the response

Documentation

This request 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={order-id}

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

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

For example:
services/2/transactions/38430646

The transaction ID is created only after the PayPal transaction is complete. It is can then be found in the return-url as query parameter or under the alt-transaction resource.

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

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 alt-transaction resource (see alt-transaction).

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

If the payment was for a subscription, the 'paypal-subscription-id' 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/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ='
curl -v -X GET https://sandbox.bluesnap.com/services/2/alt-transactions/38501970 \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ='
curl -v -X GET https://sandbox.bluesnap.com/services/2/alt-transactions/12345,395608 \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ='

Response Examples

HTTP/ 1.1 200 OK

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<alt-transaction xmlns="http://ws.plimus.com">
    <transaction-id>38501970</transaction-id>
    <soft-descriptor>ABC COMPANY</soft-descriptor>
    <amount>100</amount>
    <currency>USD</currency>
    <vaulted-shopper-id>1234</vaulted-shopper-id>
    <payer-info>
        <first-name>John</first-name>
        <last-name>Doe</last-name>
    </payer-info>
    <paypal-transaction>
        <paypal-url>https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_express-checkout&token=EC-1H0778387R312591N</paypal-url>
        <order-id>3979639</order-id>
    </paypal-transaction>
    <processing-info>
        <processing-status>SUCCESS</processing-status>
    </processing-info>
</alt-transaction>
HTTP/ 1.1 200 OK

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<alt-transaction xmlns="http://ws.plimus.com">
    <soft-descriptor>ABC COMPANY</soft-descriptor>
    <amount>100</amount>
    <currency>USD</currency>
    <vaulted-shopper-id>1234</vaulted-shopper-id>
    <payer-info>
        <first-name>John</first-name>
        <last-name>Doe</last-name>
    </payer-info>
    <paypal-transaction>
        <paypal-url>https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_express-checkout&token=EC-5XL55248WK026621X</paypal-url>
        <order-id>3979303</order-id>
    </paypal-transaction>
    <processing-info>
        <processing-status>PENDING</processing-status>
    </processing-info>
</alt-transaction>
HTTP/ 1.1 200 OK

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<alt-transaction xmlns="http://ws.plimus.com">
    <transaction-id>38501970</transaction-id>
    <soft-descriptor>ABC COMPANY</soft-descriptor>
    <amount>100</amount>
    <currency>USD</currency>
    <vaulted-shopper-id>1234</vaulted-shopper-id>
    <payer-info>
        <first-name>John</first-name>
        <last-name>Doe</last-name>
    </payer-info>
    <paypal-transaction>
        <paypal-url>https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_express-checkout&token=EC-1H0778387R312591N</paypal-url>
        <order-id>3979639</order-id>
    </paypal-transaction>
    <processing-info>
        <processing-status>SUCCESS</processing-status>
    </processing-info>
</alt-transaction>
HTTP/ 1.1 200 OK

<?xml version="1.0" encoding="UTF-8"?>
<alt-transaction xmlns="http://ws.plimus.com">
   <transaction-id>38500786</transaction-id>
   <soft-descriptor>ABC COMPANY</soft-descriptor>
   <amount>100.00</amount>
   <currency>USD</currency>
   <vaulted-shopper-id>1234</vaulted-shopper-id>
   <paypal-transaction>
      <paypal-url>https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_express-checkout</paypal-url>
      <paypal-subscription-id>1234567</paypal-subscription-id>
      <order-id>980111</order-id>
   </paypal-transaction>
   <processing-info>
      <processing-status>SUCCESS</processing-status>
   </processing-info>
</alt-transaction>
HTTP/ 1.1 200 OK

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<alt-transaction xmlns="http://ws.plimus.com">
    <merchant-transaction-id>12345</merchant-transaction-id>
    <soft-descriptor>ABC COMPANY</soft-descriptor>
    <amount>100</amount>
    <currency>USD</currency>
    <vaulted-shopper-id>1234</vaulted-shopper-id>
    <payer-info>
        <first-name>John</first-name>
        <last-name>Doe</last-name>
    </payer-info>
    <paypal-transaction>
        <paypal-url>https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_express-checkout&token=EC-2RK67425NC888032A</paypal-url>
        <order-id>3979665</order-id>
    </paypal-transaction>
    <transaction-meta-data>
        <meta-data>
            <meta-key>cityTaxAmount</meta-key>
            <meta-value>20.00</meta-value>
            <meta-description>City Tax Amount</meta-description>
        </meta-data>
        <meta-data>
            <meta-key>shippingAmount</meta-key>
            <meta-value>10.00</meta-value>
            <meta-description>Shipping Amount</meta-description>
        </meta-data>
        <meta-data>
            <meta-key>stateTaxAmount</meta-key>
            <meta-value>20.00</meta-value>
            <meta-description>State Tax Amount</meta-description>
        </meta-data>
    </transaction-meta-data>
    <processing-info>
        <processing-status>PENDING</processing-status>
    </processing-info>
</alt-transaction>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<alt-transaction xmlns="http://ws.plimus.com">
    <transaction-id>38417606</transaction-id>
    <soft-descriptor>ABC COMPANY</soft-descriptor>
    <amount>50</amount>
    <currency>USD</currency>
    <vaulted-shopper-id>19490082</vaulted-shopper-id>
    <paypal-transaction>
        <paypal-url>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</paypal-url>
        <order-id>3906757</order-id>
    </paypal-transaction>
    <processing-info>
        <processing-status>REFUNDED</processing-status>
    </processing-info>
    <refunds>
        <refund>
            <amount>1.00</amount>
            <currency>USD</currency>
            <date>2016-09-03</date>
        </refund>
        <refund>
            <amount>1.00</amount>
            <currency>USD</currency>
            <date>2016-09-03</date>
        </refund>
        <refund>
            <amount>48.05</amount>
            <currency>USD</currency>
            <date>2016-09-03</date>
        </refund>
    </refunds>
</alt-transaction>


Example Descriptions

Retrieve based on Order ID

This is a retrieval based on the order-id, 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 transaction-id. 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 merchant-transaction-id and merchant-id. 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 order-id 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 }}