After two years of updating “SkrShop” has formed the following architecture:

The purple content in the picture is the main content of this article: the basic service of marketing system “coupon service”. But, first, about being constantly pushed.

About urging?

I give the following explanation: people lazy on holidays 🤷♀️(I’m right 😭), work tight, need to ensure quality, on sauce. But WHAT I can guarantee is that it will always be updated. I hope you can understand.

About the next installment?

Before, we all wanted to see the content related to the order on Github, so we started the order journey after updating this issue of “coupon”.

Issues are as follows:

1. https://github.com/skr-shop/manuals/issues/25
2. https://github.com/skr-shop/manuals/issues/18
Copy the code

Enter the topic, the basic service of marketing system “coupon service”. Introduce coupons by asking:

  • What types of coupons are available?
  • What is the scope of the coupon?
  • What are the common scenarios of coupons?
  • What service capacity should coupon service have?
  • How to control the risk of coupon service?

What types of coupons are available?

For users who obtain coupons, they focus on the preferential ability of coupons, so coupons are mainly divided into the following three categories according to the preferential ability dimension:

Preferential capacity dimension describe
Full cut coupons How much can be deducted from the full amount (excluding postage)
Cash coupon How much cash to deduct (no threshold)
rebate To deduct the entire amount of a Sku (one quantity)
Discount coupons At a discount

For operators who issue coupons:

One is the “fixed expiration date,” where the coupon’s expiration date and expiration date stamps are determined at the time the coupon is created. The user can get the coupon at any time, and the validity time of the coupon is the start and end time of the validity time previously set.

The other is the “dynamic validity period”, creating coupons to set the validity period, such as 7 days, 12 hours, etc. For this kind of coupon, the time when the user collects the coupon is the start time of the validity period of the coupon, and the time when the user collects the coupon + the validity period is the end time of the validity period.

Dimension of validity Type of coupon Effective time of coupon Coupon expiration time describe
fixed Fixed term The coupon type was determined when it was created The coupon type was determined when it was created No matter when the user receives the coupon, the effective time of the coupon is the set uniform time
dynamic Dynamic validity period The current timestamp when the user receives the coupon The current timestamp is + N*24*60*60 when the user receives the coupon When a coupon type is created, only the validity of the coupon is determined, for example, 6 hours, 7 days, or a month

The summary is as follows:

What is the scope of the coupon?

Operating strategy

Operating strategy describe
(Not) Specify the Sku Sku ticket
(Not) Specify the Spu The Spu stamps
(not) specified category Class notes
Specify the store Store vouchers
His general Platform ticket

Apply to the terminal

Applicable terminal (check box) describe
Android AnZhuoDuan
iOS The iOS side
PC Web PC
Mobile Web mobile terminal
Wechat WeChat end
Wechat applets Wechat applets
All All the above

Applicable people

Applicable people describe
White list Test users
members membership

The summary is as follows:

What are the common scenarios of coupons?

Coupon collection scenario

Coupon collection scenario describe
Activities page Big promotion, holiday activity page displays the button to obtain coupons
The game page Get coupons through the game
Shop front page The front page of the store shows the entrance to get coupons
Goods details The commodity details page shows the entrance to collect coupons
Integral center Redemption coupons

Coupon display scenario

Coupon display scenario describe
Activities page Promotion, holiday activity page display can receive coupons
Goods details The product details page displays a list of available and usable coupons
Personal center. – My coupon My coupon list
Order Settlement page Settlement page, list of coupons applicable to the order and recommendations
Integral center Show details of redeemable coupons

Select the coupon scenario

Select the coupon scenario describe
Goods details The product details page displays coupons that the user already has that apply to the product
Order Settlement page – Coupon list Select coupons available for settlement
Order Settlement page – Enter promo code Enter the discount code to settle

Coupon return scenario

Coupon return scenario describe
Outstanding order cancelled If the order is not paid, the user will cancel the return coupon, or return the coupon after the expiration of the order
All paid orders cancelled Paid orders, part of the order refund is not returned, when the entire order is fully refunded return coupons

