Facilities

More Facilities-API information can be found here: REST API documentation - Facilities

Create a facility

To add the facility, do the following POST call with the JSON body (please note, there is no check whether the facility's address exists):

POST https://{YOUR-TENANT-NAME}.fulfillmenttools.com/api/facilities
{
    "name": "Bills Candy Shop",
    "address": {
        "companyName": "Bills Candy Shop Ltd.",
        "country": "DE",
        "postalCode": "81669",
        "city": "München",
        "street": "Lilienstr.",
        "houseNumber": "58"
    },
    "services": [
        {
            "type": "SHIP_FROM_STORE"
        }
    ],
    "status": "ONLINE",
    "locationType": "STORE"
}

The fields services, status and locationType are not required, but we highly recommend adding at least the services section, as this enables the store to ship orders.

If the request is successful, we receive a 201 CREATED response with a body like this:

{
    "name": "Bills Candy Shop",
    "address": {
        "companyName": "Bills Candy Shop Ltd.",
        "country": "DE",
        "postalCode": "81669",
        "city": "München",
        "street": "Lilienstr.",
        "houseNumber": "58"
    },
    "services": [
        {
            "type": "SHIP_FROM_STORE"
        }
    ],
    "status": "ONLINE",
    "locationType": "STORE",
    "fulfillmentProcessBuffer": 240,
    "capacityEnabled": false,
    "created": "2023-08-22T14:39:27.014Z",
    "lastModified": "2023-08-22T14:39:27.014Z",
    "version": 1,
    "id": "0dee02e8-f6a7-4080-b5ab-ffa477132f35"
}

Add precise latitude & longitude

Each facility needs valid geo coordinates (latitude and longitude) for later use in the routing engine. If they are missing in the address object, the fulfillmenttools system will try to resolve them based on the address (city center) that was provided.

If precise coordinates are needed, adding it to the address object like this:

{
    // Facility object
    ...
    "address": {
        ...
        "resolvedCoordinates": {
            "lat": 50.937531,
            "lon": 6.960279
        }
    }
}

City center approach geo data used is based on opendatasoft under the CC BY 4.0 license.

Last updated