Facilities

For detailed information about all available endpoints, see the Facilities section in the REST API documentation.

Create a facility

To create a facility, make a POST request with a JSON body to the following endpoint. Note that the system does not validate the existence of the facility's address.

POST https://{YOUR-TENANT-NAME}.api.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 services, status, and locationType fields are optional. However, it is recommended to include the services object to enable the facility to ship orders.

A successful request returns a 201 Created response with a body similar to the following example:

{
    "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 requires valid geographic coordinates (latitude and longitude) for later use in the routing engine. If these coordinates are not provided in the address object, the fulfillmenttools system attempts to resolve them automatically based on the city center of the provided address.

To specify precise coordinates, add the resolvedCoordinates object to the address object:

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

The geodata used for the city center approximation is based on OpenDataSoft and is available under the CC BY 4.0 license.

Last updated