Location APIs (2.0.0)

Download OpenAPI specification:Download

Location Support: support@fabric.inc URL: https://www.fabric.inc/ License: Fabric Inc

fabric's Location APIs provide high performance, multi-tenancy, and configurability to the end-to-end location lifecycle events.These location APIs are mapped with inventory.

Location

Location endpoints let you create, read, update, and delete location.

Get all locations

Retrieves a paginated list of all locations

Request
query Parameters
object (LocationSearchModel)
object (PaginationModel)

Pagination object represents the process of separating data into different pages

header Parameters
required
object (SiteContext)

JSON object containing channel, account, stage, and date.

Authorization
required
string

Authorization token or access token for the user

Example: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjYxZjIyMTU4...
Responses
200

Success

400

Client Error

404

Not Found

500

Internal Server Error

get/api/v2/location
Response samples
application/json
{
  • "locations": [
    ],
  • "pagination": {
    }
}

Create location

Creates a location with all of its details, such as location number, name, address, operating hours, operation type, location coordinates, and so on.

Request
header Parameters
required
object (SiteContext)

JSON object containing channel, account, stage, and date.

Authorization
required
string

Authorization token or access token for the user

Example: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjYxZjIyMTU4...
Request Body schema: application/json
attributes
object

Custom location attributes

locationNum
integer <int32>

Unique number to identify the location

name
string

Name of the location

isActive
boolean

true indicates location is active
false indicates location is inactive.

object (Address)

Location address details

type
string

Type of inventory location

Array of objects (OperatingHours)

Operating hours of the location

object (GeoJsonPoint)

coordinate details of the location in Geo Json format

Responses
200

Success

400

Client Error

404

Not Found

409

Either Location number or coordinates already exists

500

Internal Server Error

post/api/v2/location
Request samples
application/json
{
  • "attributes": {
    },
  • "locationNum": 13,
  • "name": "CA",
  • "isActive": true,
  • "address": {
    },
  • "type": "Warehouse",
  • "operatingHours": [
    ],
  • "coordinates": {
    }
}
Response samples
application/json
{
  • "attributes": {
    },
  • "id": "622fae9a065d9e62a4029f79",
  • "locationNum": 13,
  • "name": "CA",
  • "isActive": true,
  • "address": {
    },
  • "type": "warehouse",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "operatingHours": [
    ],
  • "coordinates": {
    }
}

Get specific location

Retrieves details of a specific location based on specified location number

Request
path Parameters
locationNum
required
number

Unique number to identify the location

Example: 13
header Parameters
required
object (SiteContext)

JSON object containing channel, account, stage, and date.

Authorization
required
string

Authorization token or access token for the user

Example: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjYxZjIyMTU4...
Responses
200

OK

400

Client Error

404

Not Found

500

Internal Server Error

get/api/v2/location/{locationNum}
Response samples
application/json
{
  • "attributes": {
    },
  • "id": "622fae9a065d9e62a4029f79",
  • "locationNum": 13,
  • "name": "CA",
  • "isActive": true,
  • "address": {
    },
  • "type": "warehouse",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "operatingHours": [
    ],
  • "coordinates": {
    }
}

Update location by overriding existing details

This endpoint updates details of a location by overriding the existing values with the details that are specified in the request body, or creates a location if location does not exist. If an existing property is not mentioned in the request body, then the value for the existing property will be displayed as null or zero. Location is identified based on the location number.

Request
path Parameters
locationNum
required
number

Unique number to identify the location

Example: 13
header Parameters
required
object (SiteContext)

JSON object containing channel, account, stage, and date.

Authorization
required
string

Authorization token or access token for the user

Example: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjYxZjIyMTU4...
Request Body schema: application/json
attributes
object

Custom location attributes

locationNum
integer <int32>

Unique number to identify the location

name
string

Name of the location

isActive
boolean

true indicates location is active
false indicates location is inactive.

object (Address)

Location address details

type
string

Type of inventory location

