iotoms Docs

Create a customer store

POST
/api/v1/ops/customer-stores

Creates a new customer store, the shop or outlet that van-sales and distribution routes visit, and returns it with its new ID (HTTP 201). New stores are not linked to a customer account.

How to use it

  1. Send the shop's name, owner name and phone, address line 1, city, country and GPS latitude/longitude; other fields are optional.
  2. Keep the returned id: it identifies the store in routes, visits and store credit (as storeId).
  3. The new store is not linked to a customer account; link it with Partially update a customer store so it can be invoiced.

Authorization

BearerAuth
headerAuthorizationBearer <JWT>

Header Parameters

Request Body

application/json
  1. body
name*string

Name of the shop or outlet. Required, up to 150 characters.

ownerName*string

Name of the shop owner or main contact. Required, up to 100 characters.

ownerPhone*string

Owner's phone number. Required, up to 30 characters.

ownerEmail?|

Owner's email address. Optional.

addressLine1*string

First line of the shop's street address. Required, up to 200 characters.

addressLine2?|

Second address line. Optional.

city*string

City the shop is in. Required.

state?|

State, province or region. Optional.

postalCode?|

Postal or ZIP code. Optional, up to 20 characters.

country*string

Country the shop is in. Required.

latitude*number

GPS latitude of the shop in decimal degrees. Required.

Formatdouble
longitude*number

GPS longitude of the shop in decimal degrees. Required.

Formatdouble
creditLimit*number

Maximum credit allowed for this shop, in the merchant's currency (2 decimals). Defaults to 0.

executiveNotes?|

Free-text notes for sales staff about this shop. Optional.

status*string

ACTIVE (default), INACTIVE, ARCHIVED or DELETED. Lists show only ACTIVE stores unless you filter by status.

Value in"ACTIVE""INACTIVE""ARCHIVED""DELETED"

Response Body

OK

*/*
  1. response
status*string

Outcome of the call: SUCCESS when the request worked, ERROR when it did not.

message*string

Short human-readable message describing the result, for logs or display; do not parse it.

data?

The customer store as it is now stored.

Example Request
curl -X POST 'https://beta.iotoms.com/api/v1/ops/customer-stores' \  -H 'Content-Type: application/json' \  -d '{  "name": "string",  "ownerName": "string",  "ownerPhone": "string",  "addressLine1": "string",  "city": "string",  "country": "string",  "latitude": 0.1,  "longitude": 0.1,  "creditLimit": 0,  "status": "ACTIVE"}'
Example Response
{  "status": "string",  "message": "string",  "data": {    "id": 0,    "name": "string",    "ownerName": "string",    "ownerPhone": "string",    "ownerEmail": "string",    "addressLine1": "string",    "addressLine2": "string",    "city": "string",    "state": "string",    "postalCode": "string",    "country": "string",    "latitude": 0.1,    "longitude": 0.1,    "creditLimit": 0,    "customerNumber": "string",    "executiveNotes": "string",    "photoUrl": "string",    "status": "ACTIVE",    "modifiedTime": "2019-08-24T14:15:22Z"  }}