Ship from Store API
Ship from Store API
API Reference

Ship from Store API

Find the optimal stores to fulfill customer orders.

The Ship from Store API is currently in beta, and subject to change.

API basics

The API is available via this URL:

https://ship-from-store.near.st/v1/

All calls require a license key and will return a JSON response.

Endpoints

POSThttps://ship-from-store.near.st/v1/fulfillment-route

Find optimal stores to fulfill a customer order

Request Example

const response = await fetch(
  "https://ship-from-store.near.st/v1/fulfillment-route",
  {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      "X-License-Key": "your-license-key-here",
    },
    body: JSON.stringify({
      barcodes: ["1234567890123", "9876543210987", "5555666677778"],
      deliveryLocation: {
        postcode: "SW1A 1AA",
        country: "UK",
      },
      maxDistanceKm: 50,
      maxFulfillmentStores: 3,
    }),
  }
);
 
const data = await response.json();
console.log(data);

How it works

The Ship from Store API helps you find the optimal combination of stores to fulfill a customer's order:

  1. Location Resolution: Uses the customer's delivery location to determine the nearest stores
  2. Store Filtering: Finds all your organization's stores within the specified distance
  3. Stock Checking: Checks inventory availability for each requested barcode at each store
  4. Optimization: Determines the minimum number of stores needed to fulfill the order:
    • Prioritizes single stores that have all items, and are nearest to the customer
    • Falls back to multiple stores, ensuring the fewest number of stores are used

The response includes whether all items are available and the optimal fulfillment strategy.