Skip to content

Instantly share code, notes, and snippets.

@renard314
Last active July 14, 2016 08:41
Show Gist options
  • Save renard314/4fd406d698ba36e855c843e821fd118a to your computer and use it in GitHub Desktop.
Save renard314/4fd406d698ba36e855c843e821fd118a to your computer and use it in GitHub Desktop.
GET coupons/eligible
{
"couponCodes": [
{
"id": 0,
"image": {
"height": 200,
"width": 200,
"backgroundColor": "#f40707",
"url": "https://rm-goldenmedia.imgix.net/ce235b5a9f34586f34e931487df1f7d4.jpg"
},
"savings": {
"amount": {
"scale": 2,
"unscaledValue": 1000
},
"currencyCode": "SGD"
},
"termsAndConditions": "https://redmart.com/promotions/tenoff",
"description": "25% off of your first order"
},
{
"id": 1,
"image": {
"height": 200,
"width": 200,
"backgroundColor": "#f40707",
"url": "https://rm-goldenmedia.imgix.net/ce235b5a9f34586f34e931487df1f7d4.jpg"
},
"savings": {
"amount": {
"scale": 2,
"unscaledValue": 0
},
"currencyCode": "SGD"
},
"termnAndConditions": "https://redmart.com/promotions/allforbaby",
"description": "25% off of baby clothes",
"destinationUrl": "https://redmart.com/themes/frozen",
"statusMessage": "You don't have baby clothes in your cart"
}
]
}
@renard314
Copy link
Author

renard314 commented Jun 1, 2016

GET coupons/eligible

returns a list of coupon objects

  • sorted by savings based on current cart
  • if the marketing budget is spent the list will be empty
  • only eligible coupon codes are shown which means that api will apply any special coupon rules and will only return coupons that the user can use

the coupon object

  • if a coupon code doesn't give savings, it has a statusMessage telling the customer what she has to do to get savings
  • optional a deeplink into a category or theme if the coupon code applies to a theme or category only
  • an image resource
  • a description
  • a deeplink to terms and conditions

@renard314
Copy link
Author

POST checkout/applycoupon OR/AND POST cart/applycoupon

payload = {"id:0}

Result = CartTotal object

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment