Calls to the API must be for genuine use and responses from the API must not be stored for the purpose of creating an offline copy of the information stored. Failure to comply with this requirement will infringe the API License.
Store API Calls
Create Store
POST /business-units/{businessUnitId}/stores
Purpose
To create a store within a business unit. The business unit must already exist on your account.
Inputs
- businessUnitId - The store's parent businessUnitId. This must be a valid ID of a business unit already registed to you. This must be part of the URL and not included in the body.
- reportName - Used to identify the store on any reports we generate for you.
- legalName - OPTIONAL - The store's legal name (will be assumed to be as the parent business unit but in the case of franchise stores, the store may be a different legal entity to the parent business unit).
- city - OPTIONAL - The store's postal city.
- county - OPTIONAL - The store's postal county. Optional if the city is not part of a county. For Example, an address in Washington DC will not have a county.
- state - OPTIONAL - The store's postal state.
- zipcode - OPTIONAL - The store's zip/post code.
- country - OPTIONAL - The store's country.
- email - OPTIONAL - The store's contact email address.
- type - OPTIONAL - Valid values are: live or test. In most scenarios, a test store will not hit production data so a test store should only be used for pre-defined test scenarios. The default value is live.
Example Request
POST /business-units/68/stores HTTP/1.1
Accept: application/json
Content-Type: application/json
{
"legalName": "Amce Traders Ltd.",
"reportName": "Amce Traders",
"city": "Cirencester",
"county": "Gloucestershire",
"state": "-",
"zipcode": "GL7 1LF",
"country": "United Kingdom",
"email": "email@example.com",
"type": "live"
}
Output
A unique store ID. In the event of an error the storeid will not be returned. Instead, a JSON object containing an errors array will be returned.
Example Responses
Response on Success:HTTP/1.1 201 Created Content-Type: application/json Location: stores/64791 { "id": 64791, "legalName": "Amce Traders Inc.", "reportName": "Amce Traders", "city": "Cirencester", "county": "Gloucestershire", "state": "-", "zipcode": "GL7 1LF", "country": "United Kingdom", "type": "test", "businessUnitId": 1, "status": "activated" }
Response on Error:HTTP/1.1 400 Human readable error message Content-Type: application/json { "errors": [ { "id": n, "message": "Human readable message" } ] }