{
  "openapi": "3.1.1",
  "info": {
    "title": "Миксплат — Backend API v3",
    "version": "3.1.0",
    "description": "Методы и уведомления из разделов «Backend API» и «Расширения API». Суммы передаются в минорных единицах валюты. Запросы и ответы используют JSON в UTF-8. Необязательные поля запроса со значением null эквивалентны отсутствующим. Подпись вычисляется сервером продавца. В примерах OpenAPI используется вымышленный ключ demo_secret."
  },
  "externalDocs": {
    "description": "Быстрый старт: от реквизитов проекта до тестового платежа",
    "url": "https://docs.mixplat.ru/quickstart/"
  },
  "servers": [
    {
      "url": "https://api.mixplat.com"
    }
  ],
  "paths": {
    "/create_payment_form": {
      "post": {
        "operationId": "create_payment_form",
        "summary": "Создать платёж и получить ссылку на платёжную форму",
        "description": "Передайте test=1 для тестового платежа. По умолчанию платёж реальный. При сетевом повторе используйте прежний request_id с теми же данными. После result=ok перенаправьте плательщика на redirect_url и сохраните payment_id.",
        "externalDocs": {
          "url": "https://docs.mixplat.ru/methods#create_payment_form"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePaymentFormRequest"
              },
              "examples": {
                "testCard": {
                  "summary": "Тестовый платёж на 10 ₽",
                  "value": {
                    "api_version": 3,
                    "project_id": 10001,
                    "request_id": "req-demo-001",
                    "merchant_payment_id": "order-demo-001",
                    "payment_method": "card",
                    "test": 1,
                    "amount": 1000,
                    "signature": "cba3efcb666c5ee7bcf76510685050b6"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Проверьте поле result в JSON. При неверной подписи API также возвращает HTTP 200.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/CreatePaymentFormSuccess"
                    },
                    {
                      "$ref": "#/components/schemas/ApiError"
                    }
                  ]
                },
                "examples": {
                  "created": {
                    "summary": "Ссылка на оплату",
                    "value": {
                      "result": "ok",
                      "payment_id": "demo-001",
                      "redirect_url": "https://pay.mixplat.com/p/demo-001"
                    }
                  },
                  "invalidSignature": {
                    "summary": "Неверная подпись (HTTP 200)",
                    "value": {
                      "result": "error_wrong_signature",
                      "error_description": "Wrong signature!"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "При ошибке API возвращает код result и пояснение error_description. Для транспортных ошибок формат тела не гарантирован.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "examples": {
                  "unknownProject": {
                    "summary": "Проект не найден",
                    "value": {
                      "result": "error_project_not_found",
                      "error_description": "Project not found"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Платежи"
        ]
      }
    },
    "/get_payment_status": {
      "post": {
        "operationId": "get_payment_status",
        "summary": "Получить статус одного платежа",
        "description": "Идентифицируйте платёж одним из двух способов: payment_id либо merchant_payment_id вместе с project_id. Ориентируйтесь на status и сверяйте ответ с ожидаемым заказом.",
        "externalDocs": {
          "url": "https://docs.mixplat.ru/methods#get_payment_status"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GetPaymentStatusRequest"
              },
              "examples": {
                "byPayment": {
                  "summary": "По ID Миксплата",
                  "value": {
                    "api_version": 3,
                    "payment_id": "demo-001",
                    "signature": "0ad714e280257189b727365f766f2e48"
                  }
                },
                "byOrder": {
                  "summary": "По заказу продавца",
                  "value": {
                    "api_version": 3,
                    "merchant_payment_id": "order-demo-001",
                    "project_id": "10001",
                    "signature": "458763bc1aaa18a491d3bead4f15eb5b"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Проверьте поле result в JSON. При неверной подписи API также возвращает HTTP 200. При поиске отсутствующего заказа возвращается HTTP 200 с result=error_payment_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/PaymentStatusSuccess"
                    },
                    {
                      "$ref": "#/components/schemas/ApiError"
                    }
                  ]
                },
                "examples": {
                  "paid": {
                    "summary": "Тестовый заказ оплачен",
                    "value": {
                      "result": "ok",
                      "project_id": 10001,
                      "merchant_payment_id": "order-demo-001",
                      "test": 1,
                      "amount": 1000,
                      "currency": "RUB",
                      "status": "success",
                      "status_extended": "success_success",
                      "payment_method": "card",
                      "payment_method_group": "card",
                      "date_created": "2026-01-15 12:00:00",
                      "date_processed": "2026-01-15 12:01:00"
                    }
                  },
                  "notFound": {
                    "summary": "Платёж не найден (HTTP 200)",
                    "value": {
                      "result": "error_payment_not_found",
                      "error_description": "Payment not found"
                    }
                  },
                  "invalidSignature": {
                    "summary": "Неверная подпись (HTTP 200)",
                    "value": {
                      "result": "error_wrong_signature",
                      "error_description": "Wrong signature!"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "При ошибке API возвращает код result и пояснение error_description. Для транспортных ошибок формат тела не гарантирован.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "tags": [
          "Платежи"
        ]
      }
    },
    "/refund_payment": {
      "post": {
        "operationId": "refund_payment",
        "summary": "Создать возврат",
        "description": "Возвраты доступны только по реальным платежам. По одному платежу можно создать несколько частичных возвратов. Каждый получает свой refund_id. Ответ ok означает, что возврат создан. Его результат проверяется отдельно, статус исходного платежа сохраняется.",
        "externalDocs": {
          "url": "https://docs.mixplat.ru/methods#refund_payment"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RefundPaymentRequest"
              },
              "examples": {
                "full": {
                  "summary": "Возврат всей суммы платежа",
                  "value": {
                    "api_version": 3,
                    "payment_id": "demo-001",
                    "signature": "0ad714e280257189b727365f766f2e48"
                  }
                },
                "partial": {
                  "summary": "Возврат 3 ₽ из платежа на 10 ₽",
                  "value": {
                    "api_version": 3,
                    "payment_id": "demo-001",
                    "signature": "0ad714e280257189b727365f766f2e48",
                    "amount": 300,
                    "currency": "RUB",
                    "merchant_refund_id": "refund-demo-001"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Проверьте result в теле ответа. Для тестового платежа наблюдался HTTP 200 с ошибкой error_refund_not_available.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/RefundPaymentSuccess"
                    },
                    {
                      "$ref": "#/components/schemas/ApiError"
                    }
                  ]
                },
                "examples": {
                  "created": {
                    "summary": "Возврат создан",
                    "value": {
                      "result": "ok",
                      "refund_id": 19872
                    }
                  },
                  "unavailable": {
                    "summary": "Попытка возврата по тестовому платежу",
                    "value": {
                      "result": "error_refund_not_available",
                      "error_description": "Refund is not avilable"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Ошибка API. Конкретный HTTP-код для этого примера не указан.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "examples": {
                  "missingPayment": {
                    "summary": "Платёж не найден",
                    "value": {
                      "result": "error_payment_not_found",
                      "error_description": "Payment is not found"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Возвраты"
        ]
      }
    },
    "/get_refund_status": {
      "post": {
        "operationId": "get_refund_status",
        "summary": "Узнать статус возврата",
        "description": "Передайте ID возврата. Финальный статус может появиться через несколько дней после подтверждения банка.",
        "externalDocs": {
          "url": "https://docs.mixplat.ru/methods#get_refund_status"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GetRefundStatusRequest"
              },
              "examples": {
                "byRefund": {
                  "summary": "Запрос по ID возврата",
                  "value": {
                    "api_version": 3,
                    "refund_id": 19872,
                    "signature": "6da337ebdbde1092e39eca9834977d90"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Результат запроса. При result=ok статус возврата указан в status.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/RefundStatusSuccess"
                    },
                    {
                      "$ref": "#/components/schemas/ApiError"
                    }
                  ]
                },
                "examples": {
                  "completed": {
                    "summary": "Полный возврат 10 ₽ завершён",
                    "value": {
                      "result": "ok",
                      "payment_id": "demo-001",
                      "merchant_payment_id": "order-demo-001",
                      "amount": 1000,
                      "status": "success",
                      "status_extended": "success_success",
                      "date_created": "2026-01-16 10:00:00",
                      "date_completed": "2026-01-17 15:00:00"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Ошибка API. Конкретный HTTP-код для этого примера не указан.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "examples": {
                  "missingRefund": {
                    "summary": "Возврат не найден",
                    "value": {
                      "result": "error_refund_not_found",
                      "error_description": "Refund is not found"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Возвраты"
        ]
      }
    },
    "/get_payment_statuses": {
      "post": {
        "operationId": "get_payment_statuses",
        "summary": "Получить платежи за период",
        "description": "Запрашивайте страницы с одинаковым периодом по порядку, начиная с 0. Пустой массив payments завершает выгрузку.",
        "externalDocs": {
          "url": "https://docs.mixplat.ru/methods#get_payment_statuses"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentStatusListRequest"
              },
              "examples": {
                "page": {
                  "summary": "Первая страница за день",
                  "value": {
                    "api_version": 3,
                    "project_id": 10001,
                    "page": 0,
                    "date_created_from": "2026-01-15 00:00:00",
                    "date_created_to": "2026-01-15 23:59:59",
                    "signature": "c5b4cc311b86a508ca68b312688a3b6e"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Проверьте поле result в теле ответа.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/PaymentStatusListSuccess"
                    },
                    {
                      "$ref": "#/components/schemas/ApiError"
                    }
                  ]
                },
                "examples": {
                  "payments": {
                    "summary": "Страница с платежом",
                    "value": {
                      "result": "ok",
                      "payments": [
                        {
                          "payment_id": "demo-001",
                          "project_id": 10001,
                          "status": "success",
                          "amount": 1000,
                          "currency": "RUB",
                          "date_created": "2026-01-15 12:00:00"
                        }
                      ]
                    }
                  },
                  "end": {
                    "summary": "Конец выборки",
                    "value": {
                      "result": "ok",
                      "payments": []
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Ошибка API. HTTP-код примера в справочнике не указан.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "examples": {
                  "error": {
                    "summary": "Проект не найден",
                    "value": {
                      "result": "error_project_not_found",
                      "error_description": "Project is not found"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Платежи"
        ]
      }
    },
    "/stop_subscription": {
      "post": {
        "operationId": "stop_subscription",
        "summary": "Остановить подписку",
        "description": "Для остановки передайте ID подписки в поле recurrent_id.",
        "externalDocs": {
          "url": "https://docs.mixplat.ru/methods#stop_subscription"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StopSubscriptionRequest"
              },
              "examples": {
                "stop": {
                  "summary": "Остановка подписки",
                  "value": {
                    "api_version": 3,
                    "recurrent_id": 434241,
                    "signature": "ee319339038887be2aab6f499e6f7052"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Проверьте поле result в теле ответа.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/OperationAccepted"
                    },
                    {
                      "$ref": "#/components/schemas/ApiError"
                    }
                  ]
                },
                "examples": {
                  "ok": {
                    "summary": "Запрос принят",
                    "value": {
                      "result": "ok"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Ошибка API. HTTP-код примера в справочнике не указан.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "examples": {
                  "error": {
                    "summary": "Подписка не найдена",
                    "value": {
                      "result": "error_subscription_not_found",
                      "error_description": "Subscription is not found"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Подписки и рекуррентные платежи"
        ]
      }
    },
    "/get_subscription_status": {
      "post": {
        "operationId": "get_subscription_status",
        "summary": "Узнать статус подписки",
        "description": "Передайте её ID в поле subscription_id. Подписка создаётся после успешного установочного платежа с recurrent_payment=1 при настроенном подписочном профиле.",
        "externalDocs": {
          "url": "https://docs.mixplat.ru/methods#get_subscription_status"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GetSubscriptionStatusRequest"
              },
              "examples": {
                "lookup": {
                  "summary": "Запрос статуса",
                  "value": {
                    "api_version": 3,
                    "subscription_id": 434241,
                    "signature": "ee319339038887be2aab6f499e6f7052"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Проверьте поле result в теле ответа.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/SubscriptionStatusSuccess"
                    },
                    {
                      "$ref": "#/components/schemas/ApiError"
                    }
                  ]
                },
                "examples": {
                  "active": {
                    "summary": "Активная ежемесячная подписка",
                    "value": {
                      "result": "ok",
                      "subscription_status": "active",
                      "profile_id": "10",
                      "period": "1month",
                      "project_id": 10001,
                      "date_created": "2026-01-15 12:00:00",
                      "date_stopped": null,
                      "amount": 1000,
                      "currency": "RUB"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Ошибка API. HTTP-код примера в справочнике не указан.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "examples": {
                  "error": {
                    "summary": "Подписка не найдена",
                    "value": {
                      "result": "error_subscription_not_found",
                      "error_description": "Subscription is not found"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Подписки и рекуррентные платежи"
        ]
      }
    },
    "/create_recurrent_payment": {
      "post": {
        "operationId": "create_recurrent_payment",
        "summary": "Создать повторный платёж",
        "description": "Режим подключается через поддержку. Укажите recurrent_id из уведомления об успешном установочном платеже. У нового платежа свой payment_id. При повторе запроса используйте прежний request_id. Результат списания приходит в payment_status и доступен через get_payment_status.",
        "externalDocs": {
          "url": "https://docs.mixplat.ru/methods#create_recurrent_payment"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateRecurrentPaymentRequest"
              },
              "examples": {
                "charge": {
                  "summary": "Повторный платёж с позицией чека",
                  "value": {
                    "api_version": 3,
                    "recurrent_id": "demo-recurrent",
                    "request_id": "demo-repeat-001",
                    "amount": 1000,
                    "items": [
                      {
                        "name": "Услуга",
                        "sum": 1000,
                        "quantity": 1
                      }
                    ],
                    "signature": "03f51540161fdf086419bcafe0fc01c7"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Проверьте поле result в теле ответа.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/PaymentCreated"
                    },
                    {
                      "$ref": "#/components/schemas/ApiError"
                    }
                  ]
                },
                "examples": {
                  "created": {
                    "summary": "Платёж создан",
                    "value": {
                      "result": "ok",
                      "payment_id": "demo-002"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Ошибка API. HTTP-код примера в справочнике не указан.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "examples": {
                  "error": {
                    "summary": "Проект не найден",
                    "value": {
                      "result": "error_project_not_found",
                      "error_description": "Project is not found"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Подписки и рекуррентные платежи"
        ]
      }
    },
    "/confirm_payment": {
      "post": {
        "operationId": "confirm_payment",
        "summary": "Подтвердить двухэтапный платёж",
        "description": "После авторизации можно подтвердить всю сумму или её часть. Если amount опущено, будет списана исходная сумма.",
        "externalDocs": {
          "url": "https://docs.mixplat.ru/methods#confirm_payment"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConfirmPaymentRequest"
              },
              "examples": {
                "full": {
                  "summary": "Подтвердить двухэтапный платёж",
                  "value": {
                    "api_version": 3,
                    "payment_id": "demo-001",
                    "signature": "0ad714e280257189b727365f766f2e48"
                  }
                },
                "partial": {
                  "summary": "Подтверждение части суммы",
                  "value": {
                    "api_version": 3,
                    "payment_id": "demo-001",
                    "signature": "0ad714e280257189b727365f766f2e48",
                    "amount": 700
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Проверьте поле result в теле ответа.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/OperationAccepted"
                    },
                    {
                      "$ref": "#/components/schemas/ApiError"
                    }
                  ]
                },
                "examples": {
                  "ok": {
                    "summary": "Запрос принят",
                    "value": {
                      "result": "ok"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Ошибка API. HTTP-код примера в справочнике не указан.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "examples": {
                  "error": {
                    "summary": "Платёж не найден",
                    "value": {
                      "result": "error_payment_not_found",
                      "error_description": "Payment is not found"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Двухэтапные платежи"
        ]
      }
    },
    "/cancel_payment": {
      "post": {
        "operationId": "cancel_payment",
        "summary": "Отменить двухэтапный платёж",
        "description": "Отмена снимает резерв по авторизованной сумме. Окончательный статус платежа проверьте в уведомлении или через get_payment_status.",
        "externalDocs": {
          "url": "https://docs.mixplat.ru/methods#cancel_payment"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CancelPaymentRequest"
              },
              "examples": {
                "full": {
                  "summary": "Отменить двухэтапный платёж",
                  "value": {
                    "api_version": 3,
                    "payment_id": "demo-001",
                    "signature": "0ad714e280257189b727365f766f2e48"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Проверьте поле result в теле ответа.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/OperationAccepted"
                    },
                    {
                      "$ref": "#/components/schemas/ApiError"
                    }
                  ]
                },
                "examples": {
                  "ok": {
                    "summary": "Запрос принят",
                    "value": {
                      "result": "ok"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Ошибка API. HTTP-код примера в справочнике не указан.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "examples": {
                  "error": {
                    "summary": "Платёж не найден",
                    "value": {
                      "result": "error_payment_not_found",
                      "error_description": "Payment is not found"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Двухэтапные платежи"
        ]
      }
    },
    "/create_payment": {
      "post": {
        "operationId": "create_payment",
        "summary": "Создать низкоуровневый платёж",
        "description": "Миксплат предоставляет рабочий URL после получения отчёта AOC о соответствии PCI DSS. Интернет-банкинг и электронные кошельки для этого метода недоступны. Для обычной интеграции используйте create_payment_form.",
        "externalDocs": {
          "url": "https://docs.mixplat.ru/extensions#create_payment"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DirectPaymentRequest"
              },
              "examples": {
                "mobile": {
                  "summary": "Пример для мобильной коммерции",
                  "value": {
                    "api_version": 3,
                    "request_id": "demo-direct-001",
                    "project_id": 10001,
                    "merchant_payment_id": "order-demo-001",
                    "payment_method": "mobile",
                    "amount": 1000,
                    "test": 1,
                    "user_phone": "79000000000",
                    "signature": "32db187a67735feeb41f2c90725e627c"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Проверьте поле result в теле ответа.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/DirectPaymentSuccess"
                    },
                    {
                      "$ref": "#/components/schemas/ApiError"
                    }
                  ]
                },
                "examples": {
                  "created": {
                    "summary": "Платёж создан",
                    "value": {
                      "result": "ok",
                      "payment_id": "demo-003"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Ошибка API. HTTP-код примера в справочнике не указан.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "examples": {
                  "error": {
                    "summary": "Проект не найден",
                    "value": {
                      "result": "error_project_not_found",
                      "error_description": "Project is not found"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Расширения API"
        ]
      },
      "servers": [
        {
          "url": "{assignedBaseUrl}",
          "description": "Подставьте базовый адрес, предоставленный Миксплатом для низкоуровневых платежей.",
          "variables": {
            "assignedBaseUrl": {
              "default": "https://merchant-api.invalid",
              "description": "Адрес-заглушка. Рабочий URL выдаётся после проверки AOC."
            }
          }
        }
      ]
    },
    "/phone_info": {
      "post": {
        "operationId": "phone_info",
        "summary": "Узнать оператора по номеру телефона",
        "description": "Возвращает сведения об операторе, доступности мобильной оплаты и комиссиях.",
        "externalDocs": {
          "url": "https://docs.mixplat.ru/extensions#phone_info"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PhoneInfoRequest"
              },
              "examples": {
                "lookup": {
                  "summary": "Запрос по номеру",
                  "value": {
                    "api_version": 3,
                    "project_id": 10001,
                    "user_phone": "79000000000",
                    "signature": "75803ac627f90d6efbe9bb1adb398df3"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Проверьте поле result в теле ответа.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/PhoneInfoSuccess"
                    },
                    {
                      "$ref": "#/components/schemas/ApiError"
                    }
                  ]
                },
                "examples": {
                  "active": {
                    "summary": "Мобильная оплата доступна",
                    "value": {
                      "result": "ok",
                      "mobile_payment_active": 1,
                      "country": "RU",
                      "operator": "МегаФон",
                      "mccmnc": 25002,
                      "region": "Москва",
                      "fee_user": 0,
                      "fee_merchant": 14.5
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Ошибка API. HTTP-код примера в справочнике не указан.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "examples": {
                  "error": {
                    "summary": "Проект не найден",
                    "value": {
                      "result": "error_project_not_found",
                      "error_description": "Project is not found"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Расширения API"
        ]
      }
    },
    "/create_sms": {
      "post": {
        "operationId": "create_sms",
        "summary": "Отправить SMS абоненту",
        "description": "Некоторые операторы требуют исходное входящее SMS для ответа с короткого номера.",
        "externalDocs": {
          "url": "https://docs.mixplat.ru/extensions#create_sms"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSmsRequest"
              },
              "examples": {
                "reply": {
                  "summary": "Ответ на входящее SMS",
                  "value": {
                    "api_version": 3,
                    "project_id": 10001,
                    "sms_id": 42,
                    "request_id": "demo-sms-001",
                    "user_phone": "79000000000",
                    "message": "Ваш запрос принят.",
                    "signature": "aaaed213161f0b2006f43e72bb129617"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Проверьте поле result в теле ответа.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/CreateSmsSuccess"
                    },
                    {
                      "$ref": "#/components/schemas/ApiError"
                    }
                  ]
                },
                "examples": {
                  "accepted": {
                    "summary": "Сообщение принято",
                    "value": {
                      "result": "ok",
                      "mobile": {
                        "payment_system": "mobile_ru_beeline",
                        "mccmnc": 25099,
                        "sender": "3443"
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Ошибка API. HTTP-код примера в справочнике не указан.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "examples": {
                  "error": {
                    "summary": "Отправка недоступна для проекта",
                    "value": {
                      "result": "error",
                      "error_description": "SMS sending is not available for project_id 10001"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Расширения API"
        ]
      }
    }
  },
  "webhooks": {
    "payment_status": {
      "servers": [
        {
          "url": "{handlerUrl}",
          "description": "Публичный адрес обработчика продавца из настроек проекта.",
          "variables": {
            "handlerUrl": {
              "default": "https://merchant.example/mixplat/notifications"
            }
          }
        }
      ],
      "post": {
        "operationId": "payment_status",
        "summary": "Получить уведомление Миксплата о статусе платежа",
        "description": "Миксплат отправляет POST на URL из поля «На скрипт-обработчик». Проверьте подпись и подтвердите статус через API. Обрабатывайте повторную доставку идемпотентно. Для подтверждения приёма верните HTTP 200 и result=ok в течение 40 секунд. При неудачной доставке предусмотрено до 10 попыток.",
        "externalDocs": {
          "url": "https://docs.mixplat.ru/methods#payment_status"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentNotification"
              },
              "examples": {
                "paid": {
                  "summary": "Уведомление об оплате тестового заказа",
                  "value": {
                    "api_version": 3,
                    "request": "payment_status",
                    "payment_id": "demo-001",
                    "project_id": 10001,
                    "merchant_payment_id": "order-demo-001",
                    "test": 1,
                    "amount": 1000,
                    "currency": "RUB",
                    "status": "success",
                    "status_extended": "success_success",
                    "payment_method": "card",
                    "payment_method_group": "card",
                    "date_created": "2026-01-15 12:00:00",
                    "date_processed": "2026-01-15 12:01:00",
                    "signature": "0ad714e280257189b727365f766f2e48"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Ответ сайта продавца. result=ok подтверждает получение. Для повтора обработки верните result=error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotificationReceipt"
                },
                "examples": {
                  "received": {
                    "summary": "Принято",
                    "value": {
                      "result": "ok"
                    }
                  },
                  "retry": {
                    "summary": "Запросить повтор",
                    "value": {
                      "result": "error",
                      "error_description": "Temporary processing error"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "HTTP-ответ с кодом, отличным от 200, означает неудачную доставку."
          }
        },
        "tags": [
          "Платежи"
        ]
      }
    },
    "refund_status": {
      "servers": [
        {
          "url": "{handlerUrl}",
          "description": "Публичный адрес обработчика продавца из настроек проекта.",
          "variables": {
            "handlerUrl": {
              "default": "https://merchant.example/mixplat/notifications"
            }
          }
        }
      ],
      "post": {
        "operationId": "refund_status",
        "summary": "Принять уведомление о статусе возврата",
        "description": "Миксплат отправляет уведомление на URL обработчика в настройках проекта после подтверждения от банка. Проверьте подпись, найдите возврат по refund_id и сохраните его статус.",
        "externalDocs": {
          "url": "https://docs.mixplat.ru/methods#refund_status"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RefundNotification"
              },
              "examples": {
                "completed": {
                  "summary": "Уведомление о полном возврате 10 ₽",
                  "value": {
                    "request": "refund_status",
                    "api_version": 3,
                    "refund_id": 19872,
                    "signature": "6da337ebdbde1092e39eca9834977d90",
                    "payment_id": "demo-001",
                    "merchant_payment_id": "order-demo-001",
                    "amount": 1000,
                    "status": "success",
                    "status_extended": "success_success",
                    "date_created": "2026-01-16 10:00:00",
                    "date_completed": "2026-01-17 15:00:00"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Ответ обработчика продавца.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RefundNotificationReceipt"
                },
                "examples": {
                  "received": {
                    "summary": "Уведомление принято",
                    "value": {
                      "result": "ok"
                    }
                  },
                  "missingRefund": {
                    "summary": "Возврат не найден у продавца",
                    "value": {
                      "result": "error_refund_not_found",
                      "error_description": "Refund is not found"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Возвраты"
        ]
      }
    },
    "payment_check": {
      "servers": [
        {
          "url": "{handlerUrl}",
          "description": "Публичный адрес обработчика продавца из настроек проекта.",
          "variables": {
            "handlerUrl": {
              "default": "https://merchant.example/mixplat/notifications"
            }
          }
        }
      ],
      "post": {
        "operationId": "payment_check",
        "summary": "Разрешить или запретить оплату",
        "description": "Расширение подключает поддержка. Миксплат спрашивает магазин до списания денег. При результате ok решение передаётся в allow.",
        "externalDocs": {
          "url": "https://docs.mixplat.ru/extensions#payment_check"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentCheckNotification"
              },
              "examples": {
                "check": {
                  "summary": "Проверка возможности оплаты",
                  "value": {
                    "api_version": 3,
                    "request": "payment_check",
                    "payment_id": "demo-001",
                    "project_id": 10001,
                    "test": 1,
                    "amount": 1000,
                    "currency": "RUB",
                    "payment_method": "card",
                    "date_created": "2026-01-15 12:00:00",
                    "signature": "0ad714e280257189b727365f766f2e48"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Ответ обработчика продавца.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/PaymentCheckDecision"
                    },
                    {
                      "$ref": "#/components/schemas/NotificationError"
                    }
                  ]
                },
                "examples": {
                  "allow": {
                    "summary": "Разрешить",
                    "value": {
                      "result": "ok",
                      "allow": 1
                    }
                  },
                  "deny": {
                    "summary": "Запретить",
                    "value": {
                      "result": "ok",
                      "allow": 0
                    }
                  },
                  "error": {
                    "summary": "Ошибка обработчика",
                    "value": {
                      "result": "error",
                      "error_description": "Temporary processing error"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Расширения API"
        ]
      }
    },
    "sms": {
      "servers": [
        {
          "url": "{handlerUrl}",
          "description": "Публичный адрес обработчика продавца из настроек проекта.",
          "variables": {
            "handlerUrl": {
              "default": "https://merchant.example/mixplat/notifications"
            }
          }
        }
      ],
      "post": {
        "operationId": "sms",
        "summary": "Принять SMS на короткий номер",
        "description": "Миксплат передаёт на обработчик магазина текст сообщения и сведения об операторе. Для асинхронного ответа через create_sms сохраните sms_id.",
        "externalDocs": {
          "url": "https://docs.mixplat.ru/extensions#sms"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IncomingSms"
              },
              "examples": {
                "incoming": {
                  "summary": "Входящее SMS",
                  "value": {
                    "api_version": 3,
                    "request": "sms",
                    "project_id": 10001,
                    "sms_id": 42,
                    "user_phone": "79000000000",
                    "parts": 1,
                    "date_created": "2026-01-15 12:00:00",
                    "mobile": {
                      "payment_system": "mobile_ru_beeline",
                      "mccmnc": 25099,
                      "sender": "3443",
                      "text_raw": "Демо 100",
                      "prefix": "Демо",
                      "text_after_prefix": "100"
                    },
                    "signature": "c4ee626af4699d68a1b152c180b81a5f"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Ответ обработчика продавца.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotificationReceipt"
                },
                "examples": {
                  "received": {
                    "summary": "Сообщение принято",
                    "value": {
                      "result": "ok"
                    }
                  },
                  "error": {
                    "summary": "Ошибка обработчика",
                    "value": {
                      "result": "error",
                      "error_description": "Temporary processing error"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Расширения API"
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "ApiVersion": {
        "type": "integer",
        "const": 3
      },
      "PaymentId": {
        "type": "string",
        "description": "Идентификатор платежа в Миксплате. Передаётся строкой."
      },
      "ReceiptItem": {
        "type": "object",
        "required": [
          "name",
          "sum"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Наименование позиции товара/услуги."
          },
          "sum": {
            "type": "integer",
            "description": "Общая сумма по позиции товара/услуги с учётом количества (в минорных единицах). Рассчитывается как цена за единицу, умноженная на количество (quantity)."
          },
          "quantity": {
            "type": [
              "number",
              "null"
            ],
            "description": "Количество товара/услуги. Дробное число с разделителем-точкой. Необязательное поле, по умолчанию: 1",
            "default": 1
          },
          "unit": {
            "type": [
              "string",
              "integer",
              "null"
            ],
            "description": "Единица измерения количества. В случае ФФД 1.05 передается в виде строки (шт., кг, литр и т.д.). В случае ФФД 1.2 передается числовое значение (см. ниже items.unit) Необязательное поле для ФФД 1.05, по умолчанию: \"шт.\" Обязательное поле для ФФД 1.2, по умолчанию 0",
            "oneOf": [
              {
                "type": "string",
                "description": "Текстовое обозначение для ФФД 1.05."
              },
              {
                "enum": [
                  0,
                  10,
                  11,
                  12,
                  20,
                  21,
                  22,
                  30,
                  31,
                  32,
                  40,
                  41,
                  42,
                  50,
                  51,
                  70,
                  71,
                  72,
                  73,
                  80,
                  81,
                  82,
                  83,
                  255,
                  null
                ]
              }
            ],
            "externalDocs": {
              "url": "https://docs.mixplat.ru/methods#items_unit"
            }
          },
          "vat": {
            "type": [
              "string",
              "null"
            ],
            "description": "НДС (см. ниже items.vat). Необязательное поле, по умолчанию берётся из настроек компании.",
            "enum": [
              "none",
              "vat0",
              "vat5",
              "vat7",
              "vat10",
              "vat105",
              "vat107",
              "vat110",
              "vat20",
              "vat22",
              "vat120",
              "vat122",
              null
            ],
            "externalDocs": {
              "url": "https://docs.mixplat.ru/methods#items_vat"
            }
          },
          "payment_method": {
            "type": [
              "string",
              "null"
            ],
            "description": "Способ взаиморасчёта (см. ниже items.payment_method). Необязательное поле, по умолчанию берётся из настроек компании.",
            "enum": [
              "full_payment",
              "full_prepayment",
              "prepayment",
              "advance",
              "partial_payment",
              "credit",
              "credit_payment",
              null
            ],
            "externalDocs": {
              "url": "https://docs.mixplat.ru/methods#items_method"
            }
          },
          "payment_object": {
            "type": [
              "string",
              "integer",
              "null"
            ],
            "description": "Тип товаров/услуг (см. ниже items.payment_object). Необязательное поле, по умолчанию берётся из настроек компании.",
            "enum": [
              "commodity",
              "excise",
              "job",
              "service",
              "payment",
              "property_right",
              "composite",
              "another",
              1,
              2,
              3,
              4,
              5,
              6,
              7,
              8,
              9,
              10,
              11,
              12,
              13,
              14,
              15,
              16,
              17,
              18,
              19,
              20,
              21,
              22,
              23,
              24,
              25,
              26,
              27,
              30,
              31,
              32,
              33,
              null
            ],
            "externalDocs": {
              "url": "https://docs.mixplat.ru/methods#items_object"
            }
          }
        },
        "externalDocs": {
          "url": "https://docs.mixplat.ru/methods#items"
        }
      },
      "CardDetails": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "payment_system": {
            "type": "string",
            "description": "Платёжная система карты плательщика"
          },
          "pan": {
            "type": "string",
            "description": "Номер карты плательщика. Показаны только первые 6 и последние 4 цифры, остальные заменены на символ *."
          },
          "issuer_country_code": {
            "type": "string",
            "description": "Двухсимвольный код страны плательщика по стандарту ISO 3166, определенный по номеру карты."
          },
          "issuer_country": {
            "type": "string",
            "description": "Cтрана плательщика, определённая по номеру карты."
          },
          "issuer": {
            "type": [
              "string",
              "null"
            ],
            "description": "Банк-эмитент карты плательщика. Задаётся в случае, если удалось распознать банк плательщика."
          }
        }
      },
      "BankDetails": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "account": {
            "type": "string",
            "description": "Номер расчётного счёта плательщика."
          },
          "issuer_country_code": {
            "type": "string",
            "description": "Двухсимвольный код страны банка по стандарту ISO 3166."
          },
          "issuer_country": {
            "type": "string",
            "description": "Cтрана банка."
          },
          "issuer": {
            "type": [
              "string",
              "null"
            ],
            "description": "Банк-эмитент карты плательщика. Задаётся в случае, если удалось распознать банк плательщика."
          }
        }
      },
      "MobileDetails": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "payment_system": {
            "type": [
              "string",
              "null"
            ],
            "description": "Символьное наименование оператора сотовой связи телефонного номера абонента."
          },
          "mccmnc": {
            "type": "integer",
            "description": "Код оператора сотовой связи по стандарту MCCMNC."
          },
          "billing_type": {
            "type": "string",
            "description": "Тип биллинга платежа"
          },
          "sender": {
            "type": [
              "string",
              "null"
            ],
            "description": "Номер, на который было отправлено SMS-сообщение, инициировавшее платёж. Задаётся только в случае, если платёж был инициирован отправкой SMS-сообщения на короткий номер."
          },
          "text_raw": {
            "type": [
              "string",
              "null"
            ],
            "description": "Полный текст сообщения. Задаётся только в случае, если платёж был инициирован отправкой SMS-сообщения на короткий номер."
          },
          "prefix": {
            "type": [
              "string",
              "null"
            ],
            "description": "Ключевое слово, распознанное в тексте сообщения. Задаётся только в случае, если платёж был инициирован отправкой SMS-сообщения на короткий номер."
          },
          "text_after_prefix": {
            "type": [
              "string",
              "null"
            ],
            "description": "Текст после ключевого слова. Задаётся только в случае, если платёж был инициирован отправкой SMS-сообщения на короткий номер."
          }
        }
      },
      "WalletDetails": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "account": {
            "type": "string",
            "description": "Идентификатор плательщика в платёжной системе."
          },
          "issuer_country_code": {
            "type": "string",
            "description": "Двухсимвольный код страны банка по стандарту ISO 3166."
          },
          "issuer_country": {
            "type": "string",
            "description": "Cтрана банка."
          },
          "issuer": {
            "type": [
              "string",
              "null"
            ],
            "description": "Наименование банка плательщика. Задаётся в случае, если удалось распознать банк плательщика."
          }
        }
      },
      "CreatePaymentFormRequest": {
        "type": "object",
        "required": [
          "api_version",
          "project_id",
          "signature",
          "amount"
        ],
        "properties": {
          "api_version": {
            "$ref": "#/components/schemas/ApiVersion"
          },
          "project_id": {
            "type": "integer",
            "description": "ID проекта ТСП в Миксплат, для которого создаётся платёж. Значение параметра отображается в личном кабинете Миксплат в настройках проекта. Обязательный параметр"
          },
          "signature": {
            "type": "string",
            "pattern": "^[a-fA-F0-9]{32}$",
            "description": "MD5(request_id + project_id + merchant_payment_id + API_KEY). Значения соединяются в указанном порядке без разделителей; отсутствующее или null считается пустой строкой. API_KEY — секретный ключ проекта для подписи на сервере."
          },
          "amount": {
            "type": "integer",
            "description": "Сумма в минорных единицах валюты (для RUB — в копейках). У проекта могут быть дополнительные ограничения."
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "Назначение платежа для платёжной формы и личного кабинета.",
            "minLength": 3,
            "maxLength": 125,
            "default": "Оплата заказа"
          },
          "request_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Уникальный идентификатор запроса у продавца. Повтор с тем же ID в течение 30 дней возвращает первоначальный результат.",
            "minLength": 1,
            "maxLength": 64
          },
          "payment_method": {
            "type": [
              "string",
              "null"
            ],
            "description": "Платёжный метод из раздела 6.8. При пропуске доступны методы проекта."
          },
          "merchant_payment_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "ID заказа или платежа у продавца; возвращается в уведомлении, если был передан.",
            "minLength": 1,
            "maxLength": 256
          },
          "merchant_campaign_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "ID кампании у продавца.",
            "minLength": 1,
            "maxLength": 256
          },
          "merchant_data": {
            "type": [
              "string",
              "null"
            ],
            "description": "Произвольные данные продавца, связанные с платежом.",
            "minLength": 1,
            "maxLength": 2048
          },
          "merchant_fields": {
            "type": [
              "object",
              "null"
            ],
            "description": "Объект с дополнительными сведениями продавца. Возвращается в уведомлении."
          },
          "user_email": {
            "type": [
              "string",
              "null"
            ],
            "description": "Email плательщика (если известен), для отправки email о совершённом платеже. Необязательный параметр."
          },
          "user_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Имя плательщика (если известно), для отправки email о совершённом платеже. Необязательный параметр."
          },
          "user_phone": {
            "type": [
              "string",
              "null"
            ],
            "description": "Номер телефона плательщика (если известен), только цифры, в международном формате, с кодом страны. Необязательный параметр."
          },
          "user_comment": {
            "type": [
              "string",
              "null"
            ],
            "description": "Пользовательский комментарий к платежу (если есть). Необязательный параметр."
          },
          "user_account_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Идентификатор пользователя в ТСП (если есть). Необязательный параметр."
          },
          "test": {
            "type": [
              "integer",
              "null"
            ],
            "description": "1 — тест без списания, 0 — реальный платёж. Для теста используйте карту или телефон из раздела 5.5.",
            "enum": [
              0,
              1,
              null
            ],
            "default": 0
          },
          "timeout": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Время для оплаты в секундах. По умолчанию 21600 или 86400 в зависимости от типа проекта."
          },
          "language": {
            "type": [
              "string",
              "null"
            ],
            "description": "Язык формы и сообщений; по умолчанию зависит от IP плательщика.",
            "enum": [
              "RU",
              "EN",
              null
            ]
          },
          "currency": {
            "type": [
              "string",
              "null"
            ],
            "description": "Валюта платежа.",
            "default": "RUB",
            "enum": [
              "RUB",
              "EUR",
              "USD",
              "BYN",
              "KZT",
              null
            ]
          },
          "items": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/ReceiptItem"
            },
            "description": "Позиции фискального чека. Поле sum каждой позиции уже учитывает количество."
          },
          "url_success": {
            "type": [
              "string",
              "null"
            ],
            "description": "URL, на который будет перенаправлен Плательщик после успешной оплаты. Необязательный параметр. Если не передан, используются настройки платёжной формы, заданные в ЛК.",
            "format": "uri"
          },
          "url_failure": {
            "type": [
              "string",
              "null"
            ],
            "description": "URL, на который будет перенаправлен Плательщик после неуспешной оплаты. Необязательный параметр. Если не передан, используются настройки платёжной формы, заданные в ЛК.",
            "format": "uri"
          },
          "recurrent_payment": {
            "type": [
              "integer",
              "null"
            ],
            "description": "1 — установочный платёж, 0 — обычный.",
            "enum": [
              0,
              1,
              null
            ],
            "default": 0
          },
          "payment_scheme": {
            "type": [
              "string",
              "null"
            ],
            "description": "Схема карточного платежа.",
            "enum": [
              "single",
              "double",
              null
            ],
            "default": "single"
          },
          "utm_medium": {
            "type": [
              "string",
              "null"
            ],
            "description": "UTM-метка, определяющая тип трафика. Если параметр передан, то это же значение параметра будет приходить в уведомлениях payment_status. Необязательный параметр."
          },
          "utm_source": {
            "type": [
              "string",
              "null"
            ],
            "description": "UTM-метка, определяющая источник трафика. Если параметр передан, то это же значение параметра будет приходить в уведомлениях payment_status. Необязательный параметр."
          },
          "utm_campaign": {
            "type": [
              "string",
              "null"
            ],
            "description": "UTM-метка, определяющая рекламную кампанию. Если параметр передан, то это же значение параметра будет приходить в уведомлениях payment_status. Необязательный параметр."
          },
          "utm_term": {
            "type": [
              "string",
              "null"
            ],
            "description": "Произвольная пользовательская UTM-метка. Если параметр передан, то это же значение параметра будет приходить в уведомлениях payment_status. Необязательный параметр."
          }
        },
        "allOf": [
          {
            "if": {
              "required": [
                "payment_method"
              ],
              "properties": {
                "payment_method": {
                  "const": "card"
                }
              }
            },
            "then": {
              "properties": {
                "amount": {
                  "minimum": 100,
                  "maximum": 100000000
                }
              }
            }
          },
          {
            "if": {
              "required": [
                "payment_method"
              ],
              "properties": {
                "payment_method": {
                  "const": "mobile"
                }
              }
            },
            "then": {
              "properties": {
                "amount": {
                  "minimum": 1000,
                  "maximum": 1500000
                }
              }
            }
          }
        ]
      },
      "CreatePaymentFormSuccess": {
        "type": "object",
        "required": [
          "result",
          "payment_id",
          "redirect_url"
        ],
        "properties": {
          "result": {
            "type": "string",
            "const": "ok"
          },
          "payment_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "ID созданного платежа в Миксплате."
          },
          "redirect_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "Ссылка на платёжную форму для плательщика."
          }
        }
      },
      "ApiError": {
        "type": "object",
        "required": [
          "result",
          "error_description"
        ],
        "properties": {
          "result": {
            "type": "string",
            "not": {
              "const": "ok"
            },
            "description": "Код ошибки из раздела 6.3. Для create_payment_form и get_payment_status при неверной подписи наблюдается error_wrong_signature. При поиске отсутствующего платежа используется error_payment_not_found.",
            "examples": [
              "error_invalid_request",
              "error_wrong_signature",
              "error_signature",
              "error_payment_not_found",
              "error_project_not_found",
              "error_project_not_active",
              "error_method_not_active",
              "error_payment_parameters",
              "error_fraud_control",
              "error_settings",
              "error_unable_to_refund_yet",
              "error_refund_not_available",
              "error_refund_amount_exceed",
              "error_refund_not_found",
              "error_subscription_not_found",
              "error_other",
              "error_internal"
            ]
          },
          "error_description": {
            "type": "string",
            "description": "Описание ошибки."
          }
        },
        "externalDocs": {
          "url": "https://docs.mixplat.ru/reference#result_to_mixplat"
        }
      },
      "PaymentDetails": {
        "type": "object",
        "required": [
          "project_id",
          "amount",
          "currency",
          "status",
          "test"
        ],
        "properties": {
          "merchant_payment_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "ID платежа в ТСП. Присутствует, если был передан при создании платежа."
          },
          "payment_method": {
            "type": [
              "string",
              "null"
            ],
            "description": "Платёжный метод, который был использован для оплаты , или NULL, если он ещё не определён."
          },
          "payment_method_group": {
            "type": [
              "string",
              "null"
            ],
            "description": "Группа платёжного метода, который был использован для оплаты , или NULL, если он ещё не определён."
          },
          "status": {
            "type": "string",
            "description": "Состояние платежа: pending — обрабатывается, success — оплачен, failure — неуспешен.",
            "enum": [
              "pending",
              "success",
              "failure"
            ]
          },
          "status_extended": {
            "type": "string",
            "description": "Уточнение статуса. Набор значений может расширяться; для решения об оплате используйте status."
          },
          "amount": {
            "type": "integer",
            "description": "Сумма платежа в минорных единицах (копейках)."
          },
          "amount_user": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Сумма, фактически оплаченная плательщиком, с учётом комиссии (если есть), в минорных единицах (копейках) или NULL, если платёж ещё не подтверждён."
          },
          "amount_merchant": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Сумма к выплате ТСП, за вычетом комиссии (если есть), в минорных единицах (копейках) или NULL, если платёж ещё не подтверждён."
          },
          "test": {
            "type": "integer",
            "description": "1 — тестовый платёж, 0 — реальный.",
            "enum": [
              0,
              1
            ]
          },
          "currency": {
            "type": "string",
            "description": "Валюта платежа."
          },
          "date_created": {
            "type": "string",
            "description": "Дата и время создания платежа (по UTC+03:00). Формат: YYYY-MM-DD HH:MM:SS"
          },
          "date_processed": {
            "type": [
              "string",
              "null"
            ],
            "description": "Дата и время обработки платежа (по UTC+03:00). Формат: YYYY-MM-DD HH:MM:SS"
          },
          "project_id": {
            "type": "integer",
            "description": "ID проекта ТСП в Миксплат, к которому относится платёж. Значение параметра отображается в личном кабинете Миксплат в настройках проекта."
          },
          "recurrent_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "ID рекуррентной сессии для согласованного установочного платежа."
          },
          "init_payment_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Значение payment_id первого платежа по рекурренту/подписке. Присутствует только для рекуррентных платежей."
          },
          "merchant_init_payment_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Значение merchant_payment_id из первого платежа по рекурренту/подписке. Присутствует только для рекуррентных платежей."
          },
          "merchant_campaign_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "ID кампании в ТСП. Присутствует, если был передан при создании платежа."
          },
          "merchant_data": {
            "type": [
              "string",
              "null"
            ],
            "description": "Произвольные данные ТСП, связанные с платежом. Присутствуют, если были переданы при создании платежа."
          },
          "merchant_fields": {
            "type": [
              "object",
              "null"
            ],
            "description": "Дополнительные поля продавца, если передавались при создании платежа."
          },
          "user_email": {
            "type": [
              "string",
              "null"
            ],
            "description": "Email плательщика. Параметр присутствует, если был передан при создании платежа."
          },
          "user_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Имя плательщика. Параметр присутствует, если было передано при создании платежа."
          },
          "user_phone": {
            "type": [
              "string",
              "null"
            ],
            "description": "Номер телефона плательщика. Параметр присутствует, если был передан при создании платежа или если платёжный метод использует номер телефона."
          },
          "user_comment": {
            "type": [
              "string",
              "null"
            ],
            "description": "Пользовательский комментарий к платежу. Параметр присутствует, если был передан при создании платежа"
          },
          "user_account_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Идентификатор пользователя в ТСП. Присутствует, если был передан при создании платежа"
          },
          "user_country_code": {
            "type": [
              "string",
              "null"
            ],
            "description": "Двухсимвольный код страны плательщика по стандарту ISO 3166."
          },
          "user_country": {
            "type": [
              "string",
              "null"
            ],
            "description": "Страна плательщика. Могут быть несовпадения при подключенном VPN."
          },
          "user_region_code": {
            "type": [
              "string",
              "null"
            ],
            "description": "Код региона плательщика по стандарту ISO 3166."
          },
          "user_region": {
            "type": [
              "string",
              "null"
            ],
            "description": "Регион плательщика."
          },
          "utm_medium": {
            "type": [
              "string",
              "null"
            ],
            "description": "UTM-метка, определяющая тип трафика. Присутствует, если была передана при создании платежа."
          },
          "utm_source": {
            "type": [
              "string",
              "null"
            ],
            "description": "UTM-метка, определяющая источник трафика. Присутствует, если была передана при создании платежа."
          },
          "utm_campaign": {
            "type": [
              "string",
              "null"
            ],
            "description": "UTM-метка, определяющая рекламную кампанию. Присутствует, если была передана при создании платежа."
          },
          "utm_term": {
            "type": [
              "string",
              "null"
            ],
            "description": "Произвольная пользовательская UTM-метка. Присутствует, если была передана при создании платежа."
          },
          "card": {
            "$ref": "#/components/schemas/CardDetails"
          },
          "bank": {
            "$ref": "#/components/schemas/BankDetails"
          },
          "mobile": {
            "$ref": "#/components/schemas/MobileDetails"
          },
          "wallet": {
            "$ref": "#/components/schemas/WalletDetails"
          }
        }
      },
      "PaymentStatusSuccess": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PaymentDetails"
          },
          {
            "type": "object",
            "required": [
              "result"
            ],
            "properties": {
              "result": {
                "type": "string",
                "const": "ok"
              }
            }
          }
        ]
      },
      "PaymentNotification": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PaymentDetails"
          },
          {
            "type": "object",
            "required": [
              "api_version",
              "request",
              "payment_id",
              "signature"
            ],
            "properties": {
              "api_version": {
                "$ref": "#/components/schemas/ApiVersion"
              },
              "request": {
                "type": "string",
                "const": "payment_status"
              },
              "payment_id": {
                "$ref": "#/components/schemas/PaymentId"
              },
              "signature": {
                "type": "string",
                "pattern": "^[a-fA-F0-9]{32}$",
                "description": "MD5(payment_id + API_KEY). Значения соединяются в указанном порядке без разделителей; отсутствующее или null считается пустой строкой. API_KEY — секретный ключ проекта для подписи на сервере."
              }
            }
          }
        ]
      },
      "GetPaymentStatusRequest": {
        "type": "object",
        "required": [
          "api_version",
          "signature"
        ],
        "properties": {
          "api_version": {
            "$ref": "#/components/schemas/ApiVersion"
          },
          "payment_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "ID платежа в Миксплате при поиске по payment_id."
          },
          "merchant_payment_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "ID платежа у продавца при поиске по заказу."
          },
          "project_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "ID проекта в формате строки для поиска по merchant_payment_id (раздел 3.2.2)."
          },
          "signature": {
            "type": "string",
            "pattern": "^[a-fA-F0-9]{32}$",
            "description": "MD5(payment_id + merchant_payment_id + API_KEY). Значения соединяются в указанном порядке без разделителей; отсутствующее или null считается пустой строкой. API_KEY — секретный ключ проекта для подписи на сервере."
          }
        },
        "oneOf": [
          {
            "title": "По ID платежа Миксплата",
            "required": [
              "payment_id"
            ],
            "properties": {
              "payment_id": {
                "type": "string"
              },
              "merchant_payment_id": {
                "type": "null"
              },
              "project_id": {
                "type": "null"
              }
            }
          },
          {
            "title": "По ID платежа продавца и проекту",
            "required": [
              "merchant_payment_id",
              "project_id"
            ],
            "properties": {
              "payment_id": {
                "type": "null"
              },
              "merchant_payment_id": {
                "type": "string"
              },
              "project_id": {
                "type": "string"
              }
            }
          }
        ]
      },
      "NotificationReceipt": {
        "type": "object",
        "required": [
          "result"
        ],
        "properties": {
          "result": {
            "type": "string",
            "description": "ok — уведомление обработано. Другое значение запрашивает повторную доставку."
          },
          "error_description": {
            "type": "string",
            "description": "Описание ошибки, если она возникла у продавца."
          },
          "message": {
            "type": "string",
            "description": "Текст сообщения плательщику по SMS или email в зависимости от настроек сервиса."
          }
        }
      },
      "RefundPaymentRequest": {
        "type": "object",
        "required": [
          "api_version",
          "payment_id",
          "signature"
        ],
        "properties": {
          "api_version": {
            "$ref": "#/components/schemas/ApiVersion"
          },
          "payment_id": {
            "$ref": "#/components/schemas/PaymentId"
          },
          "amount": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Сумма возврата в минорных единицах валюты. По умолчанию равна сумме исходного платежа."
          },
          "currency": {
            "type": [
              "string",
              "null"
            ],
            "description": "По умолчанию используется валюта исходного платежа."
          },
          "merchant_refund_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "ID возврата в системе продавца.",
            "minLength": 1,
            "maxLength": 256
          },
          "merchant_data": {
            "type": [
              "string",
              "null"
            ],
            "description": "Данные продавца, связанные с возвратом.",
            "minLength": 1,
            "maxLength": 256
          },
          "signature": {
            "type": "string",
            "pattern": "^[a-fA-F0-9]{32}$",
            "description": "MD5(payment_id + API_KEY). Соедините строковое значение payment_id и секретный ключ проекта без разделителя."
          }
        }
      },
      "RefundPaymentSuccess": {
        "type": "object",
        "required": [
          "result",
          "refund_id"
        ],
        "properties": {
          "result": {
            "type": "string",
            "const": "ok"
          },
          "refund_id": {
            "type": [
              "integer",
              "string",
              "null"
            ],
            "description": "ID созданного возврата. В опубликованном примере это целое число, в таблице ответа указан тип string|null."
          }
        }
      },
      "RefundId": {
        "type": "integer",
        "description": "ID возврата в Миксплате."
      },
      "GetRefundStatusRequest": {
        "type": "object",
        "required": [
          "api_version",
          "refund_id",
          "signature"
        ],
        "properties": {
          "api_version": {
            "$ref": "#/components/schemas/ApiVersion"
          },
          "refund_id": {
            "$ref": "#/components/schemas/RefundId"
          },
          "signature": {
            "type": "string",
            "pattern": "^[a-fA-F0-9]{32}$",
            "description": "MD5(refund_id + API_KEY). Соедините строковое значение refund_id и секретный ключ проекта без разделителя."
          }
        }
      },
      "RefundDetails": {
        "type": "object",
        "required": [
          "payment_id",
          "amount",
          "status",
          "date_created"
        ],
        "properties": {
          "payment_id": {
            "$ref": "#/components/schemas/PaymentId"
          },
          "merchant_payment_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "ID платежа в системе продавца."
          },
          "amount": {
            "type": "integer",
            "description": "Сумма в минорных единицах валюты. В таблице параметров обозначена как сумма платежа."
          },
          "merchant_refund_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "ID возврата в системе продавца."
          },
          "merchant_data": {
            "type": [
              "string",
              "null"
            ],
            "description": "Данные продавца, связанные с возвратом."
          },
          "status": {
            "type": "string",
            "description": "Статус возврата. pending — в обработке, success — выполнен, failure — завершился ошибкой.",
            "enum": [
              "pending",
              "success",
              "failure"
            ]
          },
          "status_extended": {
            "type": "string",
            "description": "Расширенный статус. Для определения результата используйте status."
          },
          "date_created": {
            "type": "string",
            "description": "Дата создания возврата по UTC+03:00 в формате YYYY-MM-DD HH:MM:SS."
          },
          "date_completed": {
            "type": [
              "string",
              "null"
            ],
            "description": "Дата завершения возврата в том же формате. Для возврата в обработке может быть null."
          }
        }
      },
      "RefundStatusSuccess": {
        "allOf": [
          {
            "$ref": "#/components/schemas/RefundDetails"
          },
          {
            "type": "object",
            "required": [
              "result"
            ],
            "properties": {
              "result": {
                "type": "string",
                "const": "ok"
              }
            }
          }
        ]
      },
      "RefundNotification": {
        "allOf": [
          {
            "$ref": "#/components/schemas/RefundDetails"
          },
          {
            "type": "object",
            "required": [
              "api_version",
              "request",
              "refund_id",
              "signature"
            ],
            "properties": {
              "api_version": {
                "$ref": "#/components/schemas/ApiVersion"
              },
              "request": {
                "type": "string",
                "const": "refund_status"
              },
              "refund_id": {
                "$ref": "#/components/schemas/RefundId"
              },
              "signature": {
                "type": "string",
                "pattern": "^[a-fA-F0-9]{32}$",
                "description": "MD5(refund_id + API_KEY). Соедините строковое значение refund_id и секретный ключ проекта без разделителя."
              }
            }
          }
        ]
      },
      "RefundNotificationReceipt": {
        "type": "object",
        "required": [
          "result"
        ],
        "properties": {
          "result": {
            "type": "string",
            "description": "Для подтверждения приёма верните ok."
          },
          "error_description": {
            "type": "string",
            "description": "Описание ошибки при обработке уведомления продавцом."
          }
        }
      },
      "OperationAccepted": {
        "type": "object",
        "required": [
          "result"
        ],
        "properties": {
          "result": {
            "type": "string",
            "const": "ok"
          }
        }
      },
      "PaymentStatusListRequest": {
        "type": "object",
        "required": [
          "api_version",
          "project_id",
          "date_created_from",
          "date_created_to",
          "signature"
        ],
        "properties": {
          "api_version": {
            "$ref": "#/components/schemas/ApiVersion"
          },
          "project_id": {
            "type": "integer",
            "description": "ID проекта Миксплата."
          },
          "date_created_from": {
            "type": "string",
            "description": "Начало периода создания платежей по UTC+03:00, YYYY-MM-DD HH:MM:SS."
          },
          "date_created_to": {
            "type": "string",
            "description": "Конец периода создания платежей по UTC+03:00, YYYY-MM-DD HH:MM:SS."
          },
          "page": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Номер страницы, начиная с нуля.",
            "minimum": 0,
            "default": 0
          },
          "signature": {
            "type": "string",
            "description": "MD5(project_id + API_KEY). Соедините строковые значения без разделителей. Для отсутствующих необязательных полей используйте пустую строку.",
            "pattern": "^[a-fA-F0-9]{32}$"
          }
        }
      },
      "PaymentListEntry": {
        "type": "object",
        "required": [
          "payment_id"
        ],
        "properties": {
          "payment_id": {
            "$ref": "#/components/schemas/PaymentId"
          },
          "merchant_payment_id": {
            "$ref": "#/components/schemas/PaymentDetails/properties/merchant_payment_id"
          },
          "payment_method": {
            "$ref": "#/components/schemas/PaymentDetails/properties/payment_method"
          },
          "payment_method_group": {
            "$ref": "#/components/schemas/PaymentDetails/properties/payment_method_group"
          },
          "status": {
            "$ref": "#/components/schemas/PaymentDetails/properties/status"
          },
          "status_extended": {
            "$ref": "#/components/schemas/PaymentDetails/properties/status_extended"
          },
          "amount": {
            "$ref": "#/components/schemas/PaymentDetails/properties/amount"
          },
          "amount_user": {
            "$ref": "#/components/schemas/PaymentDetails/properties/amount_user"
          },
          "amount_merchant": {
            "$ref": "#/components/schemas/PaymentDetails/properties/amount_merchant"
          },
          "test": {
            "$ref": "#/components/schemas/PaymentDetails/properties/test"
          },
          "currency": {
            "$ref": "#/components/schemas/PaymentDetails/properties/currency"
          },
          "date_created": {
            "$ref": "#/components/schemas/PaymentDetails/properties/date_created"
          },
          "date_processed": {
            "$ref": "#/components/schemas/PaymentDetails/properties/date_processed"
          },
          "project_id": {
            "$ref": "#/components/schemas/PaymentDetails/properties/project_id"
          },
          "recurrent_id": {
            "$ref": "#/components/schemas/PaymentDetails/properties/recurrent_id"
          },
          "init_payment_id": {
            "$ref": "#/components/schemas/PaymentDetails/properties/init_payment_id"
          },
          "merchant_init_payment_id": {
            "$ref": "#/components/schemas/PaymentDetails/properties/merchant_init_payment_id"
          },
          "merchant_campaign_id": {
            "$ref": "#/components/schemas/PaymentDetails/properties/merchant_campaign_id"
          },
          "merchant_data": {
            "$ref": "#/components/schemas/PaymentDetails/properties/merchant_data"
          },
          "merchant_fields": {
            "$ref": "#/components/schemas/PaymentDetails/properties/merchant_fields"
          },
          "user_email": {
            "$ref": "#/components/schemas/PaymentDetails/properties/user_email"
          },
          "user_name": {
            "$ref": "#/components/schemas/PaymentDetails/properties/user_name"
          },
          "user_phone": {
            "$ref": "#/components/schemas/PaymentDetails/properties/user_phone"
          },
          "user_comment": {
            "$ref": "#/components/schemas/PaymentDetails/properties/user_comment"
          },
          "user_account_id": {
            "$ref": "#/components/schemas/PaymentDetails/properties/user_account_id"
          },
          "user_country_code": {
            "$ref": "#/components/schemas/PaymentDetails/properties/user_country_code"
          },
          "user_country": {
            "$ref": "#/components/schemas/PaymentDetails/properties/user_country"
          },
          "user_region_code": {
            "$ref": "#/components/schemas/PaymentDetails/properties/user_region_code"
          },
          "user_region": {
            "$ref": "#/components/schemas/PaymentDetails/properties/user_region"
          },
          "utm_medium": {
            "$ref": "#/components/schemas/PaymentDetails/properties/utm_medium"
          },
          "utm_source": {
            "$ref": "#/components/schemas/PaymentDetails/properties/utm_source"
          },
          "utm_campaign": {
            "$ref": "#/components/schemas/PaymentDetails/properties/utm_campaign"
          },
          "utm_term": {
            "$ref": "#/components/schemas/PaymentDetails/properties/utm_term"
          },
          "card": {
            "$ref": "#/components/schemas/PaymentDetails/properties/card"
          },
          "bank": {
            "$ref": "#/components/schemas/PaymentDetails/properties/bank"
          },
          "mobile": {
            "$ref": "#/components/schemas/PaymentDetails/properties/mobile"
          },
          "wallet": {
            "$ref": "#/components/schemas/PaymentDetails/properties/wallet"
          }
        }
      },
      "PaymentStatusListSuccess": {
        "type": "object",
        "required": [
          "result",
          "payments"
        ],
        "properties": {
          "result": {
            "type": "string",
            "const": "ok"
          },
          "payments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PaymentListEntry"
            }
          }
        }
      },
      "StopSubscriptionRequest": {
        "type": "object",
        "required": [
          "api_version",
          "recurrent_id",
          "signature"
        ],
        "properties": {
          "api_version": {
            "$ref": "#/components/schemas/ApiVersion"
          },
          "recurrent_id": {
            "type": "integer",
            "description": "ID подписки."
          },
          "signature": {
            "type": "string",
            "description": "MD5(recurrent_id + API_KEY). Соедините строковые значения без разделителей. Для отсутствующих необязательных полей используйте пустую строку.",
            "pattern": "^[a-fA-F0-9]{32}$"
          }
        }
      },
      "GetSubscriptionStatusRequest": {
        "type": "object",
        "required": [
          "api_version",
          "subscription_id",
          "signature"
        ],
        "properties": {
          "api_version": {
            "$ref": "#/components/schemas/ApiVersion"
          },
          "subscription_id": {
            "type": "integer",
            "description": "ID подписки."
          },
          "signature": {
            "type": "string",
            "description": "MD5(subscription_id + API_KEY). Соедините строковые значения без разделителей. Для отсутствующих необязательных полей используйте пустую строку.",
            "pattern": "^[a-fA-F0-9]{32}$"
          }
        }
      },
      "SubscriptionStatusSuccess": {
        "type": "object",
        "required": [
          "result",
          "subscription_status",
          "profile_id",
          "period"
        ],
        "properties": {
          "result": {
            "type": "string",
            "const": "ok"
          },
          "subscription_status": {
            "type": "string",
            "description": "Состояние подписки.",
            "enum": [
              "confirmation",
              "active",
              "suspended",
              "stopped"
            ]
          },
          "profile_id": {
            "type": "string",
            "description": "ID профиля подписки."
          },
          "period": {
            "type": "string",
            "description": "Период списаний, например 1month, 1week или 1day."
          },
          "test": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Признак тестового платежа.",
            "enum": [
              0,
              1,
              null
            ]
          },
          "currency": {
            "type": [
              "string",
              "null"
            ],
            "description": "Валюта платежа."
          },
          "date_created": {
            "type": "string",
            "description": "Дата создания подписки, YYYY-MM-DD HH:MM:SS по UTC+03:00."
          },
          "date_processed": {
            "type": [
              "string",
              "null"
            ],
            "description": "Время обработки последнего платежа, YYYY-MM-DD HH:MM:SS по UTC+03:00."
          },
          "date_stopped": {
            "type": [
              "string",
              "null"
            ],
            "description": "Время остановки подписки, YYYY-MM-DD HH:MM:SS по UTC+03:00. Для активной подписки допускается null."
          },
          "payment_method": {
            "$ref": "#/components/schemas/PaymentDetails/properties/payment_method"
          },
          "payment_method_group": {
            "$ref": "#/components/schemas/PaymentDetails/properties/payment_method_group"
          },
          "amount": {
            "$ref": "#/components/schemas/PaymentDetails/properties/amount"
          },
          "amount_user": {
            "$ref": "#/components/schemas/PaymentDetails/properties/amount_user"
          },
          "amount_merchant": {
            "$ref": "#/components/schemas/PaymentDetails/properties/amount_merchant"
          },
          "project_id": {
            "$ref": "#/components/schemas/PaymentDetails/properties/project_id"
          },
          "init_payment_id": {
            "$ref": "#/components/schemas/PaymentDetails/properties/init_payment_id"
          },
          "merchant_init_payment_id": {
            "$ref": "#/components/schemas/PaymentDetails/properties/merchant_init_payment_id"
          },
          "merchant_campaign_id": {
            "$ref": "#/components/schemas/PaymentDetails/properties/merchant_campaign_id"
          },
          "merchant_data": {
            "$ref": "#/components/schemas/PaymentDetails/properties/merchant_data"
          },
          "merchant_fields": {
            "$ref": "#/components/schemas/PaymentDetails/properties/merchant_fields"
          },
          "user_email": {
            "$ref": "#/components/schemas/PaymentDetails/properties/user_email"
          },
          "user_name": {
            "$ref": "#/components/schemas/PaymentDetails/properties/user_name"
          },
          "user_phone": {
            "$ref": "#/components/schemas/PaymentDetails/properties/user_phone"
          },
          "user_comment": {
            "$ref": "#/components/schemas/PaymentDetails/properties/user_comment"
          },
          "user_account_id": {
            "$ref": "#/components/schemas/PaymentDetails/properties/user_account_id"
          },
          "user_country_code": {
            "$ref": "#/components/schemas/PaymentDetails/properties/user_country_code"
          },
          "user_country": {
            "$ref": "#/components/schemas/PaymentDetails/properties/user_country"
          },
          "user_region_code": {
            "$ref": "#/components/schemas/PaymentDetails/properties/user_region_code"
          },
          "user_region": {
            "$ref": "#/components/schemas/PaymentDetails/properties/user_region"
          },
          "utm_medium": {
            "$ref": "#/components/schemas/PaymentDetails/properties/utm_medium"
          },
          "utm_source": {
            "$ref": "#/components/schemas/PaymentDetails/properties/utm_source"
          },
          "utm_campaign": {
            "$ref": "#/components/schemas/PaymentDetails/properties/utm_campaign"
          },
          "utm_term": {
            "$ref": "#/components/schemas/PaymentDetails/properties/utm_term"
          },
          "card": {
            "$ref": "#/components/schemas/PaymentDetails/properties/card"
          },
          "bank": {
            "$ref": "#/components/schemas/PaymentDetails/properties/bank"
          },
          "mobile": {
            "$ref": "#/components/schemas/PaymentDetails/properties/mobile"
          },
          "wallet": {
            "$ref": "#/components/schemas/PaymentDetails/properties/wallet"
          }
        }
      },
      "CreateRecurrentPaymentRequest": {
        "type": "object",
        "required": [
          "api_version",
          "recurrent_id",
          "amount",
          "signature"
        ],
        "properties": {
          "api_version": {
            "$ref": "#/components/schemas/ApiVersion"
          },
          "recurrent_id": {
            "type": "string",
            "description": "ID привязанной карты из уведомления об установочном платеже."
          },
          "amount": {
            "type": "integer",
            "description": "Сумма в минорных единицах валюты исходного платежа. Для проекта могут действовать более строгие ограничения.",
            "minimum": 100,
            "maximum": 100000000
          },
          "request_id": {
            "$ref": "#/components/schemas/CreatePaymentFormRequest/properties/request_id"
          },
          "merchant_payment_id": {
            "$ref": "#/components/schemas/CreatePaymentFormRequest/properties/merchant_payment_id"
          },
          "merchant_data": {
            "$ref": "#/components/schemas/CreatePaymentFormRequest/properties/merchant_data"
          },
          "items": {
            "$ref": "#/components/schemas/CreatePaymentFormRequest/properties/items"
          },
          "signature": {
            "type": "string",
            "description": "MD5(recurrent_id + API_KEY). Соедините строковые значения без разделителей. Для отсутствующих необязательных полей используйте пустую строку.",
            "pattern": "^[a-fA-F0-9]{32}$"
          }
        }
      },
      "PaymentCreated": {
        "type": "object",
        "required": [
          "result",
          "payment_id"
        ],
        "properties": {
          "result": {
            "type": "string",
            "const": "ok"
          },
          "payment_id": {
            "$ref": "#/components/schemas/PaymentId"
          }
        }
      },
      "ConfirmPaymentRequest": {
        "type": "object",
        "required": [
          "api_version",
          "payment_id",
          "signature"
        ],
        "properties": {
          "api_version": {
            "$ref": "#/components/schemas/ApiVersion"
          },
          "payment_id": {
            "$ref": "#/components/schemas/PaymentId"
          },
          "signature": {
            "type": "string",
            "description": "MD5(payment_id + API_KEY). Соедините строковые значения без разделителей. Для отсутствующих необязательных полей используйте пустую строку.",
            "pattern": "^[a-fA-F0-9]{32}$"
          },
          "amount": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Сумма в минорных единицах валюты исходного платежа. Для проекта могут действовать более строгие ограничения.",
            "minimum": 100,
            "maximum": 100000000
          }
        }
      },
      "CancelPaymentRequest": {
        "type": "object",
        "required": [
          "api_version",
          "payment_id",
          "signature"
        ],
        "properties": {
          "api_version": {
            "$ref": "#/components/schemas/ApiVersion"
          },
          "payment_id": {
            "$ref": "#/components/schemas/PaymentId"
          },
          "signature": {
            "type": "string",
            "description": "MD5(payment_id + API_KEY). Соедините строковые значения без разделителей. Для отсутствующих необязательных полей используйте пустую строку.",
            "pattern": "^[a-fA-F0-9]{32}$"
          }
        }
      },
      "PaymentCheckNotification": {
        "type": "object",
        "required": [
          "api_version",
          "request",
          "payment_id",
          "project_id",
          "test",
          "amount",
          "currency",
          "date_created",
          "signature"
        ],
        "properties": {
          "api_version": {
            "$ref": "#/components/schemas/ApiVersion"
          },
          "request": {
            "type": "string",
            "const": "payment_check"
          },
          "payment_id": {
            "$ref": "#/components/schemas/PaymentId"
          },
          "signature": {
            "type": "string",
            "description": "MD5(payment_id + API_KEY). Соедините строковые значения без разделителей. Для отсутствующих необязательных полей используйте пустую строку.",
            "pattern": "^[a-fA-F0-9]{32}$"
          },
          "project_id": {
            "$ref": "#/components/schemas/PaymentDetails/properties/project_id"
          },
          "test": {
            "$ref": "#/components/schemas/PaymentDetails/properties/test"
          },
          "merchant_payment_id": {
            "$ref": "#/components/schemas/PaymentDetails/properties/merchant_payment_id"
          },
          "merchant_data": {
            "$ref": "#/components/schemas/PaymentDetails/properties/merchant_data"
          },
          "date_created": {
            "$ref": "#/components/schemas/PaymentDetails/properties/date_created"
          },
          "currency": {
            "$ref": "#/components/schemas/PaymentDetails/properties/currency"
          },
          "amount": {
            "$ref": "#/components/schemas/PaymentDetails/properties/amount"
          },
          "payment_method": {
            "$ref": "#/components/schemas/PaymentDetails/properties/payment_method"
          },
          "user_phone": {
            "$ref": "#/components/schemas/PaymentDetails/properties/user_phone"
          },
          "card": {
            "$ref": "#/components/schemas/PaymentDetails/properties/card"
          },
          "bank": {
            "$ref": "#/components/schemas/PaymentDetails/properties/bank"
          },
          "mobile": {
            "$ref": "#/components/schemas/PaymentDetails/properties/mobile"
          },
          "wallet": {
            "$ref": "#/components/schemas/PaymentDetails/properties/wallet"
          }
        }
      },
      "PaymentCheckDecision": {
        "type": "object",
        "required": [
          "result",
          "allow"
        ],
        "properties": {
          "result": {
            "type": "string",
            "const": "ok"
          },
          "allow": {
            "type": "integer",
            "description": "1 разрешает списание, 0 запрещает его.",
            "enum": [
              0,
              1
            ]
          },
          "amount": {
            "type": "integer",
            "description": "Новая сумма в минорных единицах."
          },
          "message": {
            "type": "string",
            "description": "Сообщение плательщику."
          }
        }
      },
      "NotificationError": {
        "type": "object",
        "required": [
          "result"
        ],
        "properties": {
          "result": {
            "type": "string",
            "not": {
              "const": "ok"
            }
          },
          "error_description": {
            "type": "string",
            "description": "Описание ошибки обработки уведомления."
          }
        }
      },
      "DirectPaymentRequest": {
        "type": "object",
        "required": [
          "api_version",
          "project_id",
          "amount",
          "signature"
        ],
        "properties": {
          "api_version": {
            "$ref": "#/components/schemas/CreatePaymentFormRequest/properties/api_version"
          },
          "project_id": {
            "$ref": "#/components/schemas/CreatePaymentFormRequest/properties/project_id"
          },
          "amount": {
            "$ref": "#/components/schemas/CreatePaymentFormRequest/properties/amount"
          },
          "signature": {
            "$ref": "#/components/schemas/CreatePaymentFormRequest/properties/signature"
          },
          "description": {
            "$ref": "#/components/schemas/CreatePaymentFormRequest/properties/description"
          },
          "request_id": {
            "$ref": "#/components/schemas/CreatePaymentFormRequest/properties/request_id"
          },
          "payment_method": {
            "$ref": "#/components/schemas/CreatePaymentFormRequest/properties/payment_method"
          },
          "merchant_payment_id": {
            "$ref": "#/components/schemas/CreatePaymentFormRequest/properties/merchant_payment_id"
          },
          "merchant_campaign_id": {
            "$ref": "#/components/schemas/CreatePaymentFormRequest/properties/merchant_campaign_id"
          },
          "merchant_data": {
            "$ref": "#/components/schemas/CreatePaymentFormRequest/properties/merchant_data"
          },
          "merchant_fields": {
            "$ref": "#/components/schemas/CreatePaymentFormRequest/properties/merchant_fields"
          },
          "user_email": {
            "$ref": "#/components/schemas/CreatePaymentFormRequest/properties/user_email"
          },
          "user_name": {
            "$ref": "#/components/schemas/CreatePaymentFormRequest/properties/user_name"
          },
          "user_phone": {
            "$ref": "#/components/schemas/CreatePaymentFormRequest/properties/user_phone"
          },
          "user_comment": {
            "$ref": "#/components/schemas/CreatePaymentFormRequest/properties/user_comment"
          },
          "user_account_id": {
            "$ref": "#/components/schemas/CreatePaymentFormRequest/properties/user_account_id"
          },
          "test": {
            "$ref": "#/components/schemas/CreatePaymentFormRequest/properties/test"
          },
          "timeout": {
            "$ref": "#/components/schemas/CreatePaymentFormRequest/properties/timeout"
          },
          "language": {
            "$ref": "#/components/schemas/CreatePaymentFormRequest/properties/language"
          },
          "currency": {
            "$ref": "#/components/schemas/CreatePaymentFormRequest/properties/currency"
          },
          "items": {
            "$ref": "#/components/schemas/CreatePaymentFormRequest/properties/items"
          },
          "recurrent_payment": {
            "$ref": "#/components/schemas/CreatePaymentFormRequest/properties/recurrent_payment"
          },
          "payment_scheme": {
            "$ref": "#/components/schemas/CreatePaymentFormRequest/properties/payment_scheme"
          },
          "utm_medium": {
            "$ref": "#/components/schemas/CreatePaymentFormRequest/properties/utm_medium"
          },
          "utm_source": {
            "$ref": "#/components/schemas/CreatePaymentFormRequest/properties/utm_source"
          },
          "utm_campaign": {
            "$ref": "#/components/schemas/CreatePaymentFormRequest/properties/utm_campaign"
          },
          "utm_term": {
            "$ref": "#/components/schemas/CreatePaymentFormRequest/properties/utm_term"
          },
          "redirect_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Адрес возврата плательщика после ввода кода 3-D Secure. Обязателен при payment_method=card.",
            "format": "uri"
          }
        },
        "allOf": [
          {
            "if": {
              "required": [
                "payment_method"
              ],
              "properties": {
                "payment_method": {
                  "const": "card"
                }
              }
            },
            "then": {
              "properties": {
                "amount": {
                  "minimum": 100,
                  "maximum": 100000000
                },
                "redirect_url": {
                  "type": "string"
                }
              },
              "required": [
                "redirect_url"
              ]
            }
          },
          {
            "if": {
              "required": [
                "payment_method"
              ],
              "properties": {
                "payment_method": {
                  "const": "mobile"
                }
              }
            },
            "then": {
              "properties": {
                "amount": {
                  "minimum": 1000,
                  "maximum": 1500000
                }
              }
            }
          }
        ]
      },
      "DirectPaymentSuccess": {
        "type": "object",
        "required": [
          "result",
          "payment_id"
        ],
        "properties": {
          "result": {
            "type": "string",
            "const": "ok"
          },
          "payment_id": {
            "$ref": "#/components/schemas/PaymentId"
          },
          "recurrent_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "ID привязанной карты при подключённом режиме подписки или рекуррентных платежей."
          },
          "redirect_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Адрес для следующего шага оплаты, если требуется.",
            "format": "uri"
          }
        }
      },
      "PhoneInfoRequest": {
        "type": "object",
        "required": [
          "api_version",
          "project_id",
          "user_phone",
          "signature"
        ],
        "properties": {
          "api_version": {
            "$ref": "#/components/schemas/ApiVersion"
          },
          "project_id": {
            "type": "integer",
            "description": "ID проекта Миксплата."
          },
          "user_phone": {
            "type": "string",
            "description": "Номер телефона в международном формате без плюса.",
            "pattern": "^[0-9]+$"
          },
          "signature": {
            "type": "string",
            "description": "MD5(project_id + user_phone + API_KEY). Соедините строковые значения без разделителей. Для отсутствующих необязательных полей используйте пустую строку.",
            "pattern": "^[a-fA-F0-9]{32}$"
          }
        }
      },
      "PhoneInfoSuccess": {
        "type": "object",
        "required": [
          "result",
          "mobile_payment_active"
        ],
        "properties": {
          "result": {
            "type": "string",
            "const": "ok"
          },
          "mobile_payment_active": {
            "type": "integer",
            "description": "Доступна ли оплата со счёта телефона.",
            "enum": [
              0,
              1
            ]
          },
          "country": {
            "type": [
              "string",
              "null"
            ],
            "description": "Двухсимвольный код страны оператора."
          },
          "operator": {
            "type": "string",
            "description": "Наименование оператора."
          },
          "mccmnc": {
            "type": "integer",
            "description": "Код мобильного оператора MCCMNC."
          },
          "region": {
            "type": "string",
            "description": "Регион номера."
          },
          "fee_user": {
            "type": [
              "number",
              "null"
            ],
            "description": "Комиссия плательщика в процентах."
          },
          "fee_merchant": {
            "type": [
              "number",
              "null"
            ],
            "description": "Комиссия продавца в процентах."
          }
        }
      },
      "IncomingSms": {
        "type": "object",
        "required": [
          "api_version",
          "request",
          "project_id",
          "sms_id",
          "user_phone",
          "mobile",
          "signature"
        ],
        "properties": {
          "api_version": {
            "$ref": "#/components/schemas/ApiVersion"
          },
          "request": {
            "type": "string",
            "const": "sms"
          },
          "project_id": {
            "type": "integer",
            "description": "ID проекта Миксплата."
          },
          "date_created": {
            "type": "string",
            "description": "Время создания SMS по UTC+03:00, YYYY-MM-DD HH:MM:SS."
          },
          "sms_id": {
            "type": "integer",
            "description": "ID входящего сообщения в Миксплате."
          },
          "parts": {
            "type": "integer",
            "description": "Количество частей сообщения."
          },
          "user_phone": {
            "type": "string",
            "description": "Номер телефона в международном формате без плюса.",
            "pattern": "^[0-9]+$"
          },
          "mobile": {
            "allOf": [
              {
                "$ref": "#/components/schemas/MobileDetails"
              },
              {
                "type": "object"
              }
            ]
          },
          "signature": {
            "type": "string",
            "description": "MD5(sms_id + API_KEY). Соедините строковые значения без разделителей. Для отсутствующих необязательных полей используйте пустую строку.",
            "pattern": "^[a-fA-F0-9]{32}$"
          }
        }
      },
      "CreateSmsRequest": {
        "type": "object",
        "required": [
          "api_version",
          "project_id",
          "user_phone",
          "message",
          "signature"
        ],
        "properties": {
          "api_version": {
            "$ref": "#/components/schemas/ApiVersion"
          },
          "request_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Ключ идемпотентности отправки. Повтор с тем же значением в течение 30 дней возвращает исходный ответ.",
            "minLength": 1,
            "maxLength": 64
          },
          "sms_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "ID входящего SMS для асинхронного ответа."
          },
          "project_id": {
            "type": "integer",
            "description": "ID проекта Миксплата."
          },
          "user_phone": {
            "type": "string",
            "description": "Номер телефона в международном формате без плюса.",
            "pattern": "^[0-9]+$"
          },
          "message": {
            "type": "string",
            "description": "Текст сообщения."
          },
          "sender": {
            "type": [
              "string",
              "null"
            ],
            "description": "Альфа-имя отправителя. По умолчанию берётся из настроек проекта.",
            "pattern": "^[A-Za-z0-9]+$"
          },
          "signature": {
            "type": "string",
            "description": "MD5(request_id + project_id + API_KEY). Соедините строковые значения без разделителей. Для отсутствующих необязательных полей используйте пустую строку.",
            "pattern": "^[a-fA-F0-9]{32}$"
          }
        }
      },
      "CreateSmsSuccess": {
        "type": "object",
        "required": [
          "result",
          "mobile"
        ],
        "properties": {
          "result": {
            "type": "string",
            "const": "ok"
          },
          "mobile": {
            "allOf": [
              {
                "$ref": "#/components/schemas/MobileDetails"
              },
              {
                "type": "object"
              }
            ]
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "Платежи"
    },
    {
      "name": "Возвраты"
    },
    {
      "name": "Подписки и рекуррентные платежи"
    },
    {
      "name": "Двухэтапные платежи"
    },
    {
      "name": "Расширения API"
    }
  ]
}
