Create Shopping Context

Definition

https://sandbox.bluesnap.com/services/2/shopping-context


The Create Shopping Context request enables you to place an order for a shopper and defer payment to a later time. This should be used for transactions with asynchronous payment methods like PayPal or wire transfers. This request can't be used for card transactions.

Request Content

shopping-context    required, contains the following properties (refer to shopping-context):

PropertyTypeRequired
stepstringoptional
web-infocontainerrequired (refer to web-info)
shopper-detailscontaineroptional (refer to shopper-details)
order-detailscontainerrequired (refer to order-details)
store-cardbooleanoptional

Query Parameters

Optionally, you can include these query parameters in the web service URL in your request.

Parameter NameDescriptionExample
returnrepresentationReturn the shopping-context resource in the response. Default is false.returnrepresentation=true
performfullauthorizationPerform authorization for the full amount of the the shopping-context. Otherwise, just validate the payment method on the default amount. Default is true.performfullauthorization=false
expirationinminutesConfigure the expiration time in minutes.expirationinminutes=15

Response Details

If successful, the response HTTP status code is 201 Created.
The Location response header contains the URI of the newly created shopping-context resource.
In most cases, there is no content in the response body.
However, the shopping-context resource will be returned if you use the returnrepresentation parameter, and for PayPal transactions.

Back to Top


Examples

Request Examples

curl -v -X POST https://sandbox.bluesnap.com/services/2/shopping-context \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<shopping-context xmlns="http://ws.plimus.com">
  <web-info>
    <ip>62.219.121.253</ip>
    <remote-host>www.merchant.com</remote-host>
    <user-agent>Mozilla/5.0 (Linux; X11)</user-agent>
  </web-info>
  <shopper-details>
    <shopper>
      <shopper-info>
        <shopper-contact-info>
          <title>Mr</title>
          <first-name>shopper first name</first-name>
          <last-name>shopper last name</last-name>
          <email>[email protected]</email>
          <company-name>JS Company</company-name>
          <address1>123 Oxford</address1>
          <address2 />
          <city>City</city>
          <state>NY</state>
          <zip>54321</zip>
          <country>us</country>
          <phone>1800808080</phone>
          <fax>1800808080</fax>
        </shopper-contact-info>
        <store-id>12700</store-id>
        <vat-code />
        <shopper-currency>USD</shopper-currency>
        <locale>en</locale>
      </shopper-info>
    </shopper>
  </shopper-details>
  <order-details>
    <order>
      <cart>
        <cart-item>
          <sku>
            <sku-id>2178316</sku-id>
          </sku>
          <quantity>1</quantity>
        </cart-item>
      </cart>
      <expected-total-price>
        <amount>50.00</amount>
        <currency>USD</currency>
      </expected-total-price>
    </order>
  </order-details>
</shopping-context>'
curl -v -X POST https://sandbox.bluesnap.com/services/2/shopping-context?returnrepresentation=true \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<shopping-context xmlns="http://ws.plimus.com">
  <web-info>
    <ip>62.219.121.253</ip>
    <remote-host>www.merchant.com</remote-host>
    <user-agent>Mozilla/5.0 (Linux; X11)</user-agent>
  </web-info>
  <shopper-details>
    <shopper>
      <shopper-info>
        <shopper-contact-info>
          <title>Mr</title>
          <first-name>shopper first name</first-name>
          <last-name>shopper last name</last-name>
          <email>[email protected]</email>
          <company-name>JS Company</company-name>
          <address1>123 Oxford</address1>
          <address2 />
          <city>City</city>
          <state>NY</state>
          <zip>54321</zip>
          <country>us</country>
          <phone>1800808080</phone>
          <fax>1800808080</fax>
        </shopper-contact-info>
        <shipping-contact-info>
          <first-name>Shipping first name</first-name>
          <last-name>Shipping last name</last-name>
          <address1>123 Oxford</address1>
          <address2 />
          <city>City</city>
          <state>NY</state>
          <zip>54321</zip>
          <country>US</country>
        </shipping-contact-info>
        <invoice-contacts-info>
          <invoice-contact-info>
            <default>true</default>
            <company-name>BlueSnap UK</company-name>
            <vat-code></vat-code>
            <title>Mrs.</title>
            <first-name>John</first-name>
            <last-name>Doe</last-name>
            <address1>5 Star drive</address1>
            <address2>3rd entrance</address2>
            <city>Purchase</city>
            <state>NY</state>
            <zip>34645</zip>
            <country>us</country>
            <phone>1800400500</phone>
            <fax>1800400500</fax>
            <email>[email protected]</email>
          </invoice-contact-info>
        </invoice-contacts-info>
        <store-id>12700</store-id>
        <vat-code></vat-code>
        <shopper-currency>USD</shopper-currency>
        <locale>en</locale>
      </shopper-info>
    </shopper>
  </shopper-details>
  <order-details>
    <order>
      <cart>
        <cart-item>
          <sku>
            <sku-id>2178316</sku-id>
            <sku-charge-price>
              <charge-type>initial</charge-type>
              <amount>50.00</amount>
              <currency>USD</currency>
            </sku-charge-price>
          </sku>
          <quantity>1</quantity>
        </cart-item>
      </cart>
      <expected-total-price>
        <amount>50.00</amount>
        <currency>USD</currency>
      </expected-total-price>
    </order>
  </order-details>
</shopping-context>'
curl -v -X POST https://sandbox.bluesnap.com/services/2/shopping-context \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<shopping-context xmlns="http://ws.plimus.com">
  <web-info>
    <ip>62.219.121.253</ip>
    <remote-host>www.merchant.com</remote-host>
    <user-agent>Mozilla/5.0 (Linux; X11)</user-agent>
  </web-info>
  <shopper-details>
    <shopper>
      <shopper-info>
        <shopper-contact-info>
          <title>Mr</title>
          <first-name>Shopper first name</first-name>
          <last-name>Shopper last name</last-name>
          <email>[email protected]</email>
          <company-name>JS Company</company-name>
          <address1>123 Oxford</address1>
          <address2 />
          <city>City</city>
          <state>NY</state>
          <zip>54321</zip>
          <country>US</country>
          <phone>1800808080</phone>
          <fax>1800808080</fax>
        </shopper-contact-info>
        <shipping-contact-info>
          <first-name>Shipping first name</first-name>
          <last-name>Shipping last name</last-name>
          <address1>123 Oxford</address1>
          <address2 />
          <city>City</city>
          <state>NY</state>
          <zip>54321</zip>
          <country>US</country>
        </shipping-contact-info>
        <store-id>12700</store-id>
        <vat-code>123abc123</vat-code>
        <shopper-currency>USD</shopper-currency>
        <locale>en</locale>
      </shopper-info>
    </shopper>
  </shopper-details>
  <order-details>
    <order>
      <cart>
        <cart-item>
          <sku>
            <sku-id>2180434</sku-id>
          </sku>
          <quantity>1</quantity>
          <sku-parameter>
            <param-name>instructions</param-name>
            <param-value>Please follow the instructions</param-value>
          </sku-parameter>
        </cart-item>
      </cart>
      <expected-total-price>
        <amount>20.00</amount>
        <currency>USD</currency>
      </expected-total-price>
    </order>
  </order-details>
</shopping-context>'
curl -v -X POST https://sandbox.bluesnap.com/services/2/shopping-context?returnrepresentation=true \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<shopping-context xmlns="http://ws.plimus.com">
  <web-info>
    <ip>62.219.121.253</ip>
    <remote-host>bzq-219-121-253.static.bezeqint.net.reinventhosting.com</remote-host>
    <user-agent>Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;
		SV1; GTB6.3; .NET CLR 2.0.50727)</user-agent>
  </web-info>
  <shopper-details>
    <shopper>
      <shopper-info>
        <shopper-contact-info>
          <first-name>Jane</first-name>
          <last-name>Shopper</last-name>
          <email>[email protected]</email>
          <address1>123 Oxford</address1>
          <city>Boston</city>
          <state>ma</state>
          <zip>54321</zip>
          <country>us</country>
          <phone>1800808080</phone>
        </shopper-contact-info>
        <store-id>19805</store-id>
        <shopper-currency>USD</shopper-currency>
        <locale>en</locale>
      </shopper-info>
    </shopper>
  </shopper-details>
  <order-details>
    <order>
      <ordering-shopper>
        <local-bank-transfer/>
      </ordering-shopper>
      <cart>
        <cart-item>
          <sku>
            <sku-id>2343187</sku-id>
          </sku>
          <quantity>1</quantity>
        </cart-item>
      </cart>
      <expected-total-price>
        <amount>6.36</amount>
        <currency>USD</currency>
      </expected-total-price>
    </order>
  </order-details>
</shopping-context>'
curl -v -X POST https://sandbox.bluesnap.com/services/2/shopping-context \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<?xml version="1.0" encoding="UTF-8"?>
<shopping-context xmlns="http://ws.plimus.com">
  <web-info>
    <ip>62.219.121.253</ip>
    <remote-host>www.merchant.com</remote-host>
    <user-agent>Mozilla/5.0 (Linux; X11)</user-agent>
  </web-info>
  <shopper-details>
    <shopper>
      <fraud-info>
        <fraud-session-id>1234567890</fraud-session-id>
      </fraud-info>
      <shopper-info>
        <shopper-contact-info>
          <title>Mr</title>
          <first-name>ShopperPPFirst</first-name>
          <last-name>ShopperPPLast</last-name>
          <email>[email protected]</email>
          <company-name>Company PP</company-name>
          <address1>173 Willesden Ln</address1>
          <address2 />
          <city>London</city>
          <zip>NW6</zip>
          <country>UK</country>
          <phone>180098989878</phone>
          <fax>180098989878</fax>
        </shopper-contact-info>
        <store-id>10980</store-id>
        <vat-code />
        <shopper-currency>USD</shopper-currency>
        <locale>en</locale>
      </shopper-info>
    </shopper>
  </shopper-details>
  <order-details>
    <order>
      <ordering-shopper>
        <paypal>
          <pp-cancel-url>http://www.cancel-site.com</pp-cancel-url>
          <pp-return-url>http://www.success-site.com</pp-return-url>
          <pp-req-confirm-shipping>1</pp-req-confirm-shipping>
          <pp-no-shipping>0</pp-no-shipping>
          <pp-in-context>false<pp-in-context>
        </paypal>
      </ordering-shopper>
      <cart>
        <cart-item>
          <sku>
            <sku-id>2188078</sku-id>
            <sku-charge-price>
              <charge-type>initial</charge-type>
              <amount>30.00</amount>
              <currency>USD</currency>
            </sku-charge-price>
          </sku>
          <quantity>1</quantity>
        </cart-item>
      </cart>
      <expected-total-price>
        <amount>30.00</amount>
        <currency>USD</currency>
      </expected-total-price>
    </order>
  </order-details>
</shopping-context>'
curl -v -X POST https://sandbox.bluesnap.com/services/2/shopping-context \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<?xml version="1.0" encoding="UTF-8"?>
<shopping-context xmlns="http://ws.plimus.com">
  <web-info>
    <ip>62.219.121.253</ip>
    <remote-host>www.merchant.com</remote-host>
    <user-agent>Mozilla/5.0 (Linux; X11)</user-agent>
  </web-info>
  <order-details>
    <order>
      <ordering-shopper>
        <paypal>
          <pp-cancel-url>http://merchant-site.com/paypal-cancel</pp-cancel-url>
          <pp-return-url>http://merchant-site.com/paypal-success</pp-return-url>
          <pp-no-shipping>2</pp-no-shipping>
          <pp-req-confirm-shipping>0</pp-req-confirm-shipping>
          <pp-in-context>true</pp-in-context>
        </paypal>
        <fraud-info>
          <fraud-session-id>1234567890</fraud-session-id>
        </fraud-info>
      </ordering-shopper>
      <cart>
        <cart-item>
          <sku>
            <sku-id>2186520</sku-id>
          </sku>
          <quantity>1</quantity>
        </cart-item>
      </cart>
      <expected-total-price>
        <amount>0.00</amount>
        <currency>USD</currency>
      </expected-total-price>
    </order>
  </order-details>
</shopping-context>'
curl -v -X POST https://sandbox.bluesnap.com/services/2/shopping-context \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<?xml version="1.0" encoding="UTF-8"?>
<shopping-context xmlns="http://ws.plimus.com">
  <web-info>
    <ip>62.219.121.253</ip>
    <remote-host>www.merchant.com</remote-host>
    <user-agent>Mozilla/5.0 (Linux; X11)</user-agent>
  </web-info>
  <order-details>
    <order>
      <ordering-shopper>
        <paypal>
          <pp-cancel-url>http://merchant-site.com/paypal-cancel</pp-cancel-url>
          <pp-return-url>http://merchant-site.com/paypal-success</pp-return-url>
          <pp-no-shipping>2</pp-no-shipping>
          <pp-req-confirm-shipping>0</pp-req-confirm-shipping>
        </paypal>
        <fraud-info>
          <fraud-session-id>1234567890</fraud-session-id>
        </fraud-info>
      </ordering-shopper>
      <cart>
        <cart-item>
          <sku>
            <sku-id>2188676</sku-id>
          </sku>
          <quantity>1</quantity>
        </cart-item>
        <cart-item>
     <sku>
        <sku-id>2176834</sku-id>
     </sku>
     <quantity>1</quantity>
        </cart-item>
      </cart>
      <expected-total-price>
        <amount>1.00</amount>
        <currency>USD</currency>
      </expected-total-price>
    </order>
  </order-details>
