Skip to content

Instantly share code, notes, and snippets.

@stepun
Last active November 21, 2018 14:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save stepun/cebc30d6c9bea65f3ec4 to your computer and use it in GitHub Desktop.
Save stepun/cebc30d6c9bea65f3ec4 to your computer and use it in GitHub Desktop.
API Stores

API Stores

Stores by id

Resource URL

https://storencash.com/api/v1_storage.json

Resource Information

  • Response formats JSON
  • Requires authentication? Yes

Parameters

Name Require Type Description
id yes int(10) default = null. Identifier store. Primary key.

Example Request

GET /api/v1_storage.json/101 HTTP/1.1
Host: storencash.com
token: 15da7169ee5272b97692ff680cab97f5
Cache-Control: no-cache
Content-Type: application/x-www-form-urlencoded

Example Result

{
  "status": "success",
  "data": {
    "model": {
      "id": 1,
      "store_name_full": "Основной склад",
      "store_name_short": "Основной склад",
      "ves": 1,
      "date": "2016-09-20",
      "time": "08:09:39",
      "store_description": "",
      "store_address": "123",
      "timestamp": 1474340979
    }
  }
}

List store

Resource URL

https://storencash.com/api/v1_storage.json

Resource Information

  • Response formats JSON
  • Requires authentication? Yes

Parameters

Name Require Type Description
timestamp no int(11) default = 0. Получить данные с данной даты (Time Stamp формат - количество миллисекунд с 1 января 1970 года. Необходим для получения обновленных данных).
page no int(10) default = 0. Page.
count no int(10) default = 1000. Count models in page. Limit max 1000 models in one request!

Example Request

GET /api/v1_storage.json?page=0&count=2&timestamp=1474247810 HTTP/1.1
Host: storencash.com
token: 15da7169ee5272b97692ff680cab97f5
Cache-Control: no-cache
Content-Type: application/x-www-form-urlencoded

Example Result

{
  "status": "success",
  "data": {
    "collection": [
      {
        "id": 1,
        "store_name_full": "Основной склад",
        "store_name_short": "Основной склад",
        "store_description": "",
        "date": "2016-09-20",
        "time": "08:09:39",
        "store_address": "123",
        "timestamp": 1474340979
      }
    ],
    "total": 1,
    "count": 1
  }
}

Add store

Resource URL

https://storencash.com/api/v1_storage.json

Resource Information

  • Response formats JSON
  • Requires authentication? Yes

Parameters

Name Require Type Description
store_name_full yes varchar(100) Название склада(магазина).
store_address no varchar(200) default = null. Адрес магазина

Example Request

POST /api/v1_storage.json HTTP/1.1
Host: storencash.com
token: 15da7169ee5272b97692ff680cab97f5
Cache-Control: no-cache
Content-Type: application/x-www-form-urlencoded

store_name_full=Магазин22

Example Result

{
  "status": "success",
  "data":{
    "id": 14
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment