API Counterparties: различия между версиями

Материал из SmartSatu Knowledge Base
Перейти к навигации Перейти к поиску
(Created page with "==Обзор== Данный документа описывает методы для работы поставщика/дистрибьютора с системой Smart Sa...")
 
Строка 40: Строка 40:
 
===Параметры===
 
===Параметры===
 
====Ответы====
 
====Ответы====
 +
{| class="wikitable"
 +
! style="font-weight:bold;" | HTTP Code
 +
! style="font-weight:bold;" | Description
 +
! style="font-weight:bold;" | Schema
 +
|-
 +
| style="font-weight:bold;" | 200
 +
| Ok
 +
| [http://docs.smartsatu.com/wiki/API_Counterparties#Response_Counterparties Response Counterparties]
 +
|-
 +
| style="font-weight:bold;" | 401
 +
| Unauthorized
 +
| [http://docs.smartsatu.com/wiki/API_Counterparties#401 401]
 +
|}
  
 +
'''Принимаемые ресурсом типы MIME'''
 +
*application/json
 +
'''Возвращаемые ресурсом типы MIME'''
 +
*application/json
  
 
==Определения==
 
==Определения==
 
===Response Counterparties===
 
===Response Counterparties===
 +
'''200'''
 +
'''Items'''
 +
{| class="wikitable"
 +
! style="font-weight:bold;" | Name
 +
! style="font-weight:bold;" | Description
 +
! style="font-weight:bold;" | Schema
 +
! style="font-weight:bold;" | Example
 +
|-
 +
| style="font-weight:bold;" | id
 +
| Уникальный идентификатор
 +
| integer
 +
| 80
 +
|-
 +
| style="font-weight:bold;" | name
 +
| Название торговой точки
 +
| string
 +
| ИП "Чип и Дейл" | маг. "Рокфор"
 +
|-
 +
| style="font-weight:bold;" | address
 +
| Адрес торговой точки
 +
| string
 +
| Алматы, Байзакова, 125/185
 +
|-
 +
| style="font-weight:bold;" | conacts
 +
| Массив
 +
| <contacts> array
 +
|
 +
|-
 +
| style="font-weight:bold;" | type
 +
| Тип торговой точки
 +
| string
 +
| store
 +
|-
 +
| style="font-weight:bold;" | tin
 +
| ИНН торговой точки
 +
| string
 +
| 0123456789
 +
|}
 +
'''Contacts'''
 +
{| class="wikitable"
 +
! style="font-weight:bold;" | Name
 +
! style="font-weight:bold;" | Description
 +
! style="font-weight:bold;" | Schema
 +
! style="font-weight:bold;" | Example
 +
|-
 +
| style="font-weight:bold;" | phone
 +
| Номер телефона
 +
| string
 +
| 78000000001
 +
|-
 +
| style="font-weight:bold;" | person
 +
| Персона (Контактное лицо)
 +
| string
 +
| Гайка
 +
|-
 +
| style="font-weight:bold;" | ext
 +
| Дополнительный номер
 +
| string
 +
| 123
 +
|-
 +
| style="font-weight:bold;" | type
 +
| Тип контакта
 +
| string
 +
|
 +
|}
 +
{
 +
  "Items": [
 +
    {
 +
      "id": 80,
 +
      "name": "ИП \"Чип и Дейл\" | маг. \"Рокфор\"",
 +
      "address": "Алматы, Байзакова, 125/185",
 +
      "contacts": [
 +
        {
 +
          "phone": "78000000001",
 +
          "person": "Гайка",
 +
          "ext": "123",
 +
          "type": " "
 +
        }
 +
      ],
 +
      "type": "store",
 +
      "tin": "0123456789"
 +
    }
 +
  ]
 +
}
 
===401===
 
===401===
 +
{| class="wikitable"
 +
! style="font-weight:bold;" | Name
 +
! style="font-weight:bold;" | Description
 +
! style="font-weight:bold;" | Schema
 +
! style="font-weight:bold;" | Example
 +
|-
 +
| style="font-weight:bold;" | name
 +
| Название торговой точки
 +
| string
 +
| Unauthorized
 +
|-
 +
| style="font-weight:bold;" | message
 +
| Сообщение
 +
| string
 +
| Your request was made with invalid credentials
 +
|-
 +
| style="font-weight:bold;" | code
 +
| Код
 +
| integer($int32)
 +
| 0
 +
|-
 +
| style="font-weight:bold;" | status
 +
| Статус
 +
| integer($int32)
 +
| 401
 +
|-
 +
| style="font-weight:bold;" | type
 +
| Тип
 +
| string
 +
|
 +
|}
 +
{
 +
  "name": "Unauthorized",
 +
  "message": "Your request was made with invalid credentials.",
 +
  "code": 0,
 +
  "status": 401,
 +
  "type": "yii\\web\\UnauthorizedHttpException"
 +
}

Версия 01:11, 13 января 2020

Обзор

Данный документа описывает методы для работы поставщика/дистрибьютора с системой Smart Satu

Версия

Version: 1.0.0

Контактная информация

Contactinfo@smartsatu.com

URI схема

Host : //smartsatu.com/api/counterparties/  Schemes : HTTPS


Методы

Получение списка торговых точек

GET /counterparties 

Описание

Метод получение списка торговых точек

Безопасность

Type In Name Description
Authorization header required Для создания HTTP Basic Auth заголовка нужно преобразовать access_token следующим образом: $auth= "Basic " . base64encode(access_token . ":"); Данный токен должен использоваться в каждом запросе в системе.
country header required Параметр страны должен использоваться в каждом запросе в системе.

Параметры

Ответы

HTTP Code Description Schema
200 Ok Response Counterparties
401 Unauthorized 401

Принимаемые ресурсом типы MIME

  • application/json

Возвращаемые ресурсом типы MIME

  • application/json

Определения

Response Counterparties

200 Items

Name Description Schema Example
id Уникальный идентификатор integer 80
name Название торговой точки string маг. "Рокфор"
address Адрес торговой точки string Алматы, Байзакова, 125/185
conacts Массив <contacts> array
type Тип торговой точки string store
tin ИНН торговой точки string 0123456789

Contacts

Name Description Schema Example
phone Номер телефона string 78000000001
person Персона (Контактное лицо) string Гайка
ext Дополнительный номер string 123
type Тип контакта string
{
  "Items": [
    {
      "id": 80,
      "name": "ИП \"Чип и Дейл\" | маг. \"Рокфор\"",
      "address": "Алматы, Байзакова, 125/185",
      "contacts": [
        {
          "phone": "78000000001",
          "person": "Гайка",
          "ext": "123",
          "type": " "
        }
      ],
      "type": "store",
      "tin": "0123456789"
    }
  ]
}

401

Name Description Schema Example
name Название торговой точки string Unauthorized
message Сообщение string Your request was made with invalid credentials
code Код integer($int32) 0
status Статус integer($int32) 401
type Тип string
{
  "name": "Unauthorized",
  "message": "Your request was made with invalid credentials.",
  "code": 0,
  "status": 401,
  "type": "yii\\web\\UnauthorizedHttpException"
}