Resource Representation

Example:
{
  "id": 1,
  "street_line_1": "41 Rawson Street",
  "street_line_2": "",
  "city": "Epping",
  "state_or_region": "NSW",
  "country_code": "AU",
  "post_code": "2121",
  "timezone": "",
  "latitude": null,
  "longitude": null,
  "name": "Location 1",
  "support_pickup": false,
  "ship_from_store": false,
  "code": "location_1",
  "external_code":"external_location_1",
  "phone": "+61280266800",
  "pickup_instructions": "",
  "website_url": "",
  "utc_offset": null,
  "discontinued": false,
  "business_hours": [
    {
      "id": 1,
      "day": "monday",
      "day_name": "Monday",
      "business_hour_type": "normal",
      "special_date": null,
      "closed": null,
      "day_value": 1,
      "open": "09:00:00",
      "close": "17:00:00"
    },
    {
      "id": 2,
      "day": "tuesday",
      "day_name": "Tuesday",
      "business_hour_type": "normal",
      "special_date": null,
      "closed": null,
      "day_value": 2,
      "open": "09:00:00",
      "close": "17:00:00"
    },
    {
      "id": 3,
      "day": "wednesday",
      "day_name": "Wednesday",
      "business_hour_type": "normal",
      "special_date": null,
      "closed": null,
      "day_value": 3,
      "open": "09:00:00",
      "close": "17:00:00"
    },
    {
      "id": 4,
      "day": "thursday",
      "day_name": "Thursday",
      "business_hour_type": "normal",
      "special_date": null,
      "closed": null,
      "day_value": 4,
      "open": "09:00:00",
      "close": "17:00:00"
    },
    {
      "id": 5,
      "day": "friday",
      "day_name": "Friday",
      "business_hour_type": "normal",
      "special_date": null,
      "closed": null,
      "day_value": 5,
      "open": "09:00:00",
      "close": "17:00:00"
    },
    {
      "id": 6,
      "day": "saturday",
      "day_name": "Saturday",
      "business_hour_type": "normal",
      "special_date": null,
      "closed": null,
      "day_value": 6,
      "open": "00:00:00",
      "close": "00:00:00"
    },
    {
      "id": 7,
      "day": "sunday",
      "day_name": "Sunday",
      "business_hour_type": "normal",
      "special_date": null,
      "closed": null,
      "day_value": 7,
      "open": "00:00:00",
      "close": "00:00:00"
    },
    {
      "id": 8,
      "day": null,
      "day_name": "Christmas Day",
      "business_hour_type": "special",
      "special_date": "2018-12-26T00:00:00.000+11:00",
      "closed": true,
      "day_value": null,
      "open": "00:00:00",
      "close": "00:00:00"
    }
  ],
  "inventory_sources": [
    {
      "id": 1,
      "name": "MOTUL"
    }
  ]
}

Supported Formats

json

GET /api/v2/inventory_locations
List inventory locations

Supported Formats

json

Errors

Code Description
401 Unauthorized. Include a WWW-Authenticate header field containing a challenge applicable to the requested resource.
403 Forbidden. The request was a valid request, but the server is refusing to respond to it. 403 error semantically means "unauthorized", i.e. the user does not have the necessary permissions for the resource.
404 Not Found. The requested resource could not be found.
422 Unprocessable Entity. The request was well-formed but was unable to be followed due to semantic errors.
500 Internal Server Error. An unexpected condition was encountered.

Examples

