Skip to main content
Version: 🚧 Canary

🛣️ Address routes

Address routes are SDK composers, not Express middleware. Mount them through the Address service.

Inventory

RouteMethod / protocolPathSchemaValidatorsSuccess status
findAddressRouteGET / HTTP/addressesfindAddressSchemaisAuthenticated()200

Details

findAddressRoute

Implementation

Endpoint: GET /addresses

Access: Authenticated by isAuthenticated().

Request: Required postalCode query parameter; see findAddressSchema.

Pipeline: Calls findAddress with context.findAddressDriver, query postalCode, and optional configuration.findAddressCache.

Success: 200 with the resolved address.

Failure: 404 when the postal code is not found; 500 for lookup service failure; authentication failures occur in validators first.

View complete source
export const findAddressRoute = withRoute({
handler: compose(
applyPayloadArgs(
findAddress,
[
['context', 'findAddressDriver'],
['params', 'requestQuery', 'postalCode'],
['context', 'configuration', 'findAddressCache'],
],
'address',
),
lift(
orThrow(
[
[AddressNotFoundError, 404],
[FindAddressServiceError, 500],
],
[['context', 'data', 'address']],
),
),
),
method: 'GET',
path: '/addresses',
validators: [isAuthenticated()],
});