Array of objects (OperatingHours)

Operating hours of the location

object (GeoJsonPoint)

coordinate details of the location in Geo Json format

Responses
200

OK

400

Client Error

404

Not Found

500

Internal Server Error

put/api/v2/location/{locationNum}
Request samples
application/json
{
  • "attributes": {
    },
  • "locationNum": 13,
  • "name": "CA",
  • "isActive": true,
  • "address": {
    },
  • "type": "Warehouse",
  • "operatingHours": [
    ],
  • "coordinates": {
    }
}
Response samples
application/json
{
  • "attributes": {
    },
  • "id": "622fae9a065d9e62a4029f79",
  • "locationNum": 13,
  • "name": "CA",
  • "isActive": true,
  • "address": {
    },
  • "type": "warehouse",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "operatingHours": [
    ],
  • "coordinates": {
    }
}

Update location by adding new property

This endpoint does not override all the existing properties, rather it updates location by adding only those properties or by updating the existing location properties that are specified in the request body. Location is identified by the unique location number.

Request
path Parameters
locationNum
required
number

location number

Example: 13
header Parameters
required
object (SiteContext)

JSON object containing channel, account, stage, and date.

Authorization
required
string

Authorization token or access token for the user

Example: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjYxZjIyMTU4...
Request Body schema: application/json
attributes
object

Custom location attributes

locationNum
integer <int32>

Unique number to identify the location

name
string

Name of the location

isActive
boolean

true indicates location is active
false indicates location is inactive.

object (Address)

Location address details

type
string

Type of inventory location

Array of objects (OperatingHours)

Operating hours of the location

object (GeoJsonPoint)

coordinate details of the location in Geo Json format

Responses
200

Location Updated

400

Client Error

404

Not Found

500

Internal Server Error

patch/api/v2/location/{locationNum}
Request samples
application/json
{
  • "attributes": {
    },
  • "locationNum": 13,
  • "name": "CA",
  • "isActive": true,
  • "address": {
    },
  • "type": "Warehouse",
  • "operatingHours": [
    ],
  • "coordinates": {
    }
}
Response samples
application/json
{
  • "attributes": {
    },
  • "id": "622fae9a065d9e62a4029f79",
  • "locationNum": 13,
  • "name": "CA",
  • "isActive": true,
  • "address": {
    },
  • "type": "warehouse",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "operatingHours": [
    ],
  • "coordinates": {
    }
}

Delete specific location

Deletes a specific location based on specified location number

Request
path Parameters
locationNum
required
number

Location number

Example: 13
header Parameters
required
object (SiteContext)

JSON object containing channel, account, stage, and date.

Authorization
required
string

Authorization token or access token for the user

Example: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjYxZjIyMTU4...
Responses
200

Location Deleted

400

Client Error

404

Not Found

500

Internal Server Error

delete/api/v2/location/{locationNum}
Response samples
application/json
{
  • "attributes": {
    },
  • "id": "622fae9a065d9e62a4029f79",
  • "locationNum": 13,
  • "name": "CA",
  • "isActive": true,
  • "address": {
    },
  • "type": "warehouse",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "operatingHours": [
    ],
  • "coordinates": {
    }
}

Attribute

Location attribute endpoints let you create, read, update, and delete location attributes. These location attributes are used while creating or updating locations. When the attribute is configured as required, it is mandatory to add the attribute while creating location.

Create location attribute

Creates a unique location attribute

Request
header Parameters
required
object (SiteContext)

JSON object containing channel, account, stage, and date.

Authorization
required
string

Authorization token or access token for the user

Example: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjYxZjIyMTU4...
Request Body schema: application/json
code
string

Location attribute code

name
string

Location attribute name

description
string

Detailed description of the attribute

type
string

Data type of an attribute

Enum: "BOOLEAN" "INTEGER" "NUMBER" "STRING"
required
boolean

Flag to define the attribute as mandatory while creating location. If it's configured as true, this attribute is mandatory while creating location.

