{"_id":"5bc48b4f9919d4000df5ea50","category":{"_id":"5bc48b4f9919d4000df5ea3b","version":"5bc48b4f9919d4000df5ea7b","project":"57336fd5a6a9c40e00e13a0b","__v":0,"sync":{"url":"","isSync":false},"reference":true,"createdAt":"2016-05-17T12:18:45.712Z","from_sync":false,"order":6,"slug":"encrypt-parameters","title":"Encrypt/Decrypt Parameters"},"user":"560d5913af97231900938124","project":"57336fd5a6a9c40e00e13a0b","parentDoc":null,"version":{"_id":"5bc48b4f9919d4000df5ea7b","project":"57336fd5a6a9c40e00e13a0b","__v":0,"forked_from":"5b8ec64c7ef0f4000350182a","createdAt":"2018-04-23T15:17:35.680Z","releaseDate":"2018-04-23T15:17:35.680Z","categories":["5bc48b4f9919d4000df5ea33","5bc48b4f9919d4000df5ea34","5bc48b4f9919d4000df5ea35","5bc48b4f9919d4000df5ea36","5bc48b4f9919d4000df5ea37","5bc48b4f9919d4000df5ea38","5bc48b4f9919d4000df5ea39","5bc48b4f9919d4000df5ea3a","5bc48b4f9919d4000df5ea3b","5bc48b4f9919d4000df5ea3c","5bc48b4f9919d4000df5ea3d","5bc48b4f9919d4000df5ea3e","5b34c737e0dca2000311de6a","5bc48b4f9919d4000df5ea3f"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":false,"codename":"3.27.1 Release","version_clean":"8976.0.0-Tools","version":"8976-Tools"},"githubsync":"","__v":0,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-05-17T13:15:05.955Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[]},"method":"post","results":{"codes":[{"code":"","language":"text"}]},"settings":"","auth":"optional","params":[],"url":""},"isReference":true,"order":0,"body":"##Definition\nhttps<span>://sandbox.bluesnap.com/services/2/tools/param-encryption</span>\n\n<hr>\n\n##Documentation\nThe Encrypt Parameters request allows you to include [Hosted Checkout](https://support.bluesnap.com/docs/buynow-parameters) or [Hosted Payment Page parameters](https://support.bluesnap.com/docs/hosted-payment-page-parameters) and encrypt all of them into a single string that can be included in the URL for your [Hosted Checkout](https://support.bluesnap.com/docs/intro-hosted-checkout) and [Hosted Payment pages](https://support.bluesnap.com/docs/intro-to-buynow-hosted-payments-page).\n\nWhen adding the encrypted string to your URL, include it as the value of the `enc` parameter. For example:\n`https://checkout.bluesnap.com/buynow/checkout?storeId=1022&enc=TROfAP5AKDEtqWYHV7JSpIWO6mwWW71tswnrVH%2BT%3D%3D`\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"Although the `storeId` parameter is usually optional in the checkout page URL, it is mandatory when using the encrypted string.\"\n}\n[/block]\n###Request Content\n`param-encryption` *container* &nbsp;&nbsp;&nbsp;<span style=\"color:#F37500\">**required**</span>, contains the following properties (see [param-encryption](doc:param-encryption)):\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`parameters` *string* &nbsp;&nbsp;&nbsp;<span style=\"color:#F37500\">**required**</span> (see [parameters](doc:parameters))\n\n###Response Details\nIf successful, the response HTTP status code is 200 OK.\nThe encrypted string is returned within the `encrypted-token` property.\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/tools/param-encryption \\\\\\n-H 'Content-Type: application/xml' \\\\\\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n<param-encryption xmlns=\\\"http://ws.plimus.com\\\">\\n  <parameters>\\n    <parameter>\\n      <param-key>sku2125148</param-key>\\n      <param-value>1</param-value>\\n    </parameter>\\n    <parameter>\\n      <param-key>currency</param-key>\\n      <param-value>USD</param-value>\\n    </parameter>\\n    <parameter>\\n      <param-key>language</param-key>\\n      <param-value>ENGLISH</param-value>\\n    </parameter>\\n  </parameters>\\n</param-encryption>'\",\n      \"language\": \"curl\",\n      \"name\": \"Encrypt Parameters Request: basic\"\n    },\n    {\n      \"code\": \"curl -v -X POST https://sandbox.bluesnap.com/services/2/tools/param-encryption \\\\\\n-H 'Content-Type: application/xml' \\\\\\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n<param-encryption xmlns=\\\"http://ws.plimus.com\\\">\\n  <parameters>\\n    <parameter>\\n      <param-key>shopperId</param-key>\\n      <param-value>19505364</param-value>\\n    </parameter>\\n    <parameter>\\n      <param-key>expirationInMinutes</param-key>\\n      <param-value>300</param-value>\\n    </parameter>\\n    <parameter>\\n      <param-key>pageName</param-key>\\n      <param-value>AUTO_LOGIN_PAGE</param-value>\\n    </parameter>\\n  </parameters>\\n</param-encryption>'\",\n      \"language\": \"curl\",\n      \"name\": \"auto login\"\n    },\n    {\n      \"code\": \"curl -v -X POST https://sandbox.bluesnap.com/services/2/tools/param-encryption \\\\\\n-H 'Content-Type: application/xml' \\\\\\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n<param-encryption xmlns=\\\"http://ws.plimus.com\\\">\\n  <parameters>\\n    <parameter>\\n      <param-key>thankyou.backtosellerurl</param-key>\\n      <param-value>https%3A%2F%2Fmywebsite.com%2Fmypage%3Finv%3D!%7Binvoice.id%7D</param-value>\\n    </parameter>\\n  </parameters>\\n</param-encryption>'\",\n      \"language\": \"curl\",\n      \"name\": \"back to seller URL\"\n    },\n    {\n      \"code\": \"curl -v -X POST https://sandbox.bluesnap.com/services/2/tools/param-encryption \\\\\\n-H 'Content-Type: application/xml' \\\\\\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n<param-encryption xmlns=\\\"http://ws.plimus.com\\\">\\n  <parameters>\\n    <parameter>\\n      <param-key>sku2129472priceamount</param-key>\\n      <param-value>15</param-value>\\n    </parameter>\\n    <parameter>\\n      <param-key>sku2129472pricecurrency</param-key>\\n      <param-value>GBP</param-value>\\n    </parameter>\\n    <parameter>\\n      <param-key>sku2129472recurringpriceamount</param-key>\\n      <param-value>20</param-value>\\n    </parameter>\\n    <parameter>\\n      <param-key>sku2129472recurringpricecurrency</param-key>\\n      <param-value>GBP</param-value>\\n    </parameter>\\n  </parameters>\\n</param-encryption>'\",\n      \"language\": \"curl\",\n      \"name\": \"override price\"\n    },\n    {\n      \"code\": \"curl -v -X POST https://sandbox.bluesnap.com/services/2/tools/param-encryption \\\\\\n-H 'Content-Type: application/xml' \\\\\\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n<param-encryption xmlns=\\\"http://ws.plimus.com\\\">\\n  <parameters>\\n    <parameter>\\n      <param-key>subscriptionId</param-key>\\n      <param-value>39469016</param-value>\\n    </parameter>\\n    <parameter>\\n      <param-key>expirationInMinutes</param-key>\\n      <param-value>300</param-value>\\n    </parameter>\\n    <parameter>\\n      <param-key>pageName</param-key>\\n      <param-value>PLAN_CHANGE_PAGE</param-value>\\n    </parameter>\\n    <parameter>\\n      <param-key>sku2169034</param-key>\\n      <param-value>1</param-value>\\n    </parameter>\\n  </parameters>\\n</param-encryption>'\",\n      \"language\": \"curl\",\n      \"name\": \"plan change\"\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\\\"?>\\n<param-encryption xmlns=\\\"http://ws.plimus.com\\\">\\n  <encrypted-token>XC9VdW0NVMnb%2FZdF1xccFwMulRrHqC2gurtDIrxRhHUFUqZAXA6Flwv3iR84oSVf</encrypted-token>\\n</param-encryption>\",\n      \"language\": \"xml\",\n      \"name\": \"Encrypt Parameters Reponse: 200 OK - basic\"\n    },\n    {\n      \"code\": \"HTTP/ 1.1 200 OK\\n\\n<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n<param-encryption xmlns=\\\"http://ws.plimus.com\\\">\\n  <encrypted-token>oDSauzLnClwx9Tq%2FtG2NN%2B5bAz87h74KopMiLRTcwiLGth3W5X1GQxtoOcaf521xfGRa2HLxglEwAhE37eesar0vw8az6A0Mk3jchpevQ%2Bstt0F32MuL59LwVT6QzD1n</encrypted-token>\\n</param-encryption>\",\n      \"language\": \"xml\",\n      \"name\": \"200 OK - auto login\"\n    },\n    {\n      \"code\": \"HTTP/ 1.1 200 OK\\n\\n<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n<param-encryption xmlns=\\\"http://ws.plimus.com\\\">\\n  <encrypted-token>vzog4BXQAg9UwYR91UpewQj7QREmV7T1iS6fj%2FlhAnab2zz1mUlnbpLJm6wpityBcDNpYIQfXFYpxyLGL4HKn%2F%2FhU0rafW2Hw2HVPAymDiinZ4MwcrePbJdfAgk6KsIcpoZA4YaMTuvi5gPu1LCDBw%3D%3D</encrypted-token>\\n</param-encryption>\",\n      \"language\": \"xml\",\n      \"name\": \"200 OK - back to seller URL\"\n    },\n    {\n      \"code\": \"HTTP/ 1.1 200 OK\\n\\n<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n<param-encryption xmlns=\\\"http://ws.plimus.com\\\">\\n  <encrypted-token>MrSwQVuGAwZTkT4QUfzoKP3Uq7fPc97U%2F0F%2FeHmSAZGXizA1%2BXJwa8u%2FDkCHpvcFrAgZW9dysuPc89Z8Fqe2R3h9Nw%2F1a5SsVjKeNJvYrbRvHec0xIpXzdQxpo63S4hcsGExVXfJHMrJDvTgZ5RCmkeqF%2FEHYN2uggHkREUi5Eg%3D</encrypted-token>\\n</param-encryption>\",\n      \"language\": \"xml\",\n      \"name\": \"200 OK - override price\"\n    },\n    {\n      \"code\": \"HTTP/ 1.1 200 OK\\n\\n<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n<param-encryption xmlns=\\\"http://ws.plimus.com\\\">\\n  <encrypted-token>XoDNW%2By%2BjDYrjF8KfAL3GpgNTTVmeB62tQPcYLPtNllgidXwaUooyOTFQU4KM6%2BpQmw4F7RmB9h52sFpsHr34cEWiw%2Bv8ykXEV29h5J65x5sqbO2fioL%2B6lRt%2BoBPK7t4Gc3c4UZBYRJoDVz9EwGqg%3D%3D</encrypted-token>\\n</param-encryption>\",\n      \"language\": \"xml\",\n      \"name\": \"200 OK - plan change\"\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\n\n###Encrypt Parameters: basic\nThis example shows how to encrypt basic parameters, such as the `SKU ID`, `currency`, and `language`.\n\n###Encrypt Parameters: auto login\nThis example shows how to encrypt auto login parameters, such as `shopperId`.\n\n###Encrypt Parameters: back to seller URL\nThis example shows how to encrypt the `back to seller URL` parameter, which creates a link to a specific website after the order is completed. Note that the URL must be encoded.\n\n###Encrypt Parameters: override price\nThis example shows how to encrypt the price and recurring price parameters, you must encrypt the price parameters in order to override the price for BuyNow Hosted Checkout Pages. For more information, see [Overriding the price](http://support.bluesnap.com/docs/pricing-and-currency#section-overriding-the-price).\n\n<br>\n<a class=\"btn btn-primary\" href=\"#\" role=\"button\">Back to Top</a>","excerpt":"","slug":"encrypt-parameters","type":"endpoint","title":"Encrypt Parameters"}

postEncrypt Parameters


Definition

https://sandbox.bluesnap.com/services/2/tools/param-encryption


Documentation

The Encrypt Parameters request allows you to include Hosted Checkout or Hosted Payment Page parameters and encrypt all of them into a single string that can be included in the URL for your Hosted Checkout and Hosted Payment pages.

When adding the encrypted string to your URL, include it as the value of the enc parameter. For example:
https://checkout.bluesnap.com/buynow/checkout?storeId=1022&enc=TROfAP5AKDEtqWYHV7JSpIWO6mwWW71tswnrVH%2BT%3D%3D

Although the storeId parameter is usually optional in the checkout page URL, it is mandatory when using the encrypted string.

Request Content

param-encryption container    required, contains the following properties (see param-encryption):
      parameters string    required (see parameters)

Response Details

If successful, the response HTTP status code is 200 OK.
The encrypted string is returned within the encrypted-token property.


Examples

Request Examples

curl -v -X POST https://sandbox.bluesnap.com/services/2/tools/param-encryption \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<param-encryption xmlns="http://ws.plimus.com">
  <parameters>
    <parameter>
      <param-key>sku2125148</param-key>
      <param-value>1</param-value>
    </parameter>
    <parameter>
      <param-key>currency</param-key>
      <param-value>USD</param-value>
    </parameter>
    <parameter>
      <param-key>language</param-key>
      <param-value>ENGLISH</param-value>
    </parameter>
  </parameters>
</param-encryption>'
curl -v -X POST https://sandbox.bluesnap.com/services/2/tools/param-encryption \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<param-encryption xmlns="http://ws.plimus.com">
  <parameters>
    <parameter>
      <param-key>shopperId</param-key>
      <param-value>19505364</param-value>
    </parameter>
    <parameter>
      <param-key>expirationInMinutes</param-key>
      <param-value>300</param-value>
    </parameter>
    <parameter>
      <param-key>pageName</param-key>
      <param-value>AUTO_LOGIN_PAGE</param-value>
    </parameter>
  </parameters>
</param-encryption>'
curl -v -X POST https://sandbox.bluesnap.com/services/2/tools/param-encryption \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<?xml version="1.0" encoding="UTF-8"?>
<param-encryption xmlns="http://ws.plimus.com">
  <parameters>
    <parameter>
      <param-key>thankyou.backtosellerurl</param-key>
      <param-value>https%3A%2F%2Fmywebsite.com%2Fmypage%3Finv%3D!%7Binvoice.id%7D</param-value>
    </parameter>
  </parameters>
</param-encryption>'
curl -v -X POST https://sandbox.bluesnap.com/services/2/tools/param-encryption \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<param-encryption xmlns="http://ws.plimus.com">
  <parameters>
    <parameter>
      <param-key>sku2129472priceamount</param-key>
      <param-value>15</param-value>
    </parameter>
    <parameter>
      <param-key>sku2129472pricecurrency</param-key>
      <param-value>GBP</param-value>
    </parameter>
    <parameter>
      <param-key>sku2129472recurringpriceamount</param-key>
      <param-value>20</param-value>
    </parameter>
    <parameter>
      <param-key>sku2129472recurringpricecurrency</param-key>
      <param-value>GBP</param-value>
    </parameter>
  </parameters>
</param-encryption>'
curl -v -X POST https://sandbox.bluesnap.com/services/2/tools/param-encryption \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<param-encryption xmlns="http://ws.plimus.com">
  <parameters>
    <parameter>
      <param-key>subscriptionId</param-key>
      <param-value>39469016</param-value>
    </parameter>
    <parameter>
      <param-key>expirationInMinutes</param-key>
      <param-value>300</param-value>
    </parameter>
    <parameter>
      <param-key>pageName</param-key>
      <param-value>PLAN_CHANGE_PAGE</param-value>
    </parameter>
    <parameter>
      <param-key>sku2169034</param-key>
      <param-value>1</param-value>
    </parameter>
  </parameters>
</param-encryption>'

Response Examples

HTTP/ 1.1 200 OK

<?xml version="1.0" encoding="UTF-8"?>
<param-encryption xmlns="http://ws.plimus.com">
  <encrypted-token>XC9VdW0NVMnb%2FZdF1xccFwMulRrHqC2gurtDIrxRhHUFUqZAXA6Flwv3iR84oSVf</encrypted-token>
</param-encryption>
HTTP/ 1.1 200 OK

<?xml version="1.0" encoding="UTF-8"?>
<param-encryption xmlns="http://ws.plimus.com">
  <encrypted-token>oDSauzLnClwx9Tq%2FtG2NN%2B5bAz87h74KopMiLRTcwiLGth3W5X1GQxtoOcaf521xfGRa2HLxglEwAhE37eesar0vw8az6A0Mk3jchpevQ%2Bstt0F32MuL59LwVT6QzD1n</encrypted-token>
</param-encryption>
HTTP/ 1.1 200 OK

<?xml version="1.0" encoding="UTF-8"?>
<param-encryption xmlns="http://ws.plimus.com">
  <encrypted-token>vzog4BXQAg9UwYR91UpewQj7QREmV7T1iS6fj%2FlhAnab2zz1mUlnbpLJm6wpityBcDNpYIQfXFYpxyLGL4HKn%2F%2FhU0rafW2Hw2HVPAymDiinZ4MwcrePbJdfAgk6KsIcpoZA4YaMTuvi5gPu1LCDBw%3D%3D</encrypted-token>
</param-encryption>
HTTP/ 1.1 200 OK

<?xml version="1.0" encoding="UTF-8"?>
<param-encryption xmlns="http://ws.plimus.com">
  <encrypted-token>MrSwQVuGAwZTkT4QUfzoKP3Uq7fPc97U%2F0F%2FeHmSAZGXizA1%2BXJwa8u%2FDkCHpvcFrAgZW9dysuPc89Z8Fqe2R3h9Nw%2F1a5SsVjKeNJvYrbRvHec0xIpXzdQxpo63S4hcsGExVXfJHMrJDvTgZ5RCmkeqF%2FEHYN2uggHkREUi5Eg%3D</encrypted-token>
</param-encryption>
HTTP/ 1.1 200 OK

<?xml version="1.0" encoding="UTF-8"?>
<param-encryption xmlns="http://ws.plimus.com">
  <encrypted-token>XoDNW%2By%2BjDYrjF8KfAL3GpgNTTVmeB62tQPcYLPtNllgidXwaUooyOTFQU4KM6%2BpQmw4F7RmB9h52sFpsHr34cEWiw%2Bv8ykXEV29h5J65x5sqbO2fioL%2B6lRt%2BoBPK7t4Gc3c4UZBYRJoDVz9EwGqg%3D%3D</encrypted-token>
</param-encryption>

Back to Top


Example Descriptions

Encrypt Parameters: basic

This example shows how to encrypt basic parameters, such as the SKU ID, currency, and language.

Encrypt Parameters: auto login

This example shows how to encrypt auto login parameters, such as shopperId.

Encrypt Parameters: back to seller URL

This example shows how to encrypt the back to seller URL parameter, which creates a link to a specific website after the order is completed. Note that the URL must be encoded.

Encrypt Parameters: override price

This example shows how to encrypt the price and recurring price parameters, you must encrypt the price parameters in order to override the price for BuyNow Hosted Checkout Pages. For more information, see Overriding the price.



Back to Top