Santekno
Projects/Chip-In Discount & Chip-In Ongoing
Tokopedia logoPart of Tokopedia · Senior Software Engineer, Promotion Team
Backend / APILive

Chip-In Discount & Chip-In Ongoing

Designed a co-funded discount voucher system where the platform and sellers "chip in" to a shared discount — with a clean database relationship design, a reusable logic architecture, and a follow-up that halved development time.

2024-mvc-chip-in-discount · main
# E-Commerce / Promotion & Discounts
$ go -X POST /2024-mvc-chip-in-discount/v1/sync
→ 201 Created
{ "status": "ok" }
publish 2024-mvc-chip-in-discount.synced
Role
Senior Backend Engineer
Timeline
2024
Team
4
Domain
E-Commerce / Promotion & Discounts
Stack
7 tech
Status
Live
01

Overview

The Chip-In Discount project introduced a co-funded discount voucher mechanism where the platform and sellers each "chip in" to a shared discount, and Chip-In Ongoing extended it into a recurring follow-up. As technical lead and owner, I drove the work from the initial technical design through delivery, defining requirements, the supporting database relationship design, and the logic architecture. The launch increased voucher volume to ~110k — roughly a 2.24% increase month-over-month.

A backend has no screens, so its "UI" is the operational surface: the voucher API contract, the discount configuration flow, and volume/quality dashboards.

API contract — co-funded voucher creation & split
Ops view — discount configuration & rollout
Grafana — voucher volume & release quality
03

Problem & Solution

Problem

The platform needed discounts that could be co-funded by both the platform and sellers, with contribution splits, caps, and the voucher lifecycle handled reliably. Without a clean data model and shared logic, co-funding would fragment into ad-hoc fields, making the follow-up Ongoing work slow and error-prone.

Solution

I led the project from the initial technical design phase, ensuring all requirements were defined. I assessed the project needs and created a supporting database relationship design, then designed the logic architecture around voucher-service and discount-service and enforced high-quality coding practices. I kept the project on track so all milestones were met on time, mentored a junior engineer, and collaborated with fellow engineers who contributed to the project's success. On the Chip-In Ongoing follow-up, the reusable architecture cut development from a full sprint to half a sprint.

04

Workflow

Three actors interact with the service; the diagrams are written in English to stay consistent across both languages.

flowchart diagram

opt in & set contribution

configure discount

compute co-funding split

issue voucher

metrics

Seller

Seller Console

Voucher Service

Discount Service

Buyer

Prometheus / Grafana

Use case interaction
sequence diagram
Managed RDSDiscount ServiceVoucher ServiceSeller ConsoleManaged RDSDiscount ServiceVoucher ServiceSeller Consolecreate co-funded voucherrequest contribution split (platform/seller)split ratio + cappersist voucher & co-funding relationvoucher active
Sequence flow
05

Architecture

flowchart diagram

rpc

metrics

Seller Console

Voucher Service · Go

Discount Service · Go

Voucher Tables

Co-funding Split Table

Campaign Core Service

Prometheus / Grafana

System architecture
Architecture notes

voucher-service owns voucher creation, validation, and lifecycle, persisting vouchers and their co-funding relationships in a Managed RDS. discount-service computes the platform-vs-seller contribution split (ratio and cap). The database relationship design keeps co-funding a first-class relation rather than scattered columns, which made the Ongoing extension straightforward. Prometheus/Grafana track voucher volume and release quality.

state diagram

contribution split set

buyer applies voucher

validity ended

configured

active

redeemed

expired

Voucher lifecycle
06

Features

Discount
  • Co-funded voucher creation & validation
  • Platform/seller contribution split
  • Discount rule configuration
Operations
  • Voucher rollout & monitoring
  • Chip-In Ongoing (recurring) support
System
  • Database relationship design for co-funding
  • Logic architecture for the voucher lifecycle
  • New API contracts & enum fields
07

Tech Stack

language
Go
framework
RPCHTTP framework
database
Managed RDS
protocol
RPCHTTP
observability
PrometheusGrafana
08

Engineering Challenges

01
Modeling platform-vs-seller contribution splits

The discount had to be co-funded, so the split between platform and seller needed a clean, queryable model. Fix: a dedicated database relationship design that made contribution ratios and caps first-class rather than ad-hoc fields.

02
Halving dev time on the Chip-In Ongoing follow-up

The Ongoing variant reused most of the base flow but risked a full rebuild. Fix: a logic architecture designed for extension so the follow-up shipped in half a sprint instead of a full one.

03
Keeping quality high under a fast delivery

A fast timeline usually trades away quality. Fix: enforced high-quality coding practices and broad self-testing, resulting in only 7 bugs found before release and none after.

09

Outcomes

½
sprint dev-time (halved)
7→0
pre → post-release bugs
+2.24%
voucher volume MoM
10

Lessons Learned

Investing early in a clean database relationship design and an extensible logic architecture paid off directly: the Chip-In Ongoing follow-up shipped in half the time with minimal bugs (7 before release, none after). Owning a project end-to-end — design, quality, mentoring, and delivery — matters as much as the code itself.

11

Related Santekno Tutorials

Interested in working together?

Order, payment, or high-traffic event pipelines — let's talk architecture and trade-offs.