帮助中心

Coupon Usability Filter

2019-08-16

Scenario

External system needs to get a list of available coupons for a single order.


Direction

External system will call EZR

Call path:api/CouponInfo/CouponQuery

http://inditex-test.ezrpro.com/ The address for test environment, formal interface address to be determined,call path emain unchanged;

Core Logic

External system send order information and customer ID in request, a list of available coupons and their detail information will be returned.


Request Parameters

Field

Type

Required

Length

Description

OldCode

 string   

At least one   is required


Member's unique   code (external system)

Code

 string   


Member's   unique code (in EZR)

ShopCode

 string   

Yes


Shop ID

OrderCode

 string   

Yes


Sales orders   number

SaleDate

 string   

Yes


Date of order   created
  yyyy-MM-dd   HH:mm:ss

OrderSaleMoney

 decimal

Yes


Total price of all products in current order   (after presumed discount)
  (2digits decimal)                

OrderSaleQty

 int      

Yes


Total   quantity   of products in current order      

  

Returned Parameters

Field

Type

Length

Description

 SuccessList

 List<CouponInfo>

-

A list of coupons   which can be applied to current order

 FailList     

 List<CouponInfo>

-

A list of   coupons which can NOT be applied to current order

 

Detail of coupon list :

Field

Type

Length

Description

 CouponNo       

 string   


Number of   coupon                                  

 OldCode        

 string   


Member's   unique code (external system)                                        

 CouponType     

 string   


Coupon type
  DJ = cash coupon
  ZK = discount coupon
  CX = POS promotion coupon
  LP = gift coupon
  YQ = invitation coupon
  YY = 3rd party coupon

 CouponName     

 string   


Name of   coupon                                          

 BegDate        

 string   


Time when   coupon begin to be valid

 EndDate        

 string   


Time when   coupon expires

 Guide          

 string   


Description   of coupon

 CouponValue    

demical


Value of   coupon
  (0-1 for discount coupon)

 PriceLimit     

 decimal


Price limit   of coupon

 PromotionCode

 string   


promotion   code (in POS)

 IsMore          

 bool     


true:coupon is marked to be used with other coupons on single order
  false:coupon is marked NOT to be used with other   coupons on single order       

 MaxBuyNum      

 int      


A mark to   describe upper limit of product quantity of a single coupon if this coupon   should be applied to this order

 IsPositive     

 bool     


A mark to   describe if this coupon is only for products without any discount (original   price in order)

 CouponPrice    

 decimal


A mark to   describe the price of this coupon if it's for sale

 Code           

 string   


Code of   conpon's status:
  200: available for usage
  201:
验证失败;
  202:券号不存在;
  204: already consumed
  205: not in effective date range
  220: not available for usage (locked, banned)

 Message        

 string   


Description   content of code

 

 

Example Request (JSON)

{

   "OldCode": "EZ00001230",

   "Code": "",

   "ShopCode": "0001",

   "OrderCode": "EZ0001",

   "SaleDate": "2019-07-07",

   "OrderSaleMoney": "38",

   "OrderSaleQty": "10"

}


Example Return by EZR (JSON)

{

    "Msg":"成功",

    "Code":200,

    "Status":true,

    "Result":{

        "SuccessList":[

            {

                "CouponNo":"000002007130",

                "OldCode":"EZ00001230",

                "CouponType":"DJ",

                "CouponName":"50元代金券",

                "BegDate":"2019-07-08",

                "EndDate":"2019-07-11",

                "Guide":"123",

                "CouponValue":50,

                "PriceLimit":0,

                "PromotionCode":null,

                "IsMore":false,

                "MaxBuyNum":0,

                "IsPositive":false,

                "CouponPrice":0,

                "Code":"200",

                "Message":"OK"

            }

        ],

        "FailList":[

            {

                "CouponNo":"000002007131",

                "OldCode":"EZ00001230",

                "CouponType":"DJ",

                "CouponName":"50元代金券",

                "BegDate":"2019-07-08",

                "EndDate":"2019-07-11",

                "Guide":"123",

                "CouponValue":50,

                "PriceLimit":0,

                "PromotionCode":null,

                "IsMore":false,

                "MaxBuyNum":0,

                "IsPositive":false,

                "CouponPrice":0,

                "Code":"204",

                "Message":"已使用过的消费券"

            }

        ]

    }

}

1359