</shopping-context>'

Response Examples

HTTP/ 1.1 201 Created
Location: https://sandbox.bluesnap.com/services/2/shopping-context/3990807
HTTP/ 1.1 201 Created
Location: https://sandbox.bluesnap.com/services/2/shopping-context/3923105

<?xml version="1.0" encoding="UTF-8"?>
<shopping-context xmlns="http://ws.plimus.com">
  <step>CREATED</step>
  <buynow-sso-token>TmccAdrae%2F5yQ3bPttIBKZJO2YkVXsDEkAHi1seNy4T46u4EYxAJDixd%2BPGgRfhyYi3Z1B3lMjt17ywBxpLfCtXiPWCc1zVIkb2zxl40qySaOpFCvHFKJLpTTaN6D%2B4x</buynow-sso-token>
  <web-info>
    <ip>62.219.121.253</ip>
    <remote-host>www.merchant.com</remote-host>
    <user-agent>Mozilla/5.0 (Linux; X11)</user-agent>
  </web-info>
  <order-details>
    <order>
      <order-id>3923105</order-id>
      <ordering-shopper>
        <shopper-id>19505574</shopper-id>
      </ordering-shopper>
      <cart>
        <charged-currency>USD</charged-currency>
        <cart-item>
          <sku>
            <sku-id>2178316</sku-id>
            <sku-name>Example contract 2</sku-name>
            <sku-charge-price>
              <charge-type>initial</charge-type>
              <amount>50.00</amount>
              <currency>USD</currency>
            </sku-charge-price>
          </sku>
          <quantity>1</quantity>
          <item-sub-total>50.00</item-sub-total>
        </cart-item>
        <tax>0.00</tax>
        <tax-rate>0</tax-rate>
        <total-cart-cost>50.00</total-cart-cost>
      </cart>
    </order>
  </order-details>
</shopping-context>
HTTP/ 1.1 201 Created
Location: https://sandbox.bluesnap.com/services/2/shopping-context/3936017

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<shopping-context xmlns="http://ws.plimus.com">
  <step>CREATED</step>
  <web-info>
    <ip>62.219.121.253</ip>
    <remote-host>bzq-219-121-253.static.bezeqint.net.reinventhosting.com</remote-host>
    <user-agent>Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;
		SV1; GTB6.3; .NET CLR 2.0.50727)</user-agent>
  </web-info>
  <order-details>
    <order>
      <order-id>8322757</order-id>
      <ordering-shopper>
        <shopper-id>22195529</shopper-id>
      </ordering-shopper>
      <transaction-payment-info>
        <local-bank-transfer-info>
          <swift-code>CITI US 33</swift-code>
          <payment-reference>410000368169</payment-reference>
          <additional-reference>8322757</additional-reference>
          <account-holder>Global Collect BV</account-holder>
          <bank-code>ABA&#x7c;021000089</bank-code>
          <bank-name>Citibank USA</bank-name>
          <country-description>United States</country-description>
          <status-id>800</status-id>
          <bank-city>New York</bank-city>
          <bank-account-number>40673525</bank-account-number>
        </local-bank-transfer-info>
      </transaction-payment-info>
      <cart>
        <charged-currency>USD</charged-currency>
        <cart-item>
          <sku>
            <sku-id>2343187</sku-id>
            <sku-name>Product A</sku-name>
          </sku>
          <quantity>1</quantity>
          <item-sub-total>5.99</item-sub-total>
        </cart-item>
        <tax>0.37</tax>
        <tax-rate>6.25</tax-rate>
        <total-cart-cost>6.36</total-cart-cost>
      </cart>
      <fraud-result-info>
        <device-data-collector>N</device-data-collector>
      </fraud-result-info>
    </order>
  </order-details>
</shopping-context>
HTTP/ 1.1 201 Created

