3

I'm using the bluesnap shopper API in order to create a shopper form: https://developers.bluesnap.com/v8976-Extended/docs/create-shopper

This is the url i'm sending:

https://sandbox.bluesnap.com/buynow/checkout?
storeId=xxxxx&
skinId=xxxx&
skuxxxxx=1&
currency=USD&
shopper.firstName=some_name&
shopper.lastName=some_lastName&
shopper.email=test_email@bla.com&
shopper.address1=Rotunda%20Drive&
shopper.city=Dearborn&
shopper.state=Mi&
shopper.zip=481201230&
shopper.phone=05444444&
shopper.country=us&
enc=xab1b2b4k55trtg
&sellerorderid=bs_xxx

And it works great for me.

Now, I want to add a discount field, and i couldn't figure out from the shopper's API how can i add it? If you can attach the url that i need to send?

Rot-man
  • 18,045
  • 12
  • 118
  • 124
  • Is the discount you want associated with a shopper or with a purchase? The purchase does have a special price or use a coupon: https://developers.bluesnap.com/v8976-Extended/docs/create-order. – Assafs Jun 27 '17 at 09:33
  • With a shopper. – Rot-man Jun 27 '17 at 09:38
  • In which case, a coupon can be issued for the shopper and they can use it during the purchase to get a discount. The coupon can be for all products or just some; it can be for a percentage of the purchase amount or a fixed amount; it can be used without limit or only a few times. you can set it with a web service (or via the BlueSnap console), and you can email it to a shopper or even save the code with your shopper entity so it can be automatically applied. The BlueSnap Shopper entity does not have a coupon attribute, but yours could. – Assafs Jun 27 '17 at 09:53
  • Thanks @Assafs, I want the users to see the total price automatically. I don't want them to insert coupons, i just want to add an extra parameter (e.g. 'total_price', 'price' or 'discount') to the web service i wrote above, and see the relevant price for that user. Is that possible? – Rot-man Jun 27 '17 at 15:19
  • Yes, both with override price and with coupons - the user need not know how it's done behind the scenes. Let me get home and I'll try to write a more complete answer. – Assafs Jun 27 '17 at 15:55
  • That will be great, thanks! – Rot-man Jun 27 '17 at 19:13
  • No problem. Answer added with examples. – Assafs Jun 28 '17 at 05:13
  • By the way, could I ask that you to accept the answer below? Just click on the gray check mark next to it, making it green? – Assafs Sep 27 '17 at 10:26

1 Answers1

3

You could use one of two ways to make sure your shopper receives a discount on purchase from the BlueSnap catalog price:

1) implement a coupon. store it in your system associated with the shopper you created. Then, use the orders web service to place an order for the shopper with the discount:

https://ws.bluesnap.com/services/2/orders  POST

<order xmlns="http://ws.plimus.com">
  <ordering-shopper>
    <shopper-id>19575992</shopper-id> -- the shopper ID you prepared in advance
    <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>
  </ordering-shopper>
  <cart>
    <cart-item>
      <sku>
        <sku-id>2152762</sku-id> -- a product that has catalog price of 10 usd
      </sku>
      <quantity>1</quantity>
    </cart-item>
    <coupons>
      <coupon>30-percent-off-code</coupon> -- the coupon code you made for the shopper.
    </coupons>
  </cart>
  <expected-total-price>
    <amount>7.00</amount> -- the price for this shopper after the discount
    <currency>USD</currency>
  </expected-total-price>
</order>

2) Use override price. In this case, you can control exactly how much of a discount the shopper gets, regardless of the catalog price:

<order xmlns="http://ws.plimus.com">
  <ordering-shopper>
    <shopper-id>19575992</shopper-id>
    <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>
  </ordering-shopper>
  <cart>
    <cart-item>
      <sku>
        <sku-id>2152762</sku-id>
        <sku-charge-price>
          <charge-type>initial</charge-type>
          <amount>7.00</amount>
          <currency>USD</currency>
        </sku-charge-price>
      </sku>
      <quantity>1</quantity>
    </cart-item>
  </cart>
  <expected-total-price>
    <amount>7.00</amount>
    <currency>USD</currency>
  </expected-total-price>
</order>

In both cases, the product that costs 10 USD for anyone else will be sold to the shopper you selected for 7 USD.

Assafs
  • 3,257
  • 4
  • 26
  • 39