{"_id":"59a45d467ee621000fc9d408","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"},"parentDoc":null,"project":"57336fd5a6a9c40e00e13a0b","user":"560d5913af97231900938124","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-13T18:37:56.731Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[]},"method":"post","results":{"codes":[{"language":"text","code":""}]},"settings":"","auth":"optional","params":[],"url":"/alt-transactions"},"isReference":true,"order":6,"body":"The Create PayPal Transaction request performs a transaction (purchase) using the PayPal payment method.\n\n[block:callout]\n{\n  \"type\": \"success\",\n  \"title\": \"Getting started with PayPal in BlueSnap\",\n  \"body\": \"Go to the [PayPal Guide](doc:paypal) for a walkthrough of implementing the PayPal payment method via the API. To use PayPal, you will need to first connect your PayPal and BlueSnap account, as described in the guide.\"\n}\n[/block]\n<a class=\"btn btn-success\" href=\"#section-api-explorer\" role=\"button\">Try it in the API Explorer</a>\n\n###Request Content\n`alt-transaction` *container* &nbsp;&nbsp;&nbsp;<span style=\"color:#F37500\">**required**</span>, contains the following properties (see [alt-transaction](doc:alt-transaction)):\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`merchant-transaction-id` *string* &nbsp;&nbsp;&nbsp;optional\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`soft-descriptor` *string* &nbsp;&nbsp;&nbsp;optional\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`amount` *decimal* &nbsp;&nbsp;&nbsp;<span style=\"color:#F37500\">**required**</span>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`currency` *string* &nbsp;&nbsp;&nbsp;<span style=\"color:#F37500\">**required**</span>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`payer-info` *container* &nbsp;&nbsp;&nbsp;optional (see [payer-info](doc:payer-info))\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`vaulted-shopper-id` *integer* &nbsp;&nbsp;&nbsp;optional\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`paypal-transaction` *container* &nbsp;&nbsp;&nbsp;<span style=\"color:#F37500\">**required**</span> (see [paypal-transaction](doc:paypal-transaction))\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`transaction-description` *string* &nbsp;&nbsp;&nbsp;optional\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`transaction-meta-data` *container* &nbsp;&nbsp;&nbsp;optional (see [transaction-meta-data](doc:transaction-meta-data))\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`transaction-fraud-info` *container* &nbsp;&nbsp;&nbsp;optional (see [transaction-fraud-info](doc:transaction-fraud-info))\n\n###Response Details\nIf successful, the response HTTP status code is 200 OK.\nThe response contains an `alt-transaction` resource (see [alt-transaction](doc:alt-transaction)) with the request properties plus these additions:\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`vaulted-shopper-id`\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`paypal-transaction` is returned with the `paypal-url` and `order-id` (see [paypal-transaction](doc:paypal-transaction))\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`processing-info`\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`fraud-result-info`\n\n<hr>\n\n##Examples\n\n###Request Examples\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -v -X POST https://sandbox.bluesnap.com/services/2/alt-transactions/ \\\\\\n-H 'Content-Type: application/xml' \\\\\\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n<alt-transaction xmlns=\\\"http://ws.plimus.com\\\">\\n   <soft-descriptor>ABC COMPANY</soft-descriptor>\\n   <amount>100.00</amount>\\n   <currency>USD</currency>\\n   <paypal-transaction>\\n      <return-url>http://www.returnURL.com</return-url>\\n      <cancel-url>http://www.cancelURL.com</cancel-url>\\n   </paypal-transaction>\\n   <transaction-fraud-info>\\n      <fraud-session-id>1234</fraud-session-id>\\n   </transaction-fraud-info>\\n</alt-transaction>'\",\n      \"language\": \"curl\",\n      \"name\": \"Create PayPal Transaction Request: basic with fraud info\"\n    },\n    {\n      \"code\": \"curl -v -X POST https://sandbox.bluesnap.com/services/2/alt-transactions/ \\\\\\n-H 'Content-Type: application/xml' \\\\\\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n<alt-transaction xmlns=\\\"http://ws.plimus.com\\\">\\n   <soft-descriptor>ABC COMPANY</soft-descriptor>\\n   <amount>100.00</amount>\\n   <currency>USD</currency>\\n   <payer-info>\\n      <first-name>John</first-name>\\n      <last-name>Doe</last-name>\\n   </payer-info>\\n   <paypal-transaction>\\n      <return-url>http://www.returnURL.com</return-url>\\n      <cancel-url>http://www.cancelURL.com</cancel-url>\\n   </paypal-transaction>\\n</alt-transaction>'\",\n      \"language\": \"curl\",\n      \"name\": \"with payer info\"\n    },\n    {\n      \"code\": \"curl -v -X POST https://sandbox.bluesnap.com/services/2/alt-transactions/ \\\\\\n-H 'Content-Type: application/xml' \\\\\\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n<alt-transaction xmlns=\\\"http://ws.plimus.com\\\">\\n   <soft-descriptor>ABC COMPANY</soft-descriptor>\\n   <amount>100.00</amount>\\n   <currency>USD</currency>\\n   <vaulted-shopper-id>20781033</vaulted-shopper-id>\\n   <paypal-transaction>\\n      <return-url>http://www.returnURL.com</return-url>\\n      <cancel-url>http://www.cancelURL.com</cancel-url>\\n   </paypal-transaction>\\n</alt-transaction>'\",\n      \"language\": \"curl\",\n      \"name\": \"with vaulted shopper\"\n    },\n    {\n      \"code\": \"curl -v -X POST https://sandbox.bluesnap.com/services/2/alt-transactions/ \\\\\\n-H 'Content-Type: application/xml' \\\\\\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n<alt-transaction xmlns=\\\"http://ws.plimus.com\\\">\\n   <merchant-transaction-id>3</merchant-transaction-id>\\n   <soft-descriptor>ABC COMPANY</soft-descriptor>\\n   <amount>100.00</amount>\\n   <currency>USD</currency>\\n   <payer-info>\\n      <first-name>John</first-name>\\n      <last-name>Doe</last-name>\\n   </payer-info>\\n   <paypal-transaction>\\n      <return-url>http://www.returnURL.com</return-url>\\n      <cancel-url>http://www.cancelURL.com</cancel-url>\\n   </paypal-transaction>\\n   <transaction-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      <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   </transaction-meta-data>\\n</alt-transaction>'\",\n      \"language\": \"curl\",\n      \"name\": \"with Merchant Transaction ID and metadata\"\n    },\n    {\n      \"code\": \"curl -v -X POST https://sandbox.bluesnap.com/services/2/alt-transactions/ \\\\\\n-H 'Content-Type: application/xml' \\\\\\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n<alt-transaction xmlns=\\\"http://ws.plimus.com\\\">\\n   <soft-descriptor>ABC COMPANY</soft-descriptor>\\n   <amount>100.00</amount>\\n   <currency>USD</currency>\\n   <payer-info>\\n      <first-name>John</first-name>\\n      <last-name>Doe</last-name>\\n   </payer-info>\\n   <paypal-transaction>\\n      <return-url>http://www.returnURL.com</return-url>\\n      <cancel-url>http://www.cancelURL.com</cancel-url>\\n   </paypal-transaction>\\n   <transaction-description>Product description</transaction-description>\\n</alt-transaction>'\",\n      \"language\": \"curl\",\n      \"name\": \"with transaction description\"\n    },\n    {\n      \"code\": \"curl -v -X POST https://sandbox.bluesnap.com/services/2/alt-transactions/ \\\\\\n-H 'Content-Type: application/xml' \\\\\\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n<alt-transaction xmlns=\\\"http://ws.plimus.com\\\">\\n   <soft-descriptor>ABC COMPANY</soft-descriptor>\\n   <amount>100.00</amount>\\n   <currency>USD</currency>\\n   <paypal-transaction>\\n      <return-url>http://www.returnURL.com</return-url>\\n      <cancel-url>http://www.cancelURL.com</cancel-url>\\n      <in-context>true</in-context>\\n   </paypal-transaction>\\n</alt-transaction>'\",\n      \"language\": \"curl\",\n      \"name\": \"with in-context checkout\"\n    },\n    {\n      \"code\": \"curl -v -X POST https://sandbox.bluesnap.com/services/2/alt-transactions/ \\\\\\n-H 'Content-Type: application/xml' \\\\\\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n<alt-transaction xmlns=\\\"http://ws.plimus.com\\\">\\n   <merchant-transaction-id>A3bn43</merchant-transaction-id>\\n   <soft-descriptor>ABC COMPANY</soft-descriptor>\\n   <amount>100.00</amount>\\n   <currency>USD</currency>\\n   <paypal-transaction>\\n      <return-url>http://www.returnURL.com</return-url>\\n      <cancel-url>http://www.cancelURL.com</cancel-url>\\n      <recurring>1</recurring>\\n   </paypal-transaction>\\n</alt-transaction>'\",\n      \"language\": \"curl\",\n      \"name\": \"initial subscription payment\"\n    },\n    {\n      \"code\": \"curl -v -X POST https://sandbox.bluesnap.com/services/2/alt-transactions/ \\\\\\n-H 'Content-Type: application/xml' \\\\\\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n<alt-transaction xmlns=\\\"http://ws.plimus.com\\\">\\n   <amount>100.00</amount>\\n   <currency>USD</currency>\\n   <paypal-transaction>\\n      <paypal-subscription-id>1234567</paypal-subscription-id>\\n   </paypal-transaction>\\n</alt-transaction>'\",\n      \"language\": \"curl\",\n      \"name\": \"recurring subscription payment\"\n    },\n    {\n      \"code\": \"curl -v -X POST https://sandbox.bluesnap.com/services/2/alt-transactions/ \\\\\\n-H 'Content-Type: application/xml' \\\\\\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n<alt-transaction xmlns=\\\"http://ws.plimus.com\\\">\\n   <merchant-transaction-id>testtransaction1</merchant-transaction-id>\\n   <soft-descriptor>ABC COMPANY</soft-descriptor>\\n   <amount>100.00</amount>\\n   <currency>USD</currency>\\n   <payer-info>\\n      <first-name>John</first-name>\\n      <last-name>Doe</last-name>\\n   </payer-info>\\n   <paypal-transaction>\\n      <transaction-type>AUTH_ONLY</transaction-type>\\n      <return-url>http://www.returnURL.com</return-url>\\n      <cancel-url>http://www.cancelURL.com</cancel-url>\\n      <max-amount>120.00</max-amount>\\n   </paypal-transaction>\\n</alt-transaction>\",\n      \"language\": \"curl\",\n      \"name\": \"Create PayPal Transaction for Two-step flow\"\n    },\n    {\n      \"code\": \"curl -v -X POST https://sandbox.bluesnap.com/services/2/alt-transactions/ \\\\\\n-H 'Content-Type: application/xml' \\\\\\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n<alt-transaction xmlns=\\\"http://ws.plimus.com\\\">\\n   <merchant-transaction-id>testtransaction1</merchant-transaction-id>\\n   <soft-descriptor>ABC COMPANY</soft-descriptor>\\n   <amount>100.00</amount>\\n   <currency>USD</currency>\\n   <payer-info>\\n      <first-name>John</first-name>\\n      <last-name>Doe</last-name>\\n   </payer-info>\\n   <paypal-transaction>\\n      <transaction-type>SET_ORDER</transaction-type>\\n      <return-url>http://www.returnURL.com</return-url>\\n      <cancel-url>http://www.cancelURL.com</cancel-url>\\n      <max-amount>120.00</max-amount>\\n   </paypal-transaction>\\n</alt-transaction>\",\n      \"language\": \"curl\",\n      \"name\": \"Create PayPal Transaction for Three-step flow (Delayed Capture)\"\n    }\n  ]\n}\n[/block]\n###Response Examples\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<?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.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&token=EC-3SH38585JS3540821</paypal-url>\\n        <order-id>3979635</order-id>\\n    </paypal-transaction>\\n    <processing-info>\\n        <processing-status>PENDING</processing-status>\\n    </processing-info>\\n    <fraud-result-info>\\n        <device-data-collector>Y</device-data-collector>\\n    </fraud-result-info>\\n</alt-transaction>\",\n      \"language\": \"xml\",\n      \"name\": \"Create PayPal Transaction Response: 200 OK - basic with fraud info\"\n    },\n    {\n      \"code\": \"<?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.00</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-0SM33181BF217002W</paypal-url>\\n        <order-id>3979589</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 - payer info\"\n    },\n    {\n      \"code\": \"<?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.00</amount>\\n    <currency>USD</currency>\\n    <vaulted-shopper-id>20781033</vaulted-shopper-id>\\n    <paypal-transaction>\\n        <paypal-url>https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_express-checkout&token=EC-9GY47037JY601890L</paypal-url>\\n        <order-id>3979591</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 - vaulted shopper\"\n    },\n    {\n      \"code\": \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"yes\\\"?>\\n<alt-transaction xmlns=\\\"http://ws.plimus.com\\\">\\n    <merchant-transaction-id>3</merchant-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    <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-7GY45732D90677524</paypal-url>\\n        <order-id>3979657</order-id>\\n    </paypal-transaction>\\n    <transaction-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        <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    </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 - Merchant Transaction ID and metadata\"\n    },\n    {\n      \"code\": \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n<alt-transaction xmlns=\\\"http://ws.plimus.com\\\">\\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   <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-0SM33181BF217002W</paypal-url>\\n      <order-id>3979589</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 - transaction description\"\n    },\n    {\n      \"code\": \"<?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.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/checkoutnow?token=EC-4UU43831F40425709</paypal-url>\\n        <order-id>3979635</order-id>\\n        <in-context>true</in-context>\\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 - in-context checkout\"\n    },\n    {\n      \"code\": \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n<alt-transaction xmlns=\\\"http://ws.plimus.com\\\">\\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      <order-id>980111</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 - initial subscription payment\"\n    },\n    {\n      \"code\": \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n<alt-transaction xmlns=\\\"http://ws.plimus.com\\\">\\n   <transaction-id>38500786</transaction-id>\\n   <amount>100.00</amount>\\n   <currency>USD</currency>\\n   <vaulted-shopper-id>1234</vaulted-shopper-id>\\n   <paypal-transaction>\\n      <paypal-subscription-id>1234567</paypal-subscription-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 - recurring subscription payment\"\n    },\n    {\n      \"code\": \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n<alt-transaction xmlns=\\\"http://ws.plimus.com\\\">\\n  <merchant-transaction-id>A3bn43</merchant-transaction-id>\\n  <soft-descriptor>ABC COMPANY</soft-descriptor>\\n  <amount>100.00</amount>\\n  <currency>USD</currency>\\n  <payer-info>\\n    <first-name>John</first-name>\\n    <last-name>Doe</last-name>\\n  </payer-info>\\n  <vaulted-shopper-id>19587618</vaulted-shopper-id>\\n  <paypal-transaction>\\n    <paypal-url>https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_express-checkout&amp;token=EC-2FK36938XP960042T</paypal-url>\\n    <order-id>4006145</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 - two step flow\"\n    },\n    {\n      \"code\": \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n<alt-transaction xmlns=\\\"http://ws.plimus.com\\\">\\n  <merchant-transaction-id>A3bn43</merchant-transaction-id>\\n  <soft-descriptor>ABC COMPANY</soft-descriptor>\\n  <amount>100.00</amount>\\n  <currency>USD</currency>\\n  <payer-info>\\n    <first-name>John</first-name>\\n    <last-name>Doe</last-name>\\n  </payer-info>\\n  <vaulted-shopper-id>19587618</vaulted-shopper-id>\\n  <paypal-transaction>\\n    <paypal-url>https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_express-checkout&amp;token=EC-2FK36938XP960042T</paypal-url>\\n    <order-id>4006145</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 - three step flow\"\n    }\n  ]\n}\n[/block]\n<a class=\"btn btn-primary\" href=\"#\" role=\"button\">Back to Top</a>\n\n<hr>\n\n##Example Descriptions\nFor details about the above examples, see:\n  * [Basic Create PayPal Transaction](create-paypal-transaction#section-basic-create-paypal-transaction)\n  * [Create PayPal Transaction with payer info](/v2.0/docs/create-paypal-transaction#section-create-paypal-transaction-with-payer-info)\n  * [Create PayPal Transaction with vaulted shopper](/v2.0/docs/create-paypal-transaction#section-create-paypal-transaction-with-vaulted-shopper)\n  * [Create PayPal Transaction with Merchant Transaction ID and metadata](/v2.0/docs/create-paypal-transaction#section-create-paypal-transaction-with-merchant-transaction-id-and-metadata)\n  * [Create PayPal Transaction with transaction description](create-paypal-transaction#section-create-paypal-transaction-with-transaction-description)\n  * [Create PayPal Transaction with In-Context checkout](/v2.0/docs/create-paypal-transaction#section-create-paypal-transaction-with-in-context-checkout)\n  * [Create PayPal Transaction for initial subscription payment](/v2.0/docs/create-paypal-transaction#section-create-paypal-transaction-for-initial-subscription-payment)\n  * [Create PayPal Transaction for recurring subscription payment](/v2.0/docs/create-paypal-transaction#section-create-paypal-transaction-for-recurring-subscription-payment)\n\n\n###Basic Create PayPal Transaction\nThis example shows a basic Create PayPal Transaction request, containing the minimum required fields to process a single PayPal transaction. The request does not include any information about the shopper, so this may be a new shopper or a guest checkout. It does include the required fraud check info in the [transaction-fraud-info](doc:transaction-fraud-info) resource.\n\n###Create PayPal Transaction with payer info\nTo perform a Create PayPal Transaction and send information about the shopper, you'll need to include the `payer-info` property within the [alt-transaction](doc:alt-transaction) resource in your request. In this property, you can send information such as the shopper's first and last name, email, phone number, and address. See [payer-info](doc:payer-info).\n\nAbove is an example of a Create PayPal Transaction request with the shopper's first and last name sent in the `payer-info` property.\n\n###Create PayPal Transaction with vaulted shopper\nTo perform a Create PayPal Transaction with an existing vaulted shopper, you'll need to include the `vaulted-shopper-id` property within the [alt-transaction](doc:alt-transaction) resource in your request.\n\n**Important**: If you set the 'no-shipping' property (in the [paypal-transaction](doc:paypal-transaction) resource) to **0** or **2**, then the shopper's shipping address will be retrieved from PayPal, and the vaulted shopper will be automatically updated with that shipping address.\n\nAbove is an example of a Create PayPal Transaction request with an existing vaulted shopper with the ID 20781033.\n\n###Create PayPal Transaction with Merchant Transaction ID and metadata\nYou may wish to assign your own ID to each transaction, for example in order to track the transactions in your own internal systems. To do this, you will need to include the `merchant-transaction-id` property within the [alt-transaction](doc:alt-transaction) resource in your request.\n\nYou can also send metadata for the transaction, such as a description of the item, or tax or shipping information. To do this, you will need to include the `transaction-meta-data` property (a container for `meta-data` key-value pairs) within the [alt-transaction](doc:alt-transaction) resource in your request.\n\nAbove is an example of a request that includes a Merchant Transaction ID (MTI), as well as metadata for the transaction, including state tax, city tax, and the shipping amount.\n\n###Create PayPal Transaction with transaction description\nBy default, the PayPal page will show the statement descriptor as the description of the product being purchased. If you prefer to show a different description, you can send it in the `transaction-description` element.\n\nAbove is an example of a Create PayPal Transaction request with the `transaction-description`.\n\n###Create PayPal Transaction with In-Context checkout\nIf you would like to enable [In-Context PayPal checkout](/v1.0/docs/paypal#section-in-context-checkout), set the `in-context` property in the [paypal-transaction](doc:paypal-transaction) resource to **true**.\n\nAbove is an example of a request with In-Context checkout enabled.\n\n###Create PayPal Transaction for initial subscription payment\nIf you are managing subscriptions yourself (or through a third party), you can use the PayPal payment method for subscription payments. In the initial subscription payment, include the `recurring` property in the [paypal-transaction](doc:paypal-transaction) resource, and set the value to **1**.\n\nAbove is an example of an initial subscription payment with PayPal.\n\nFor 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###Create PayPal Transaction for recurring subscription payment\nAfter you have processed an initial subscription payment using PayPal, you can then associate the recurring payments with the relevant subscription by including the `paypal-subscription-id` in the [paypal-transaction](doc:paypal-transaction) resource.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"How to get the subscription ID\",\n  \"body\": \"You can obtain the subscription ID in two ways:\\n* In the `subscriptionId` field in the Charge IPN that is sent once the initial payment is processed.\\n*or*\\n* By sending a [Retrieve PayPal Transaction](doc:paypal-retrieve) request once the payment has been processed.\"\n}\n[/block]\nAbove is an example of a recurring subscription payment with PayPal.\n\nFor 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<br>\n<a class=\"btn btn-primary\" href=\"#\" role=\"button\">Back to Top</a>\n\n<hr>\n\n##API Explorer\nTo test out a call, enter the XML portion of the request below and then click **Try it!**\n\n**Tip**: Copy the XML portion from one of the example requests above, or use the XML code below as a starting point. You can enter different parameters and values to see how your test scenario would work. *The request headers, including authorization, are already built in for you in this test area, so you should not include them here.*\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<alt-transaction xmlns=\\\"http://ws.plimus.com\\\">\\n   <soft-descriptor>ABC COMPANY</soft-descriptor>\\n   <amount>100.00</amount>\\n   <currency>USD</currency>\\n   <paypal-transaction>\\n      <return-url>http://www.returnURL.com</return-url>\\n      <cancel-url>http://www.cancelURL.com</cancel-url>\\n   </paypal-transaction>\\n</alt-transaction>\",\n      \"language\": \"xml\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"create-paypal-transaction","type":"post","title":"Create PayPal Transaction"}

postCreate PayPal Transaction


Definition

{{ api_url }}{{ page_api_url }}

Documentation

The Create PayPal Transaction request performs a transaction (purchase) using the PayPal payment method.

Getting started with PayPal in BlueSnap

Go to the PayPal Guide for a walkthrough of implementing the PayPal payment method via the API. To use PayPal, you will need to first connect your PayPal and BlueSnap account, as described in the guide.

Try it in the API Explorer

Request Content

alt-transaction container    required, contains the following properties (see alt-transaction):
      merchant-transaction-id string    optional
      soft-descriptor string    optional
      amount decimal    required
      currency string    required
      payer-info container    optional (see payer-info)
      vaulted-shopper-id integer    optional
      paypal-transaction container    required (see paypal-transaction)
      transaction-description string    optional
      transaction-meta-data container    optional (see transaction-meta-data)
      transaction-fraud-info container    optional (see transaction-fraud-info)

Response Details

If successful, the response HTTP status code is 200 OK.
The response contains an alt-transaction resource (see alt-transaction) with the request properties plus these additions:
      vaulted-shopper-id
      paypal-transaction is returned with the paypal-url and order-id (see paypal-transaction)
      processing-info
      fraud-result-info


Examples

Request Examples

curl -v -X POST https://sandbox.bluesnap.com/services/2/alt-transactions/ \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<?xml version="1.0" encoding="UTF-8"?>
<alt-transaction xmlns="http://ws.plimus.com">
   <soft-descriptor>ABC COMPANY</soft-descriptor>
   <amount>100.00</amount>
   <currency>USD</currency>
   <paypal-transaction>
      <return-url>http://www.returnURL.com</return-url>
      <cancel-url>http://www.cancelURL.com</cancel-url>
   </paypal-transaction>
   <transaction-fraud-info>
      <fraud-session-id>1234</fraud-session-id>
   </transaction-fraud-info>
</alt-transaction>'
curl -v -X POST https://sandbox.bluesnap.com/services/2/alt-transactions/ \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<?xml version="1.0" encoding="UTF-8"?>
<alt-transaction xmlns="http://ws.plimus.com">
   <soft-descriptor>ABC COMPANY</soft-descriptor>
   <amount>100.00</amount>
   <currency>USD</currency>
   <payer-info>
      <first-name>John</first-name>
      <last-name>Doe</last-name>
   </payer-info>
   <paypal-transaction>
      <return-url>http://www.returnURL.com</return-url>
      <cancel-url>http://www.cancelURL.com</cancel-url>
   </paypal-transaction>
</alt-transaction>'
curl -v -X POST https://sandbox.bluesnap.com/services/2/alt-transactions/ \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<?xml version="1.0" encoding="UTF-8"?>
<alt-transaction xmlns="http://ws.plimus.com">
   <soft-descriptor>ABC COMPANY</soft-descriptor>
   <amount>100.00</amount>
   <currency>USD</currency>
   <vaulted-shopper-id>20781033</vaulted-shopper-id>
   <paypal-transaction>
      <return-url>http://www.returnURL.com</return-url>
      <cancel-url>http://www.cancelURL.com</cancel-url>
   </paypal-transaction>
</alt-transaction>'
curl -v -X POST https://sandbox.bluesnap.com/services/2/alt-transactions/ \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<?xml version="1.0" encoding="UTF-8"?>
<alt-transaction xmlns="http://ws.plimus.com">
   <merchant-transaction-id>3</merchant-transaction-id>
   <soft-descriptor>ABC COMPANY</soft-descriptor>
   <amount>100.00</amount>
   <currency>USD</currency>
   <payer-info>
      <first-name>John</first-name>
      <last-name>Doe</last-name>
   </payer-info>
   <paypal-transaction>
      <return-url>http://www.returnURL.com</return-url>
      <cancel-url>http://www.cancelURL.com</cancel-url>
   </paypal-transaction>
   <transaction-meta-data>
      <meta-data>
         <meta-key>stateTaxAmount</meta-key>
         <meta-value>20.00</meta-value>
         <meta-description>State Tax Amount</meta-description>
      </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>
   </transaction-meta-data>
</alt-transaction>'
curl -v -X POST https://sandbox.bluesnap.com/services/2/alt-transactions/ \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<?xml version="1.0" encoding="UTF-8"?>
<alt-transaction xmlns="http://ws.plimus.com">
   <soft-descriptor>ABC COMPANY</soft-descriptor>
   <amount>100.00</amount>
   <currency>USD</currency>
   <payer-info>
      <first-name>John</first-name>
      <last-name>Doe</last-name>
   </payer-info>
   <paypal-transaction>
      <return-url>http://www.returnURL.com</return-url>
      <cancel-url>http://www.cancelURL.com</cancel-url>
   </paypal-transaction>
   <transaction-description>Product description</transaction-description>
</alt-transaction>'
curl -v -X POST https://sandbox.bluesnap.com/services/2/alt-transactions/ \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<?xml version="1.0" encoding="UTF-8"?>
<alt-transaction xmlns="http://ws.plimus.com">
   <soft-descriptor>ABC COMPANY</soft-descriptor>
   <amount>100.00</amount>
   <currency>USD</currency>
   <paypal-transaction>
      <return-url>http://www.returnURL.com</return-url>
      <cancel-url>http://www.cancelURL.com</cancel-url>
      <in-context>true</in-context>
   </paypal-transaction>
</alt-transaction>'
curl -v -X POST https://sandbox.bluesnap.com/services/2/alt-transactions/ \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<?xml version="1.0" encoding="UTF-8"?>
<alt-transaction xmlns="http://ws.plimus.com">
   <merchant-transaction-id>A3bn43</merchant-transaction-id>
   <soft-descriptor>ABC COMPANY</soft-descriptor>
   <amount>100.00</amount>
   <currency>USD</currency>
   <paypal-transaction>
      <return-url>http://www.returnURL.com</return-url>
      <cancel-url>http://www.cancelURL.com</cancel-url>
      <recurring>1</recurring>
   </paypal-transaction>
</alt-transaction>'
curl -v -X POST https://sandbox.bluesnap.com/services/2/alt-transactions/ \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<?xml version="1.0" encoding="UTF-8"?>
<alt-transaction xmlns="http://ws.plimus.com">
   <amount>100.00</amount>
   <currency>USD</currency>
   <paypal-transaction>
      <paypal-subscription-id>1234567</paypal-subscription-id>
   </paypal-transaction>
</alt-transaction>'
curl -v -X POST https://sandbox.bluesnap.com/services/2/alt-transactions/ \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<alt-transaction xmlns="http://ws.plimus.com">
   <merchant-transaction-id>testtransaction1</merchant-transaction-id>
   <soft-descriptor>ABC COMPANY</soft-descriptor>
   <amount>100.00</amount>
   <currency>USD</currency>
   <payer-info>
      <first-name>John</first-name>
      <last-name>Doe</last-name>
   </payer-info>
   <paypal-transaction>
      <transaction-type>AUTH_ONLY</transaction-type>
      <return-url>http://www.returnURL.com</return-url>
      <cancel-url>http://www.cancelURL.com</cancel-url>
      <max-amount>120.00</max-amount>
   </paypal-transaction>
</alt-transaction>
curl -v -X POST https://sandbox.bluesnap.com/services/2/alt-transactions/ \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<alt-transaction xmlns="http://ws.plimus.com">
   <merchant-transaction-id>testtransaction1</merchant-transaction-id>
   <soft-descriptor>ABC COMPANY</soft-descriptor>
   <amount>100.00</amount>
   <currency>USD</currency>
   <payer-info>
      <first-name>John</first-name>
      <last-name>Doe</last-name>
   </payer-info>
   <paypal-transaction>
      <transaction-type>SET_ORDER</transaction-type>
      <return-url>http://www.returnURL.com</return-url>
      <cancel-url>http://www.cancelURL.com</cancel-url>
      <max-amount>120.00</max-amount>
   </paypal-transaction>
</alt-transaction>

Response Examples

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<alt-transaction xmlns="http://ws.plimus.com">
    <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&token=EC-3SH38585JS3540821</paypal-url>
        <order-id>3979635</order-id>
    </paypal-transaction>
    <processing-info>
        <processing-status>PENDING</processing-status>
    </processing-info>
    <fraud-result-info>
        <device-data-collector>Y</device-data-collector>
    </fraud-result-info>
</alt-transaction>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<alt-transaction xmlns="http://ws.plimus.com">
    <soft-descriptor>ABC COMPANY</soft-descriptor>
    <amount>100.00</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-0SM33181BF217002W</paypal-url>
        <order-id>3979589</order-id>
    </paypal-transaction>
    <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">
    <soft-descriptor>ABC COMPANY</soft-descriptor>
    <amount>100.00</amount>
    <currency>USD</currency>
    <vaulted-shopper-id>20781033</vaulted-shopper-id>
    <paypal-transaction>
        <paypal-url>https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_express-checkout&token=EC-9GY47037JY601890L</paypal-url>
        <order-id>3979591</order-id>
    </paypal-transaction>
    <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">
    <merchant-transaction-id>3</merchant-transaction-id>
    <soft-descriptor>ABC COMPANY</soft-descriptor>
    <amount>100.00</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-7GY45732D90677524</paypal-url>
        <order-id>3979657</order-id>
    </paypal-transaction>
    <transaction-meta-data>
        <meta-data>
            <meta-key>stateTaxAmount</meta-key>
            <meta-value>20.00</meta-value>
            <meta-description>State Tax Amount</meta-description>
        </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>
    </transaction-meta-data>
    <processing-info>
        <processing-status>PENDING</processing-status>
    </processing-info>
</alt-transaction>
<?xml version="1.0" encoding="UTF-8"?>
<alt-transaction xmlns="http://ws.plimus.com">
   <soft-descriptor>ABC COMPANY</soft-descriptor>
   <amount>100.00</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-0SM33181BF217002W</paypal-url>
      <order-id>3979589</order-id>
   </paypal-transaction>
   <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">
    <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/checkoutnow?token=EC-4UU43831F40425709</paypal-url>
        <order-id>3979635</order-id>
        <in-context>true</in-context>
    </paypal-transaction>
    <processing-info>
        <processing-status>PENDING</processing-status>
    </processing-info>
</alt-transaction>
<?xml version="1.0" encoding="UTF-8"?>
<alt-transaction xmlns="http://ws.plimus.com">
   <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>
      <order-id>980111</order-id>
   </paypal-transaction>
   <processing-info>
      <processing-status>PENDING</processing-status>
  </processing-info>
</alt-transaction>
<?xml version="1.0" encoding="UTF-8"?>
<alt-transaction xmlns="http://ws.plimus.com">
   <transaction-id>38500786</transaction-id>
   <amount>100.00</amount>
   <currency>USD</currency>
   <vaulted-shopper-id>1234</vaulted-shopper-id>
   <paypal-transaction>
      <paypal-subscription-id>1234567</paypal-subscription-id>
   </paypal-transaction>
   <processing-info>
      <processing-status>SUCCESS</processing-status>
   </processing-info>
</alt-transaction>
<?xml version="1.0" encoding="UTF-8"?>
<alt-transaction xmlns="http://ws.plimus.com">
  <merchant-transaction-id>A3bn43</merchant-transaction-id>
  <soft-descriptor>ABC COMPANY</soft-descriptor>
  <amount>100.00</amount>
  <currency>USD</currency>
  <payer-info>
    <first-name>John</first-name>
    <last-name>Doe</last-name>
  </payer-info>
  <vaulted-shopper-id>19587618</vaulted-shopper-id>
  <paypal-transaction>
    <paypal-url>https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_express-checkout&amp;token=EC-2FK36938XP960042T</paypal-url>
    <order-id>4006145</order-id>
  </paypal-transaction>
  <processing-info>
    <processing-status>PENDING</processing-status>
  </processing-info>
</alt-transaction>
<?xml version="1.0" encoding="UTF-8"?>
<alt-transaction xmlns="http://ws.plimus.com">
  <merchant-transaction-id>A3bn43</merchant-transaction-id>
  <soft-descriptor>ABC COMPANY</soft-descriptor>
  <amount>100.00</amount>
  <currency>USD</currency>
  <payer-info>
    <first-name>John</first-name>
    <last-name>Doe</last-name>
  </payer-info>
  <vaulted-shopper-id>19587618</vaulted-shopper-id>
  <paypal-transaction>
    <paypal-url>https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_express-checkout&amp;token=EC-2FK36938XP960042T</paypal-url>
    <order-id>4006145</order-id>
  </paypal-transaction>
  <processing-info>
    <processing-status>PENDING</processing-status>
  </processing-info>
</alt-transaction>

Back to Top


Example Descriptions

For details about the above examples, see:

Basic Create PayPal Transaction

This example shows a basic Create PayPal Transaction request, containing the minimum required fields to process a single PayPal transaction. The request does not include any information about the shopper, so this may be a new shopper or a guest checkout. It does include the required fraud check info in the transaction-fraud-info resource.

Create PayPal Transaction with payer info

To perform a Create PayPal Transaction and send information about the shopper, you'll need to include the payer-info property within the alt-transaction resource in your request. In this property, you can send information such as the shopper's first and last name, email, phone number, and address. See payer-info.

Above is an example of a Create PayPal Transaction request with the shopper's first and last name sent in the payer-info property.

Create PayPal Transaction with vaulted shopper

To perform a Create PayPal Transaction with an existing vaulted shopper, you'll need to include the vaulted-shopper-id property within the alt-transaction resource in your request.

Important: If you set the 'no-shipping' property (in the paypal-transaction resource) to 0 or 2, then the shopper's shipping address will be retrieved from PayPal, and the vaulted shopper will be automatically updated with that shipping address.

Above is an example of a Create PayPal Transaction request with an existing vaulted shopper with the ID 20781033.

Create PayPal Transaction with Merchant Transaction ID and metadata

You may wish to assign your own ID to each transaction, for example in order to track the transactions in your own internal systems. To do this, you will need to include the merchant-transaction-id property within the alt-transaction resource in your request.

You can also send metadata for the transaction, such as a description of the item, or tax or shipping information. To do this, you will need to include the transaction-meta-data property (a container for meta-data key-value pairs) within the alt-transaction resource in your request.

Above is an example of a request that includes a Merchant Transaction ID (MTI), as well as metadata for the transaction, including state tax, city tax, and the shipping amount.

Create PayPal Transaction with transaction description

By default, the PayPal page will show the statement descriptor as the description of the product being purchased. If you prefer to show a different description, you can send it in the transaction-description element.

Above is an example of a Create PayPal Transaction request with the transaction-description.

Create PayPal Transaction with In-Context checkout

If you would like to enable In-Context PayPal checkout, set the in-context property in the paypal-transaction resource to true.

Above is an example of a request with In-Context checkout enabled.

Create PayPal Transaction for initial subscription payment

If you are managing subscriptions yourself (or through a third party), you can use the PayPal payment method for subscription payments. In the initial subscription payment, include the recurring property in the paypal-transaction resource, and set the value to 1.

Above is an example of an initial subscription payment with PayPal.

For more information, see the guide to processing merchant-managed PayPal subscriptions.

Create PayPal Transaction for recurring subscription payment

After you have processed an initial subscription payment using PayPal, you can then associate the recurring payments with the relevant subscription by including the paypal-subscription-id in the paypal-transaction resource.

How to get the subscription ID

You can obtain the subscription ID in two ways:

  • In the subscriptionId field in the Charge IPN that is sent once the initial payment is processed.
    or
  • By sending a Retrieve PayPal Transaction request once the payment has been processed.

Above is an example of a recurring subscription payment with PayPal.

For more information, see the guide to processing merchant-managed PayPal subscriptions.



Back to Top


API Explorer

To test out a call, enter the XML portion of the request below and then click Try it!

Tip: Copy the XML portion from one of the example requests above, or use the XML code below as a starting point. You can enter different parameters and values to see how your test scenario would work. The request headers, including authorization, are already built in for you in this test area, so you should not include them here.

<alt-transaction xmlns="http://ws.plimus.com">
   <soft-descriptor>ABC COMPANY</soft-descriptor>
   <amount>100.00</amount>
   <currency>USD</currency>
   <paypal-transaction>
      <return-url>http://www.returnURL.com</return-url>
      <cancel-url>http://www.cancelURL.com</cancel-url>
   </paypal-transaction>
</alt-transaction>

User Information

Try It Out


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