Sample scenario

Sample scenario describe
Coupon on activity page Big promotion, holiday activity page displays the button to obtain coupons
Games send stamps The game rewards
Merchandise page for coupons
Store page coupon
Shopping coupons Purchase a Sku and issue coupons after the order is placed
New users are issued vouchers New users sign up to issue coupons
Points against the voucher Points for coupons

The summary is as follows:

What service capacity should coupon service have?

Service Capability 1: Issue coupons

disbursement describe
Synchronization issue It is suitable for users to click to get coupons and other scenarios with high real-time requirements
Asynchronous distributed It is applicable to voucher issuing scenarios with low real-time requirements, such as new user registration and voucher issuing scenarios
Distribution of ability describe
A single issue Specify a coupon type ID and specify a UID to issue only one coupon
Batch issue Specify a coupon type ID and a batch of UIds that issue only one coupon per UID
Distributing type describe
Coupon Type identification For example, when a coupon type is created, a 16-bit id code is generated and the user passes16-bit identifierGet a coupon; Instead of using increment ids (to avoid disclosing the number of coupons created in history),
Promo code code When creating a coupon type, the operator will fill in a six-digit Ascall code for the coupon, for exampleSKR6a6, the user receives the coupon through this code

Service capability 2: Revocation of coupons

Undo capability describe
Single undo Specify a coupon type ID and specify a UID to revoke only one coupon
Batch cancellation Specify a coupon type ID and a batch of UIds, each of which revokes one coupon

Service Ability 3: Search coupons

User coupon list A subclass describe
all Query all coupons for the user
You can use all Query all available coupons for the user
Applies to an SPU or SKU Queries the user for coupons available to an SPU or SKU
Applies to a category Query the user for coupons that are available for a certain category
Apply to a store Query the user for coupons available at a particular store
invalid all Query all invalid coupons for the user
overdue Query all expired coupons for the user
failure Query all expired coupons for the user

Service capability 4: Coupon recommendation on settlement page

The order settlement page recommends the best coupon for that order

The summary is as follows:

How to control the risk of coupon service?

Risk control is triggered once there is a possibility of risk occurrence:

  • Users are prompted to try again later or contact customer service
  • On the inside, alarm prompt, check whether there is a problem with the verification alarm

Frequency limit

To receive describe
Device ID Limit the number of coupons you can receive per day
UID Limit the number of coupons you can receive per day
IP Limit the number of coupons you can receive per day
use describe
Device ID Limit the number of coupons you can use per day
UID Limit the number of coupons you can use per day
IP Limit the number of coupons you can use per day
Mobile phone no. Limit the number of coupons you can use per day
Zip code For example, overseas regions that focus on zip codes can limit the number of coupons they can use per day

User risk level

Based on the historical order data of users, the ratio of successful transaction completion of users (such as successful 15 days +) is obtained. According to this ratio, users are classified into different levels, with the higher level entering the Unblock list and the lower level entering the Block list. Restriction policies are set according to different user levels. And other big data analysis methods.

The threshold value

  • Send vouchers budget
  • Actually use the voucher budget

Set the threshold value of the total number of coupons according to the budget value, block and alarm when triggering the threshold value.

Coupons do not support virtual goods

Coupons should not support virtual goods to prevent illegal activities that could be exploited.


[Skr Shop] Project address long press to enter: github.com/skr-shop/ma…


SkrShop series more articles:

  • What SkrShop |, seconds kill system has so many!
  • SkrShop | shopping cart design of requirement analysis
  • The architectural design of SkrShop | a shopping cart
  • SkrShop | system design of general drawing tools
  • SkrShop | general demand analysis of drawing tools
  • SkrShop | coder, you can design the trading system (work)?
  • SkrShop | coder, you can design the trading system (concept)?
  • SkrShop | third-party payment process analysis and summary
  • SkrShop | electrical design manual of basic goods information
  • SkrShop | electric business users of the system design manual