Request
Before proceeding, ensure that you have your Location Provider ID (refer to Preparation).
Perform a POST
request to:
https://dmo.metapack.com/locations
of content type:
application/json
with the following authorisation (the token is copied from the access_token
field that is returned from Generating a Bearer Token):
Bearer <Bearer Token>
Note
The token must be within its TTL and associated with a can-create-locations permission.
The body should contain the fields shown in the following example:
{ "storeId": "001MKC", "storeName": "Milton Keynes", "supplementaryName": "Nice Store 1", "structuredAddress": { "street": "Elder Gate", "buildingName": "DODO Estate", "houseNumber": "202", "city": "Milton Keynes", "district": "Central Bletchley", "province": "Buckinghamshire", "postCode": "MK9 1GW", "countryCode": "GBR" }, "latitude": 52.043200, "longitude": -0.761790, "telephoneNumber": "+441908237494", "email": "mkstore@askjeeves.com", "logoUrl": "http://logo.metapack.com/testlogo.gif", "photoUrls": [ "http://logo.metapack.com/testlogo.gif", "http://logo.metapack.com/testlogo.gif" ], "hasDisabledAccess": true, "description": "Our Bletchley Store", "tags":[ "a", "b", "c" ], "locationProvider": { "id": "<Location Provider ID>" } }
The properties for the body fields are as follows:
Table 28. Body Field Properties
Field Name |
Mandatory? |
Type |
Length |
Example |
---|---|---|---|---|
|
Yes |
|
36 |
|
|
Yes |
|
128 |
|
|
No |
|
128 |
|
|
You only need to specify the structuredAddress fields immediately below if you are not specifying address, city, postCode and countryCode. |
object containing the structuredAddress fields below. |
||
|
Yes |
|
256 |
|
|
No |
|
64 |
|
|
No |
|
64 |
|
|
Yes |
|
64 |
|
|
No |
|
64 |
|
|
No |
|
64 |
|
|
Yes |
|
16 |
|
|
Yes |
|
16 |
|
|
Mandatory if you have not specified structuredAddress.city. |
|
64 |
|
|
Mandatory if you have not specified structuredAddress .postCode. |
|
16 |
|
|
Mandatory if you have not specified structuredAddress .countryCode. |
|
3 |
|
|
Mandatory if you have not specified the respective structuredAddress fields. |
|
256 |
|
|
Yes |
|
11,8 |
|
|
Yes |
|
11,8 |
|
|
No |
|
16 |
|
|
No |
Both the local and domain parts of the email address are limited to 63 characters. |
127 |
|
|
No |
URL |
128 |
|
|
No |
URL(s) (comma separated) |
512 |
|
|
No |
|
N/A |
|
|
No |
|
512 |
|
|
No |
|
N/A |
|
|
No |
map<string,translation ,string,translation> - up to 10 translations. The key for the map must be an ISO 639-1 two-letter code in lowercase. |
N/A |
|
|
Yes |
UUID of existing location provider (refer to Preparation). |
ID |
|
Response
The response from Delivery Options is in JSON format, and will be in the form of an HTTP 201 CREATED
response if the request is successful. For other possible responses, refer to What are the possible Server Responses?.
A successful response will return the location ID, for example:
{ "rel":"self", "href":"/locations/<Location ID>" }
-
Generating a Bearer Token
-
Creating a Store