Response:
  {
    "page": 1,
    "per_page": 50,
    "total_pages": 1,
    "total_entries": 1,
    "entries": [
      {
        "id": 1,
        "street_line_1": "41 Rawson Street",
        "street_line_2": "",
        "city": "Epping",
        "state_or_region": "NSW",
        "country_code": "AU",
        "post_code": "2121",
        "timezone": "",
        "latitude": null,
        "longitude": null,
        "name": "Location 1",
        "support_pickup": false,
        "ship_from_store": false,
        "code": "location_1",
        "external_code":"external_location_1"
        "phone": "+61280266800",
        "pickup_instructions": "",
        "website_url": "",
        "utc_offset": null,
        "discontinued": false,
        "business_hours": [
          {
            "id": 1,
            "day": "monday",
            "day_name": "Monday",
            "business_hour_type": "normal",
            "special_date": null,
            "closed": null,
            "day_value": 1,
            "open": "09:00:00",
            "close": "17:00:00"
          },
          {
            "id": 2,
            "day": "tuesday",
            "day_name": "Tuesday",
            "business_hour_type": "normal",
            "special_date": null,
            "closed": null,
            "day_value": 2,
            "open": "09:00:00",
            "close": "17:00:00"
          },
          {
            "id": 3,
            "day": "wednesday",
            "day_name": "Wednesday",
            "business_hour_type": "normal",
            "special_date": null,
            "closed": null,
            "day_value": 3,
            "open": "09:00:00",
            "close": "17:00:00"
          },
          {
            "id": 4,
            "day": "thursday",
            "day_name": "Thursday",
            "business_hour_type": "normal",
            "special_date": null,
            "closed": null,
            "day_value": 4,
            "open": "09:00:00",
            "close": "17:00:00"
          },
          {
            "id": 5,
            "day": "friday",
            "day_name": "Friday",
            "business_hour_type": "normal",
            "special_date": null,
            "closed": null,
            "day_value": 5,
            "open": "09:00:00",
            "close": "17:00:00"
          },
          {
            "id": 6,
            "day": "saturday",
            "day_name": "Saturday",
            "business_hour_type": "normal",
            "special_date": null,
            "closed": null,
            "day_value": 6,
            "open": "00:00:00",
            "close": "00:00:00"
          },
          {
            "id": 7,
            "day": "sunday",
            "day_name": "Sunday",
            "business_hour_type": "normal",
            "special_date": null,
            "closed": null,
            "day_value": 7,
            "open": "00:00:00",
            "close": "00:00:00"
          },
          {
            "id": 8,
            "day": null,
            "day_name": "Christmas Day",
            "business_hour_type": "special",
            "special_date": "2018-12-25T00:00:00.000+11:00",
            "closed": true,
            "day_value": null,
            "open": "00:00:00",
            "close": "00:00:00"
          }
        ],
        "inventory_sources": [
          {
            "id": 1,
            "name": "MOTUL"
          }
        ]
      }
    ]
  }

Params

Param name Description
per_page
optional

Number of objects in one response. Default is 50

Validations:

  • Must be a number.

page
optional

Page number. Default is 1

Validations:

  • Must be a number.

created_time_from
optional

ISO_8601 format 2016-05-30T05:13:26Z

Validations:

  • Must be a String

created_time_to
optional

ISO_8601 format 2016-05-30T05:13:26Z

Validations:

  • Must be a String

updated_time_from
optional

ISO_8601 format 2016-05-30T05:13:26Z

Validations:

  • Must be a String

updated_time_to
optional

ISO_8601 format 2016-05-30T05:13:26Z

Validations:

  • Must be a String

id
optional

Entity ID

Validations:

  • Must be a String

identifier_name
optional

Extra identifier name added via EntityIdentifier endpoint

Validations:

  • Must be a String

entity_key
optional

Extra entity identifier key added via EntityIdentifier endpoint

Validations:

  • Must be a String

lang
optional

Language code for translated value

Validations:

  • Must be a String


POST /api/v2/inventory_locations
Create an inventory location

Supported Formats

json

Errors

Code Description
401 Unauthorized. Include a WWW-Authenticate header field containing a challenge applicable to the requested resource.
403 Forbidden. The request was a valid request, but the server is refusing to respond to it. 403 error semantically means "unauthorized", i.e. the user does not have the necessary permissions for the resource.
404 Not Found. The requested resource could not be found.
422 Unprocessable Entity. The request was well-formed but was unable to be followed due to semantic errors.
500 Internal Server Error. An unexpected condition was encountered.

