createLocation
post
/ccadmin/v1/locations
Create Location. Create a location.
Request
Supported Media Types
- application/json
Body Parameter
Root Schema : createLocation_request
{
"country":"USA",
"hours":"9:00am - 5:00pm",
"address3":null,
"endDate":"2017-04-25",
"address2":"Suite 101",
"city":"Glen Allen",
"address1":"4870 Sadler Rd.",
"latitude":37.6659833,
"postalCode":"23060",
"county":"Henrico",
"stateAddress":"VA",
"sites":[
{
"id":"siteUS"
},
{
"id":"siteCA"
}
],
"type":"store",
"externalLocationId":"187",
"phoneNumber":"(617) 386-1200",
"siteGroups":[
{
"id":"siteGroup1"
},
{
"id":"siteGroup2"
}
],
"locationId":"CRSHome-GlenAllen187",
"name":"CRS Home - Glen Allen #187",
"faxNumber":"(617) 386-1200",
"startDate":"2016-04-25",
"email":"store187@example.com",
"longitude":-77.5063697
}
- address1
-
Type:
string
The first address field of the location. - address2
-
Type:
string
The second address field of the location. - address3
-
Type:
string
The third address field of the location. - city
-
Type:
string
The city of the location. - country
-
Type:
string
The country of the location. - county
-
Type:
string
The county of the location. -
Type:
string
The email address of the location. - endDate
-
Type:
string
The end date for the location in the form of 'yyyy-MM-dd'. This is used when performing a search for inventory available from a store during a specific date range. If the search contains a specific date range, only locations that have a date that are contained within that date range will be displayed. - externalLocationId
-
Type:
string
An optional additional location ID, such as the merchant store ID. Use this if you have extra parameters for identifying your stores or locations. - faxNumber
-
Type:
string
The fax number of the location. - hours
-
Type:
string
The store opening hours. Only applicable to location type 'store'. - latitude
-
Type:
number
The latitude of the location. - locationId
-
Type:
string
The unique ID of the location. This ID will be generated if none is provided. - longitude
-
Type:
number
The longitude of the location. - name
-
Type:
string
Required:true
The name of the location. - phoneNumber
-
Type:
string
The phone number of the location. - postalCode
-
Type:
string
The postal code of the location. - siteGroups
-
Type:
array
siteGroupsAdditional Properties Allowed:List of site groups. A location can be constrained to a list of site groups. If no site group is defined, the location is available on all sites. - sites
-
Type:
array
sitesAdditional Properties Allowed:List of sites. A location can be constrained to a list of sites. If no site is defined, the location is available on all sites. - startDate
-
Type:
string
The start date for the location in the form of 'yyyy-MM-dd'. This is used when performing a search for inventory available from a store during a specific date range. If the search contains a specific date range, only locations that have a date that are contained within that date range will be displayed. - stateAddress
-
Type:
string
The state of the location. - type
-
Type:
string
The type of location, either 'location' (default) or 'store'.
Nested Schema : siteGroups
Nested Schema : sites
Nested Schema : items
Type:
object
- id
-
Type:
string
The site group ID to associate this location with. The site group must already exist.
Nested Schema : items
Type:
object
- id
-
Type:
string
The site ID to associate this location with. The site must already exist.
Response
Supported Media Types
- application/json
200 Response
Following model is returned when operation succeeds.
Body
Root Schema : createLocation_response
- address1
-
Type:
string
The first address field of the location. - address2
-
Type:
string
The second address field of the location. - address3
-
Type:
string
The third address field of the location. - city
-
Type:
string
The city of the location. - country
-
Type:
string
The country of the location. - county
-
Type:
string
The county of the location. - distance
-
Type:
number
A session-scoped property that contains the distance when searching for location items. Not applicable. -
Type:
string
The email address of the location. - endDate
-
Type:
string
The end date for the location. This is used when performing a search for inventory available from a store during a specific date range. If the search contains a specific date range, only locations that have a date that are contained within that date range will be displayed. - externalLocationId
-
Type:
string
An optional additional location ID, such as the merchant store ID. Use this if you have extra parameters for identifying your stores or locations. - faxNumber
-
Type:
string
The fax number of the location. - hours
-
Type:
string
The store opening hours. Only applicable to location type 'store'. - latitude
-
Type:
number
The latitude of the location. - locationId
-
Type:
string
The ID of the location. This ID will be generated if none is provided. - longitude
-
Type:
number
The longitude of the location. - name
-
Type:
string
The name of the location. - phoneNumber
-
Type:
string
The phone number of the location. - postalCode
-
Type:
string
The postal code of the location. - repositoryId
-
Type:
string
The ID of the location repository item. - siteGroups
-
Type:
array
siteGroupsAdditional Properties Allowed:List of site groups. A location can be constrained to a list of site groups. If no site group is defined, the location is available on all sites. - sites
-
Type:
array
sitesAdditional Properties Allowed:List of sites. A location can be constrained to a list of sites. If no site is defined, the location is available on all sites. - startDate
-
Type:
string
The start date for the location. This is used when performing a search for inventory available from a store during a specific date range. If the search contains a specific date range, only locations that have a date that are contained within that date range will be displayed. - stateAddress
-
Type:
string
The state of the location. - type
-
Type:
string
The type of location, either 'location' or 'store'.
Nested Schema : siteGroups
Nested Schema : sites
Nested Schema : items
Type:
object
- repositoryId
-
Type:
string
The site group ID associated with this location.
Nested Schema : items
Type:
object
- repositoryId
-
Type:
string
The site ID associated with this location.
Example application/json
{
"country":"USA",
"distance":null,
"endDate":"2017-04-25T00:00:00.000Z",
"city":"Glen Allen",
"latitude":37.6659833,
"postalCode":"23060",
"county":"Henrico",
"stateAddress":"VA",
"sites":[
{
"repositoryId":"siteUS"
},
{
"repositoryId":"siteCA"
}
],
"type":"store",
"locationId":"CRSHome-GlenAllen187",
"links":[
{
"rel":"self",
"href":"https://www.example.com/ccadminui/v1/locations"
}
],
"email":"store187@example.com",
"longitude":-77.5063697,
"hours":"9:00am - 5:00pm",
"address3":null,
"address2":"Suite 101",
"address1":"4870 Sadler Rd.",
"externalLocationId":"187",
"phoneNumber":"(617) 386-1200",
"siteGroups":[
{
"repositoryId":"siteGroup1"
},
{
"repositoryId":"siteGroup2"
}
],
"repositoryId":"4000345",
"name":"CRS Home - Glen Allen #187",
"faxNumber":"(617) 386-1200",
"startDate":"2016-04-25T00:00:00.000Z"
}
Default Response
The error response.
The following are the internal error codes thrown by this API when the request processing fails in Oracle Commerce Cloud:
|Error Code|Description|
|------------------|------------------|
|51120|Location id string value required.|
|51111|Failed to create location.|
|51110|An internal error occurred while processing the request to create location.|
|51113|Location record already exists.|
|51112|No properties passed in to create location.|
|51115|Invalid location site property.|
|51114|Invalid location type, must be 'store' or 'location'.|
|51117|Invalid location date property (endDate and/or startDate).|
|51116|Invalid location site group property.|
|51119|Location name string value required.|
|51118|Invalid location coordinate property (latitude and/or longitude).|
Body
Root Schema : errorModel
Type:
object
- devMessage
-
Type:
string
An optional non-localized message containing technical information for developers - errorCode
-
Type:
string
The numerical code identifying the error - errors
-
Type:
array
errorsAdditional Properties Allowed:An optional list of errors if multiple errors were encountered - message
-
Type:
string
The localized message describing the error - moreInfo
-
Type:
string
An optional non-localized message with more information - o:errorPath
-
Type:
string
An optional machine readable description of where the error occurred - status
-
Type:
string
The HTTP status code - type
-
Type:
string
The URI to the HTTP state code definition
Nested Schema : errors
Nested Schema : items
Type:
object
- devMessage
-
Type:
string
An optional non-localized message containing technical information for developers - errorCode
-
Type:
string
The numerical code identifying the error - message
-
Type:
string
The localized message describing the error - moreInfo
-
Type:
string
An optional non-localized message with more information - o:errorPath
-
Type:
string
An optional machine readable description of where the error occurred - status
-
Type:
string
The HTTP status code
Examples
Sample Request:
{ "country": "USA", "hours": "9:00am - 5:00pm", "address3": null, "endDate": "2017-04-25", "address2": "Suite 101", "city": "Glen Allen", "address1": "4870 Sadler Rd.", "latitude": 37.6659833, "postalCode": "23060", "county": "Henrico", "stateAddress": "VA", "sites": [ {"id": "siteUS"}, {"id": "siteCA"} ], "type": "store", "externalLocationId": "187", "phoneNumber": "(617) 386-1200", "siteGroups": [ {"id": "siteGroup1"}, {"id": "siteGroup2"} ], "locationId": "CRSHome-GlenAllen187", "name": "CRS Home - Glen Allen #187", "faxNumber": "(617) 386-1200", "startDate": "2016-04-25", "email": "store187@example.com", "longitude": -77.5063697 }
Sample Response Payload returned by endpoint:
{ "country": "USA", "distance": null, "endDate": "2017-04-25T00:00:00.000Z", "city": "Glen Allen", "latitude": 37.6659833, "postalCode": "23060", "county": "Henrico", "stateAddress": "VA", "sites": [ {"repositoryId": "siteUS"}, {"repositoryId": "siteCA"} ], "type": "store", "locationId": "CRSHome-GlenAllen187", "links": [{ "rel": "self", "href": "https://www.example.com/ccadminui/v1/locations" }], "email": "store187@example.com", "longitude": -77.5063697, "hours": "9:00am - 5:00pm", "address3": null, "address2": "Suite 101", "address1": "4870 Sadler Rd.", "externalLocationId": "187", "phoneNumber": "(617) 386-1200", "siteGroups": [ {"repositoryId": "siteGroup1"}, {"repositoryId": "siteGroup2"} ], "repositoryId": "4000345", "name": "CRS Home - Glen Allen #187", "faxNumber": "(617) 386-1200", "startDate": "2016-04-25T00:00:00.000Z" }