为bluesnap购物者请求添加折扣

时间:2017-06-25 06:24:40

标签: paypal payment-gateway bluesnap

我正在使用bluesnap购物者API来创建购物者表单: https://developers.bluesnap.com/v8976-Extended/docs/create-shopper

这是我发送的网址:

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

它对我很有用。

现在,我想添加折扣字段,我无法从购物者的API中弄清楚如何添加它?如果你可以附上我需要发送的网址?

1 个答案:

答案 0 :(得分:3)

您可以使用以下两种方法之一来确保购物者从BlueSnap目录价格中获得购买折扣:

1)实施优惠券。将其存储在与您创建的购物者关联的系统中。然后,使用订单Web服务为购物者下订单并获得折扣:

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)使用覆盖价格。在这种情况下,无论目录价格如何,您都可以精确控制购物者获得多少折扣:

<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>

在这两种情况下,其他任何人都需要花费10美元的产品将以7美元的价格出售给您选择的购物者。