Skip to content
Back to shipped records
Client: Internal / E-Commerce Logistics/Industry: Logistics Technology

Mulphilog SDK

We built a type-safe TypeScript client to handle raw responses and silent errors from Muller & Phipps shipping APIs.

Key OutcomeTypeScript

checks catch payload bugs before they compile.

Key OutcomeThe

library retries failed queries automatically, reducing checkout errors.

The Failure / Problem

System Bottlenecks

The Muller & Phipps Cash-on-Delivery shipping API is unpredictable. It lacks type schemas, returns inconsistent JSON shapes, and sends back HTTP 200 statuses even when a shipment fails with errors buried in text fields.

The Resolution / Solution

Architectural Move

We wrote `mulphilog`, a TypeScript SDK that wraps M&P endpoints. The client intercepts all HTTP responses, parses them for text errors, and converts them into explicit `Result<T, E>` models to avoid try-catch blocks.

Execution Path

1

Schema Mapping: We declared TypeScript interfaces for the undocumented M&P endpoints like tracking and booking.

2

Error Interceptor: We wrote a parser to inspect response bodies and capture errors hidden behind HTTP 200 status codes.

3

Result Wrappers: We implemented helper wrappers to handle success and failure branches without throwing exceptions.

"We integrated M&P tracking in under an hour. The library handles all the hidden API quirks automatically."

— Sachin Likhani, Lead E-Commerce Developer

Core Stack

  • TypeScript (Strict compilation mode)
  • ESM Module System
  • Node.js (>=20.0.0 compatibility)

Under-the-hood Challenge

Catching API errors that return HTTP 200 success codes. We solved this by writing a recursive inspector that scans response keys for strings like 'error', 'failed', or 'invalid' before validating the payload schema.

Mulphilog brings type safety to legacy corporate logistics. It abstracts inconsistent API endpoints into reliable TypeScript client calls, helping developers schedule Cash-on-Delivery shipments without writing custom error parsers.

Have a system that needs scaling?Initiate Brief