ECOMM API DOCUMENTATION


This is additional document beside original one (http://docs.tryemanagecrm.com/) to cover more cases as listed below: 

  • Shopping Cart Upgrade Feature: 
    • Upsell Upgrade
    • Upgrade of upgraded product
  • Progressive discount


Shopping Cart - Upgrade Feature

The system maintained the same endpoints, with some additional properties:


  1. Create shopping cart (online payment)

api/shoppingcart/ed1a9cc1-a838-4e02-a153-bc1891205b57/new?behaviorId=2 

{

"Product":

{

"productId": "918325",

"price": "100",

"quantity": "1",

"shippingMethodId": "145",

},

"customerIP": "72.229.28.185",

"behaviorId": 2

}

Add "behaviorId": 2  then the system will create a new Shopping Cart for testing.


2. Add upgrade:

(Customer has completed their cart and accepts an upgrade. The session is the same)

api/shoppingcart/ed1a9cc1-a838-4e02-a153-bc1891205b57/add?sessionId=207d39ce-cded-4bbf-91c5-ec98c604cfd0&behaviorId=2  

{

"productId": "918446",

"price": "120",

"quantity": "1",

"shippingMethodId": "145",

"upgradePreviewProductId": 918325,

"upgradePreviewQuantity": 1,

"upgradeParentSessionId": null

}


In this sample, the customer first purchased productId 918446, paid for and accepted the upgrade for new product 918325.

Three new properties:

  1. a)  "upgradePreviewProductId": 918325.Represents the old product
  2. b)  "upgradePreviewQuantity": 1.The quantity that the customer has upgraded
  3. c)  "upgradeParentSessionId": null.Keep this value null (same session)


The final price will be calculated by the system (final price = updated product price - previous product price)  


3. Upgrade of Upgrade

In this case, just send line in the preview request, with related upgraded product:

{

"productId": "918447",

"price": "140",

"quantity": "1",

"shippingMethodId": "145",

"upgradePreviewProductId": 918446,

"upgradePreviewQuantity": 1

}


The system will discard previews related products and send the upgraded product after proceeding with the payment of the difference between products (first and last).

In either case, if the system cannot pay the difference, after some attempts, the system will discard the upgrade and send the main paid product.

The final price will be calculated by the system (final price = updated product price - previous product price)    


4. Upgrade for offline payments - create shopping cart

api/shoppingcart/ed1a9cc1-a838-4e02-a153-bc1891205b57/new?behaviorId=2 

{

"Product":

{

"productId": "918446",

"price": "120",

"quantity": "1",

"shippingMethodId": "145",

"upgradePreviewProductId": 918325,

"upgradePreviewQuantity": 1,

"upgradeParentSessionId": "1ea3b99e-71e5-4caa-a9ed-9014de376a70"

},

"customerIP": "72.229.28.185",

"behaviorId": 2

}

You must create a new session and pass the old one as property  "upgradeParentSessionId": "1ea3b99e-71e5-4caa-a9ed-9014de376a70".

In this case, the customer finalized their cart, paid using a payment like PayPal with a link to confirm, and then accepted an upgrade.

After that, the user proceeds with the payment of the cart. The system will automatically send the upgraded product and discard the first one.

If the customer has not paid for the upgrade, the system will discard the upgrade.


Progressive Discount

You now have the ability to add a progressive discount within the shopping cart campaign.

When selecting a shopping cart campaign you will see the new progressive discount section. Here is an example of the settings:

In this example you can see there will be a discount of 25% applied if they choose 1 product and 50% if they choose 2.

This can be used for the Hajimari multiple product discounts for example.

Here is what the payload would look like: