KatInterview

Partner Listing Onboarding Gateway: API and Pipeline Design

System DesignModel answer
HardModel answerSystem Designrest-apiidempotencyasync-processing

Last updated

Design an HTTP gateway through which third-party partners submit property listings, which are checked by an internal validation team's service, with safe retries, async results and observability.

Problem

Your platform wants to let outside partners (for example, property-management tools and channel managers) push listings into it programmatically. You are asked to design the partner-facing ingestion gateway.

Partners send create or update requests for listings. The gateway does not own business rules. Instead, it forwards each request to an internal validation and domain service run by a different team. Once that service has decided, the partner must be told the outcome.

Expect to be pushed hard on API detail and to be asked to draw (in text) the full request flow.

What the system must do

  • Accept create and update requests for listings over HTTP with JSON bodies.
  • Perform cheap checks at the edge: authentication, schema, payload size.
  • Hand the request to the internal validation service for business checks.
  • Give the partner one of three clear outcomes: accepted or created, rejected with a list of validation errors, or still in progress.
  • Make retries safe, so a repeated request never produces a duplicate listing.

Non-functional expectations

  • Handle high request volume from many partners, including a few very large ones.
  • Stay healthy when partners retry aggressively, and when the validation service is slow or down.
  • Provide metrics, logs, distributed tracing and an audit trail.

What to deliver

  1. An API design: endpoints, example request and response bodies, required headers, authentication and authorization approach, and the idempotency mechanism. List the HTTP status codes and when each is returned.
  2. A request flow from partner to final result (a text diagram is fine).
  3. Notes on scaling, reliability and the important edge cases.

State your own assumptions about traffic, payload size and downstream latency before you start.

Hints

Hint 1

Decide early whether the API is synchronous or asynchronous. If the validation service can take seconds or go down, what should the partner's first response look like, and how do they later learn the result?

Hint 2

There are two independent ways to stop duplicates: a natural business key (partner id plus the partner's own listing id) and a client-supplied idempotency key with a stored request hash. Work out what each one protects against and what should happen when a key is reused with a different body.

Hint 3

Think about the gap between 'write to my database' and 'send to the downstream system'. How do you avoid losing or double-sending a message, and how do you keep updates to the same listing in order?

Hint 4

Separate edge errors (HTTP status on the submit call) from business rejections (reported in the operation result). Decide which status codes belong to each.