Examples

request:
  {
      "inventory_location": {
          "name": "Location 2",
          "code": "location_2",
          "external_code":"external_location_2",
          "street_line_1": "1 First St",
          "city": "Sydney",
          "state_or_region": "NSW",
          "country_code": "AU",
          "post_code": "2000",
          "inventory_sources": [
              {
                  "name": "MOTUL"
              }
          ],
          "business_hours": [
              {
                  "day": "monday",
                  "day_name": "Monday",
                  "open_time": "09:00:00",
                  "close_time": "17:00:00"
              },
              {
                  "day": "tuesday",
                  "day_name": "Tuesday",
                  "open_time": "09:00:00",
                  "close_time": "17:00:00"
              },
              {
                  "day": "wednesday",
                  "day_name": "Wednesday",
                  "open_time": "09:00:00",
                  "close_time": "17:00:00"
              },
              {
                  "day": "thursday",
                  "day_name": "Thursday",
                  "open_time": "09:00:00",
                  "close_time": "17:00:00"
              },
              {
                  "day": "friday",
                  "day_name": "Friday",
                  "open_time": "09:00:00",
                  "close_time": "17:00:00"
              },
              {
                  "day": "saturday"
              },
              {
                  "day": "sunday"
              },
              {
                  "business_hour_type": "special",
                  "special_date": "2018-12-25T00:00:00.000+11:00",
                  "day_name": "Christmas Day",
                  "closed": true
              }
          ],
          "entity_identifiers": [
            {
              "key": "10000000001",
              "name": "Channel Name"
            },
            {
              "key": "20000000002",
              "name": "Channel Name"
            }
          ]
      }
  }

response:
  {
    "id": 3,
    "street_line_1": "1 First St",
    "street_line_2": null,
    "city": "Sydney",
    "state_or_region": "NSW",
    "country_code": "AU",
    "post_code": "2000",
    "timezone": null,
    "latitude": null,
    "longitude": null,
    "name": "Location 2",
    "support_pickup": null,
    "ship_from_store": null,
    "code": "location_2",
    "external_code":"external_location_2",
    "phone": null,
    "pickup_instructions": null,
    "website_url": null,
    "utc_offset": null,
    "discontinued": false,
    "business_hours": [
      {
        "id": 34,
        "day": "monday",
        "day_name": "Monday",
        "business_hour_type": "normal",
        "special_date": null,
        "closed": null,
        "day_value": 1,
        "open": "09:00:00",
        "close": "17:00:00"
      },
      {
        "id": 35,
        "day": "tuesday",
        "day_name": "Tuesday",
        "business_hour_type": "normal",
        "special_date": null,
        "closed": null,
        "day_value": 2,
        "open": "09:00:00",
        "close": "17:00:00"
      },
      {
        "id": 36,
        "day": "wednesday",
        "day_name": "Wednesday",
        "business_hour_type": "normal",
        "special_date": null,
        "closed": null,
        "day_value": 3,
        "open": "09:00:00",
        "close": "17:00:00"
      },
      {
        "id": 37,
        "day": "thursday",
        "day_name": "Thursday",
        "business_hour_type": "normal",
        "special_date": null,
        "closed": null,
        "day_value": 4,
        "open": "09:00:00",
        "close": "17:00:00"
      },
      {
        "id": 38,
        "day": "friday",
        "day_name": "Friday",
        "business_hour_type": "normal",
        "special_date": null,
        "closed": null,
        "day_value": 5,
        "open": "09:00:00",
        "close": "17:00:00"
      },
      {
        "id": 39,
        "day": "saturday",
        "day_name": "Saturday",
        "business_hour_type": "normal",
        "special_date": null,
        "closed": null,
        "day_value": 6,
        "open": "00:00:00",
        "close": "00:00:00"
      },
      {
        "id": 40,
        "day": "sunday",
        "day_name": "Sunday",
        "business_hour_type": "normal",
        "special_date": null,
        "closed": null,
        "day_value": 7,
        "open": "00:00:00",
        "close": "00:00:00"
      },
      {
        "id": 41,
        "day": null,
        "day_name": "Christmas Day",
        "business_hour_type": "special",
        "special_date": "2018-12-25T00:00:00.000+11:00",
        "closed": true,
        "day_value": null,
        "open": "00:00:00",
        "close": "00:00:00"
      }
    ],
    "inventory_sources": [
      {
        "id": 1,
        "name": "MOTUL"
      }
    ]
  }

