Сделать ставку
Порядок работы для агента · Методы API и схема OpenAPI.
Назначение
Передайте data.demandId, data.executorId и цену с валютой в data.price. Метод может сразу принять заказ, например при достижении цены выкупа, в режиме «кто первый» или при прямом назначении. Если такой исход возможен или условия торгов неизвестны, до вызова получите подтверждение готовности принять заказ за эту цену. Укажите исходную цену base, валюту currency и признак data.price.isVatPayer. Для плательщика заполните в цене vatAmount (сумма НДС) и subTotalPrice (итоговая цена с учётом НДС). Сохраните data.id и перечитайте заказ, чтобы отличить ставку от принятия заказа.
Блоки запроса и ответов ниже сгенерированы из OpenAPI. Подстановки вроде
exampleпоказывают структуру JSON. Для вызова возьмите значения из сценария, справочников или предыдущих ответов API.
Request
POST
https://partner-test-yamagistrali.ru/api/bet/create/v1
Тестовый стенд
Body
application/json
{
"data": {
"betMultimodal": {
"isPriceByArc": true,
"route": [
{}
]
},
"comment": "example",
"condition": "example",
"demandId": "example",
"executorId": "example",
"extId": "example",
"notVatPayer": true,
"price": {
"base": "100.18",
"currency": "RUB",
"isVatPayer": false,
"subTotalPrice": "122.21",
"vat": "22",
"vatAmount": "22.03"
},
"tariffMatrix": {
"tariffMatrixId": "example"
},
"useMultimodal": true,
"useTariffMatrix": true
}
}
|
Name |
Description |
|
data |
Type: BetCreateV1Request Example
|
TaxablePriceIO
|
Name |
Description |
|
base |
Type: string | null Цена исходная Pattern: Example: |
|
currency |
Type: string ISO 4217 код валюты Example: |
|
isVatPayer |
Type: boolean Признак плательщика НДС. Для плательщика укажите ставку vat или сумму vatAmount. Default: |
|
subTotalPrice |
Type: string | null Итоговая цена с учётом НДС Pattern: Example: |
|
vat |
Type: string | null Ставка НДС (в % от 0 до 100) Pattern: Example: |
|
vatAmount |
Type: string | null Сумма НДС (ВАЖНО может быть без указания ставки НДС!!!) Pattern: Example: |
Example
{
"base": "100.18",
"currency": "RUB",
"isVatPayer": false,
"subTotalPrice": "122.21",
"vat": "22",
"vatAmount": "22.03"
}
BetCreateV1BetMultimodalRoteArc
|
Name |
Description |
|
addressFrom |
Type: string Example: |
|
addressTo |
Type: string Example: |
|
comment |
Type: string Example: |
|
price |
Type: TaxablePriceIO Example
|
Example
{
"addressFrom": "example",
"addressTo": "example",
"comment": "example",
"price": {
"base": "100.18",
"currency": "RUB",
"isVatPayer": false,
"subTotalPrice": "122.21",
"vat": "22",
"vatAmount": "22.03"
}
}
BetCreateV1BetMultimodal
|
Name |
Description |
|
isPriceByArc |
Type: boolean |
|
route |
Type: BetCreateV1BetMultimodalRoteArc[] | null Example
|
Example
{
"isPriceByArc": true,
"route": [
{
"addressFrom": "example",
"addressTo": "example",
"comment": "example",
"price": {
"base": "100.18",
"currency": "RUB",
"isVatPayer": false,
"subTotalPrice": "122.21",
"vat": "22",
"vatAmount": "22.03"
}
}
]
}
BetCreateV1TariffMatrix
|
Name |
Description |
|
tariffMatrixId |
Type: string Example: |
Example
{
"tariffMatrixId": "example"
}
BetCreateV1Request
|
Name |
Description |
|
comment |
Type: string Example: |
|
condition |
Type: string Example: |
|
demandId |
Type: string Example: |
|
executorId |
Type: string Example: |
|
extId |
Type: string Example: |
|
notVatPayer |
Type: boolean |
|
price |
Type: TaxablePriceIO Example
|
|
useMultimodal |
Type: boolean |
|
useTariffMatrix |
Type: boolean |
|
betMultimodal |
Any of 2 types
Example
|
|
tariffMatrix |
Any of 2 types
Example
|
Example
{
"betMultimodal": {
"isPriceByArc": true,
"route": [
{
"addressFrom": "example",
"addressTo": "example",
"comment": "example",
"price": {}
}
]
},
"comment": "example",
"condition": "example",
"demandId": "example",
"executorId": "example",
"extId": "example",
"notVatPayer": true,
"price": null,
"tariffMatrix": {
"tariffMatrixId": "example"
},
"useMultimodal": true,
"useTariffMatrix": true
}
Responses
200 OK
OK
Body
application/json
{
"data": {
"id": "example"
}
}
|
Name |
Description |
|
data |
Type: BetCreateV1Response Example
|
BetCreateV1Response
|
Name |
Description |
|
id |
Type: string Example: |
Example
{
"id": "example"
}
400 Bad Request
Bad Request
Body
application/json
{
"error": {
"info": {},
"message": "example",
"message_code": "example"
}
}
|
Name |
Description |
|
error |
Type: Error Example
|
Error
|
Name |
Description |
|
info |
Type: object Example
|
|
message |
Type: string Example: |
|
message_code |
Type: string Example: |
Example
{
"info": {},
"message": "example",
"message_code": "example"
}
403 Forbidden
Forbidden
Body
application/json
{
"error": {
"info": {},
"message": "example",
"message_code": "example"
}
}
|
Name |
Description |
|
error |
Type: Error Example
|
500 Internal Server Error
Internal Server Error
Body
application/json
{
"error": {
"info": {},
"message": "example",
"message_code": "example"
}
}
|
Name |
Description |
|
error |
Type: Error Example
|