Responses
200

OK

400

Client Error

409

Conflict

500

Internal Server Error

post/api/v2/location/attribute
Request samples
application/json
{
  • "code": "isBopis",
  • "name": "isBopis",
  • "description": "To check the status of the BOPIS(Buy-Online-Pickup-In-Store)",
  • "type": "BOOLEAN",
  • "required": true
}
Response samples
application/json
{
  • "id": "622786ae0bdb19221a24fb61",
  • "code": "isBopis",
  • "name": "Is Bopis",
  • "description": "To check the status of the BOPIS (Buy-Online_Pickup-In-Store)",
  • "type": "BOOLEAN",
  • "required": true
}

Get all location attributes

Retrieves attributes for all the locations

Request
header Parameters
required
object (SiteContext)

JSON object containing channel, account, stage, and date.

Authorization
required
string

Authorization token or access token for the user

Example: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjYxZjIyMTU4...
Responses
200

OK

400

Client Error

409

Conflict

500

Internal Server Error

get/api/v2/location/attribute
Response samples
application/json
[
  • {
    }
]

Get location attribute by code

Retrieves details of the location attribute by attribute code

Request
path Parameters
code
required
string

Attribute code

Example: isBopis
header Parameters
required
object (SiteContext)

JSON object containing channel, account, stage, and date.

Authorization
required
string

Authorization token or access token for the user

Example: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjYxZjIyMTU4...
Responses
200

OK

400

Client Error

404

Not Found

500

Internal Server Error

get/api/v2/location/attribute/{code}
Response samples
application/json
{
  • "id": "622786ae0bdb19221a24fb61",
  • "code": "isBopis",
  • "name": "Is Bopis",
  • "description": "To check the status of the BOPIS (Buy-Online_Pickup-In-Store)",
  • "type": "BOOLEAN",
  • "required": true
}

Update location attribute by code

Updates the location attribute by attribute code

Request
path Parameters
code
required
string

Attribute code

Example: isBopis
header Parameters
required
object (SiteContext)

JSON object containing channel, account, stage, and date.

Authorization
required
string

Authorization token or access token for the user

Example: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjYxZjIyMTU4...
Request Body schema: application/json
code
string

Location attribute code

name
string

Location attribute name

description
string

Detailed description of the attribute

type
string

Data type of an attribute

Enum: "BOOLEAN" "INTEGER" "NUMBER" "STRING"
required
boolean

Flag to define the attribute as mandatory while creating location. If it's configured as true, this attribute is mandatory while creating location.

Responses
200

OK

400

Client Error

404

Not Found

500

Internal Server Error

put/api/v2/location/attribute/{code}
Request samples
application/json
{
  • "code": "isBopis",
  • "name": "isBopis",
  • "description": "To check the status of the BOPIS(Buy-Online-Pickup-In-Store)",
  • "type": "BOOLEAN",
  • "required": true
}
Response samples
application/json
{
  • "id": "622786ae0bdb19221a24fb61",
  • "code": "isBopis",
  • "name": "Is Bopis",
  • "description": "To check the status of the BOPIS (Buy-Online_Pickup-In-Store)",
  • "type": "BOOLEAN",
  • "required": true
}

Delete location attribute by code

deletes the location attribute by attribute code

Request
path Parameters
code
required
string

Attribute code

Example: isBopis
header Parameters
required
object (SiteContext)

JSON object containing channel, account, stage, and date.

Authorization
required
string

Authorization token or access token for the user

Example: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjYxZjIyMTU4...
Responses
200

OK

400

Client Error

404

Not Found

500

Internal Server Error

delete/api/v2/location/attribute/{code}
Response samples
application/json
{
  • "id": "622786ae0bdb19221a24fb61",
  • "code": "isBopis",
  • "name": "Is Bopis",
  • "description": "To check the status of the BOPIS (Buy-Online_Pickup-In-Store)",
  • "type": "BOOLEAN",
  • "required": true
}