Params

Param name Description
inventory_location
required

Validations:

  • Must be a Hash

inventory_location[name]
required

Name of the inventory location

Validations:

  • Must be a String

inventory_location[code]
required

Code of the inventory location

Validations:

  • Must be a String

inventory_location[external_code]
optional , nil allowed

External code of the inventory location

Validations:

  • Must be a String

inventory_location[status]
optional , nil allowed

Status of the inventory location

Validations:

  • Must be one of: active, inactive.

inventory_location[street_line_1]
required

Validations:

  • Must be a String

inventory_location[street_line_2]
optional , nil allowed

Validations:

  • Must be a String

inventory_location[city]
required

Validations:

  • Must be a String

inventory_location[state_or_region]
optional , nil allowed

Validations:

  • Must be a String

inventory_location[country_code]
required

Validations:

  • Must be a String

inventory_location[post_code]
required

Validations:

  • Must be a String

inventory_location[timezone]
optional , nil allowed

Validations:

  • Must be a String

inventory_location[longitude]
optional , nil allowed

Validations:

  • Must be a Numeric

inventory_location[pickup_instructions]
optional , nil allowed

Validations:

  • Must be a String

inventory_location[website_url]
optional , nil allowed

Validations:

  • Must be a String

inventory_location[support_pickup]
optional , nil allowed

Validations:

  • Must be one of: true, false, 1, 0.

inventory_location[ship_from_store]
optional , nil allowed

Validations:

  • Must be one of: true, false, 1, 0.

inventory_location[tag_list]
optional , nil allowed

List of tags for this inventory location

Validations:

  • Must be an array of String

inventory_location[inventory_source_ids]
optional , nil allowed

List of inventory source IDs that the inventory location belongs to. Do not provide if ‘inventory_sources’ is provided

Validations:

  • Must be an array of Integer

inventory_location[inventory_sources]
optional

List of inventory sources that the inventory location belongs to. Do not provide if ‘product_level_ids’ is provided

Validations:

  • Must be an Array of nested elements

inventory_location[inventory_sources][name]
required

Name of the inventory source

Validations:

  • Must be a String

inventory_location[inventory_sources][delete]
optional

Remove this inventory location from the associations

Validations:

  • Must be one of: true, false, 1, 0.

inventory_location[business_hours]
optional

List of business hours that the inventory location has

Validations:

  • Must be an Array of nested elements

inventory_location[business_hours][day]
optional

Validations:

  • Must be one of: monday, tuesday, wednesday, thursday, friday, saturday, sunday.

inventory_location[business_hours][day_name]
optional

Validations:

  • Must be a String

inventory_location[business_hours][business_hour_type]
optional

Validations:

  • Must be one of: normal, special.

inventory_location[business_hours][special_date]
optional

Valid special_date. ISO_8601 format 2016-05-30T05:13:26Z.

Validations:

  • Must be a String

inventory_location[business_hours][closed]
optional

Validations:

  • Must be one of: true, false, 1, 0.

inventory_location[business_hours][open_time]
optional

Don’t supply value if it is not open on this day. E.g. ‘09:00:00’

Validations:

  • Must be a String

inventory_location[business_hours][close_time]
optional

Don’t supply value if it is not open on this day. E.g. ‘17:00:00’

Validations:

  • Must be a String


PUT /api/v2/inventory_locations/:id
Update an inventory location

Supported Formats

json

Errors

Code Description
401 Unauthorized. Include a WWW-Authenticate header field containing a challenge applicable to the requested resource.
403 Forbidden. The request was a valid request, but the server is refusing to respond to it. 403 error semantically means "unauthorized", i.e. the user does not have the necessary permissions for the resource.
404 Not Found. The requested resource could not be found.
422 Unprocessable Entity. The request was well-formed but was unable to be followed due to semantic errors.
500 Internal Server Error. An unexpected condition was encountered.

Examples

request:
  {
      "inventory_location": {
          "name": "Location 2 Updated",
          "business_hours": [
              {
                  "day": "monday",
                  "day_name": "Monday",
                  "open_time": "09:00:00",
                  "close_time": "18:00:00"
              },
              {
                  "special_date": "2018-12-15T00:00:00.000+11:00",
                  "day_name": "Christmas Day 1"
              }
          ]
      }
  }

response:
  {
    "id": 3,
    "street_line_1": "1 First St",
    "street_line_2": null,
    "city": "Sydney",
    "state_or_region": "NSW",
    "country_code": "AU",
    "post_code": "2000",
    "timezone": null,
    "latitude": null,
    "longitude": null,
    "name": "Location 2 Updated",
    "support_pickup": null,
    "ship_from_store": null,
    "code": "location_2",
    "external_code":"external_location_2",
    "phone": null,
    "pickup_instructions": null,
    "website_url": null,
    "utc_offset": null,
    "discontinued": false,
    "business_hours": [
      {
        "id": 34,
        "day": "monday",
        "day_name": "Monday",
        "business_hour_type": "normal",
        "special_date": null,
        "closed": null,
        "day_value": 1,
        "open": "09:00:00",
        "close": "18:00:00"
      },
      {
        "id": 35,
        "day": "tuesday",
        "day_name": "Tuesday",
        "business_hour_type": "normal",
        "special_date": null,
        "closed": null,
        "day_value": 2,
        "open": "09:00:00",
        "close": "17:00:00"
      },
      {
        "id": 36,
        "day": "wednesday",
        "day_name": "Wednesday",
        "business_hour_type": "normal",
        "special_date": null,
        "closed": null,
        "day_value": 3,
        "open": "09:00:00",
        "close": "17:00:00"
      },
      {
        "id": 37,
        "day": "thursday",
        "day_name": "Thursday",
        "business_hour_type": "normal",
        "special_date": null,
        "closed": null,
        "day_value": 4,
        "open": "09:00:00",
        "close": "17:00:00"
      },
      {
        "id": 38,
        "day": "friday",
        "day_name": "Friday",
        "business_hour_type": "normal",
        "special_date": null,
        "closed": null,
        "day_value": 5,
        "open": "09:00:00",
        "close": "17:00:00"
      },
      {
        "id": 39,
        "day": "saturday",
        "day_name": "Saturday",
        "business_hour_type": "normal",
        "special_date": null,
        "closed": null,
        "day_value": 6,
        "open": "00:00:00",
        "close": "00:00:00"
      },
      {
        "id": 40,
        "day": "sunday",
        "day_name": "Sunday",
        "business_hour_type": "normal",
        "special_date": null,
        "closed": null,
        "day_value": 7,
        "open": "00:00:00",
        "close": "00:00:00"
      },
      {
        "id": 41,
        "day": null,
        "day_name": "Christmas Day 1",
        "business_hour_type": "special",
        "special_date": "2018-12-25T00:00:00.000+11:00",
        "closed": true,
        "day_value": null,
        "open": "00:00:00",
        "close": "00:00:00"
      }
    ],
    "inventory_sources": [
      {
        "id": 1,
        "name": "MOTUL"
      }
    ]
  }

Params

