Pular para o conteúdo
#0703
Exec

The partner's API is your API with three fields missing

A logistics partner needs read access to your orders API. They should not see customer emails, internal margins, or the notes field. The traditional answer is a second API: built, documented, maintained, drifting.

Instead: a hook matched on the partner's API-key header. It fetches the real response from the real API, deletes three fields, and returns the rest. Your API is unchanged and doesn't know the partner exists. The partner consumes an API that was never written: yours, filtered in transit, per caller.

When the partnership ends, you delete the hook. There is no second codebase to decommission.

The partner's API is your API with three fields missing.