Encrypt Parameters

Definition

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


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

❗️

Important

  • When you perform the API call, use the ws.bluesnap.com URL.
    The URL above is an example of the checkout.bluesnap.com link with the encrypted string included.
  • 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 property(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