Param name Description
inventory_location
required

Validations:

  • Must be a Hash

inventory_location[name]
optional

Name of the inventory location

Validations:

  • Must be a String

inventory_location[code]
optional

Code of the inventory location

Validations:

  • Must be a String

inventory_location[external_code]
optional , nil allowed

External code of the inventory location

Validations:

  • Must be a String

inventory_location[status]
optional , nil allowed

Status of the inventory location

Validations:

  • Must be one of: active, inactive.

inventory_location[street_line_1]
optional

Validations:

  • Must be a String

inventory_location[street_line_2]
optional , nil allowed

Validations:

  • Must be a String

inventory_location[city]
optional

Validations:

  • Must be a String

inventory_location[state_or_region]
optional , nil allowed

Validations:

  • Must be a String

inventory_location[country_code]
optional

Validations:

  • Must be a String

inventory_location[post_code]
optional

Validations:

  • Must be a String

inventory_location[timezone]
optional , nil allowed

Validations:

  • Must be a String

inventory_location[longitude]
optional , nil allowed

Validations:

  • Must be a Numeric

inventory_location[pickup_instructions]
optional , nil allowed

Validations:

  • Must be a String

inventory_location[website_url]
optional , nil allowed

Validations:

  • Must be a String

inventory_location[support_pickup]
optional , nil allowed

Validations:

  • Must be one of: true, false, 1, 0.

inventory_location[ship_from_store]
optional , nil allowed

Validations:

  • Must be one of: true, false, 1, 0.

inventory_location[tag_list]
optional , nil allowed

List of tags for this inventory location

Validations:

  • Must be an array of String

inventory_location[inventory_source_ids]
optional , nil allowed

List of inventory source IDs that the inventory location belongs to. Do not provide if ‘inventory_sources’ is provided

Validations:

  • Must be an array of Integer

inventory_location[inventory_sources]
optional

List of inventory sources that the inventory location belongs to. Do not provide if ‘product_level_ids’ is provided

Validations:

  • Must be an Array of nested elements

inventory_location[inventory_sources][name]
required

Name of the inventory source

Validations:

  • Must be a String

inventory_location[inventory_sources][delete]
optional

Remove this inventory location from the associations

Validations:

  • Must be one of: true, false, 1, 0.

inventory_location[business_hours]
optional

List of business hours that the inventory location has

Validations:

  • Must be an Array of nested elements

inventory_location[business_hours][day]
optional

Validations:

  • Must be one of: monday, tuesday, wednesday, thursday, friday, saturday, sunday.

inventory_location[business_hours][day_name]
optional

Validations:

  • Must be a String

inventory_location[business_hours][business_hour_type]
optional

Validations:

  • Must be one of: normal, special.

inventory_location[business_hours][special_date]
optional

Valid special_date. ISO_8601 format 2016-05-30T05:13:26Z.

Validations:

  • Must be a String

inventory_location[business_hours][closed]
optional

Validations:

  • Must be one of: true, false, 1, 0.

inventory_location[business_hours][open_time]
optional

Don’t supply value if it is not open on this day. E.g. ‘09:00:00’

Validations:

  • Must be a String

inventory_location[business_hours][close_time]
optional

Don’t supply value if it is not open on this day. E.g. ‘17:00:00’

Validations:

  • Must be a String


DELETE /api/v2/inventory_locations/:id
Delete an inventory location

Supported Formats

json

Errors

Code Description
401 Unauthorized. Include a WWW-Authenticate header field containing a challenge applicable to the requested resource.
403 Forbidden. The request was a valid request, but the server is refusing to respond to it. 403 error semantically means "unauthorized", i.e. the user does not have the necessary permissions for the resource.
404 Not Found. The requested resource could not be found.
422 Unprocessable Entity. The request was well-formed but was unable to be followed due to semantic errors.
500 Internal Server Error. An unexpected condition was encountered.

Examples

response:
  {
    "id": 3
  }