A Base URL Without a Trailing Slash Can Drop the API Version Path

A relative endpoint is resolved against the base URL’s current directory. If a configured base ends in /v1 rather than /v1/, resolving stock can produce /stock and lose the version segment. Check the resulting pathname before making a request.
Verify the endpoint path separately from its host
For a Shopify 3PL adapter, a request can reach the intended host while using the wrong API path. In a drop shipping integration, that may mean a different resource or a rejected request. A shopify fulfillment connector should test its configured endpoint rather than treating a valid URL as proof of a correct resource.
MDN explains directory-based relative URL resolution. This example deliberately uses a fixed relative endpoint and an explicit directory-base contract.
Execute a local configuration check
Save as .cjs and run with Node.js. The reserved example.test addresses are parsed locally; no request or store connection is made.
'use strict'; const assert = require('node:assert/strict'); function stockEndpoint(baseText) { const base = new URL(baseText); if (base.protocol !== 'https:' || !base.pathname.endsWith('/') || base.search || base.hash || base.username || base.password) { throw TypeError('clean HTTPS directory base required'); } return new URL('stock', base).href; } assert.equal(new URL('stock', 'https://api.example.test/v1').pathname, '/stock'); assert.equal(new URL('stock', 'https://api.example.test/v1/').pathname, '/v1/stock'); assert.equal(stockEndpoint('https://api.example.test/v1/'), 'https://api.example.test/v1/stock'); assert.equal(stockEndpoint('https://api.example.test/'), 'https://api.example.test/stock'); assert.equal(stockEndpoint('https://api.example.test/a/v1/'), 'https://api.example.test/a/v1/stock'); for (const bad of ['https://api.example.test/v1', 'http://api.example.test/v1/', 'https://api.example.test/v1/?x=1', 'https://api.example.test/v1/#frag', 'https://name@api.example.test/v1/']) { assert.throws(() => stockEndpoint(bad), /directory base/); } assert.throws(() => stockEndpoint('/v1/'), TypeError); console.log('PASS: file-like base, directory base, root, nested path and rejected configuration'); The check rejects a file-like base instead of silently adding a slash. Query strings, fragments and embedded credentials are outside this example’s configuration contract. This is not a general endpoint allowlist or an SSRF defence: approve the actual host, route and authentication separately.
For china fulfillment software, a correct parsed path does not prove that a request is authorised or that an operation succeeded. A china 3PL account still needs its documented endpoint contract. The phrase “International Fulfillment for Folligen” is a search scenario here and establishes no verified customer relationship.
AI-generated learning example prepared for fulfillmentyx; final code executed locally. The real warehouse photo provides context and does not prove deployment or a live Shopify test.
Warehouse worktables, floor markings and handling containers.