<?xml version="1.0" encoding="UTF-8"?>
<shopping-context xmlns="http://ws.plimus.com">
  <step>CREATED</step>
  <web-info>
    <ip>62.219.121.253</ip>
    <remote-host>www.merchant.com</remote-host>
    <user-agent>Mozilla/5.0 (Linux; X11)</user-agent>
  </web-info>
  <order-details>
    <order>
      <order-id>3981975</order-id>
      <ordering-shopper>
        <shopper-id>19564898</shopper-id>
      </ordering-shopper>
      <transaction-payment-info>
        <paypal-info>
          <url>https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_express-checkout&token=EC-7HH373857W185241M</url>
        </paypal-info>
      </transaction-payment-info>
      <cart>
        <charged-currency>USD</charged-currency>
        <cart-item>
          <sku>
            <sku-id>2188078</sku-id>
            <sku-name>Example contract</sku-name>
            <sku-charge-price>
              <charge-type>initial</charge-type>
              <amount>33.00</amount>
              <currency>USD</currency>
            </sku-charge-price>
          </sku>
          <quantity>1</quantity>
          <item-sub-total>30.00</item-sub-total>
        </cart-item>
        <tax>0</tax>
        <tax-rate>0</tax-rate>
        <total-cart-cost>30.00</total-cart-cost>
      </cart>
    </order>
  </order-details>
</shopping-context>
HTTP/ 1.1 201 Created

<?xml version="1.0" encoding="UTF-8"?>
<shopping-context xmlns="http://ws.plimus.com">
  <step>CREATED</step>
  <web-info>
    <ip>62.219.121.253</ip>
    <remote-host>www.merchant.com</remote-host>
    <user-agent>Mozilla/5.0 (Linux; X11)</user-agent>
  </web-info>
  <order-details>
    <order>
      <order-id>3981977</order-id>
      <seller-order-id>364444</seller-order-id>
      <ordering-shopper>
        <shopper-id>19564900</shopper-id>
      </ordering-shopper>
      <transaction-payment-info>
        <paypal-info>
          <url>https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_express-checkout&token=EC-22562160R8730154V</url>
        </paypal-info>
      </transaction-payment-info>
      <cart>
        <charged-currency>USD</charged-currency>
        <cart-item>
          <sku>
            <sku-id>2186520</sku-id>
            <sku-name>recurring</sku-name>
          </sku>
          <quantity>1</quantity>
          <item-sub-total>30.00</item-sub-total>
        </cart-item>
        <tax>0.00</tax>
        <tax-rate>0</tax-rate>
        <total-cart-cost>30.00</total-cart-cost>
      </cart>
    </order>
  </order-details>
</shopping-context>
HTTP/ 1.1 201 Created
Location:  https://sandbox.bluesnap.com/services/2/shopping-context/3990105

<?xml version="1.0" encoding="UTF-8"?>
<shopping-context xmlns="http://ws.plimus.com">
  <step>CREATED</step>
  <web-info>
    <ip>62.219.121.253</ip>
    <remote-host>www.merchant.com</remote-host>
    <user-agent>Mozilla/5.0 (Linux; X11)</user-agent>
  </web-info>
  <order-details>
    <order>
      <order-id>3990105</order-id>
      <ordering-shopper>
        <shopper-id>19572392</shopper-id>
      </ordering-shopper>
      <transaction-payment-info>
        <paypal-info>
          <url>https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_express-checkout&token=EC-66E98375FU949215L</url>
          <pp-error-code>11452</pp-error-code>
          <pp-short-comment>Merchant not enabled for reference transactions</pp-short-comment>
          <pp-long-comment>Merchant not enabled for reference transactions</pp-long-comment>
        </paypal-info>
      </transaction-payment-info>
      <cart>
        <charged-currency>USD</charged-currency>
        <cart-item>
          <sku>
            <sku-id>2188676</sku-id>
            <sku-name>Example contract 1</sku-name>
          </sku>
          <quantity>1</quantity>
          <item-sub-total>0.00</item-sub-total>
        </cart-item>
        <cart-item>
          <sku>
            <sku-id>2176834</sku-id>
            <sku-name>Example contract 2r</sku-name>
          </sku>
          <quantity>1</quantity>
          <item-sub-total>1.00</item-sub-total>
        </cart-item>
        <tax>0.00</tax>
        <tax-rate>0</tax-rate>
        <total-cart-cost>1.00</total-cart-cost>
      </cart>
    </order>
  </order-details>
</shopping-context>

Back to Top