LegalStack

Сопоставление сущностей

Сопоставление внешних и внутренних сущностей.

Получить маппинги полей для типа сущности

GET
/api/v1/integrations/entity-mapping/mappings/{entityType}
АвторизацияBearer <токен>

В: header

Параметры пути

entityType*string

Канонический тип сущности, например counterparty

Параметры запроса

provider?string

Провайдер: moysklad, 1c или saby

Тело ответа

application/json

application/problem+json

curl -X GET "https://loading/api/v1/integrations/entity-mapping/mappings/string"
{
  "property1": [
    {
      "property1": null,
      "property2": null
    }
  ],
  "property2": [
    {
      "property1": null,
      "property2": null
    }
  ]
}
{
  "code": "string",
  "detail": "string",
  "errors": [
    {
      "name": "string",
      "pointer": "string",
      "reason": "string",
      "rule": "string"
    }
  ],
  "instance": "string",
  "request_id": "string",
  "status": 0,
  "title": "string",
  "trace_id": "string",
  "type": "http://example.com",
  "property1": null,
  "property2": null
}

Обновить маппинги полей

PUT
/api/v1/integrations/entity-mapping/mappings/{entityType}
АвторизацияBearer <токен>

В: header

Параметры пути

entityType*string

Канонический тип сущности, например counterparty

Тело запроса

application/json

TypeScript-определения

Используйте тип request body в TypeScript.

Тело ответа

application/json

application/problem+json

curl -X PUT "https://loading/api/v1/integrations/entity-mapping/mappings/string" \  -H "Content-Type: application/json" \  -d '{    "mappings": [      {        "canonicalField": "string",        "providerField": "string"      }    ],    "provider": "string"  }'
{
  "success": true
}
{
  "code": "string",
  "detail": "string",
  "errors": [
    {
      "name": "string",
      "pointer": "string",
      "reason": "string",
      "rule": "string"
    }
  ],
  "instance": "string",
  "request_id": "string",
  "status": 0,
  "title": "string",
  "trace_id": "string",
  "type": "http://example.com",
  "property1": null,
  "property2": null
}

Список типов сущностей

GET
/api/v1/integrations/entity-mapping/schemas
АвторизацияBearer <токен>

В: header

Тело ответа

application/json

curl -X GET "https://loading/api/v1/integrations/entity-mapping/schemas"
{
  "entityTypes": [
    "string"
  ]
}

Получить поля типа сущности

GET
/api/v1/integrations/entity-mapping/schemas/{entityType}
АвторизацияBearer <токен>

В: header

Параметры пути

entityType*string

Канонический тип сущности, например counterparty

Тело ответа

application/json

application/problem+json

curl -X GET "https://loading/api/v1/integrations/entity-mapping/schemas/string"
{
  "entityType": "string",
  "fields": [
    "string"
  ]
}
{
  "code": "string",
  "detail": "string",
  "errors": [
    {
      "name": "string",
      "pointer": "string",
      "reason": "string",
      "rule": "string"
    }
  ],
  "instance": "string",
  "request_id": "string",
  "status": 0,
  "title": "string",
  "trace_id": "string",
  "type": "http://example.com",
  "property1": null,
  "property2": null
}