{
    "openapi":  "3.1.0",
    "info":  {
                 "title":  "Aegis scoped business API",
                 "version":  "0.1.0",
                 "description":  "Contracts implemented by backend/cmd/aegis-web/developer_http.go and partners_http.go. This document covers the owned-account SDK subset, not admin or cabinet authentication. Monetary values are integer RUB minor units; shares are basis points. Features may be disabled by deployment configuration."
             },
    "servers":  [
                    {
                        "url":  "https://edge.vpnaegis.com",
                        "description":  "RF business edge"
                    }
                ],
    "security":  [
                     {
                         "ScopedKey":  [

                                       ]
                     }
                 ],
    "paths":  {
                  "/api/developer/account":  {
                                                 "get":  {
                                                             "operationId":  "getAccount",
                                                             "description":  "Only the account owning the scoped key.",
                                                             "x-aegis-required-scope":  "account:read",
                                                             "responses":  {
                                                                               "200":  {
                                                                                           "description":  "Success.",
                                                                                           "content":  {
                                                                                                           "application/json":  {
                                                                                                                                    "schema":  {
                                                                                                                                                   "$ref":  "#/components/schemas/Account"
                                                                                                                                               }
                                                                                                                                }
                                                                                                       }
                                                                                       },
                                                                               "400":  {
                                                                                           "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                           "content":  {
                                                                                                           "application/json":  {
                                                                                                                                    "schema":  {
                                                                                                                                                   "$ref":  "#/components/schemas/Error"
                                                                                                                                               }
                                                                                                                                }
                                                                                                       }
                                                                                       },
                                                                               "401":  {
                                                                                           "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                           "content":  {
                                                                                                           "application/json":  {
                                                                                                                                    "schema":  {
                                                                                                                                                   "$ref":  "#/components/schemas/Error"
                                                                                                                                               }
                                                                                                                                }
                                                                                                       }
                                                                                       },
                                                                               "403":  {
                                                                                           "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                           "content":  {
                                                                                                           "application/json":  {
                                                                                                                                    "schema":  {
                                                                                                                                                   "$ref":  "#/components/schemas/Error"
                                                                                                                                               }
                                                                                                                                }
                                                                                                       }
                                                                                       },
                                                                               "404":  {
                                                                                           "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                           "content":  {
                                                                                                           "application/json":  {
                                                                                                                                    "schema":  {
                                                                                                                                                   "$ref":  "#/components/schemas/Error"
                                                                                                                                               }
                                                                                                                                }
                                                                                                       }
                                                                                       },
                                                                               "409":  {
                                                                                           "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                           "content":  {
                                                                                                           "application/json":  {
                                                                                                                                    "schema":  {
                                                                                                                                                   "$ref":  "#/components/schemas/Error"
                                                                                                                                               }
                                                                                                                                }
                                                                                                       }
                                                                                       },
                                                                               "429":  {
                                                                                           "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                           "content":  {
                                                                                                           "application/json":  {
                                                                                                                                    "schema":  {
                                                                                                                                                   "$ref":  "#/components/schemas/Error"
                                                                                                                                               }
                                                                                                                                }
                                                                                                       }
                                                                                       },
                                                                               "503":  {
                                                                                           "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                           "content":  {
                                                                                                           "application/json":  {
                                                                                                                                    "schema":  {
                                                                                                                                                   "$ref":  "#/components/schemas/Error"
                                                                                                                                               }
                                                                                                                                }
                                                                                                       }
                                                                                       },
                                                                               "502":  {
                                                                                           "description":  "Upstream temporarily unavailable; error is a safe code.",
                                                                                           "content":  {
                                                                                                           "application/json":  {
                                                                                                                                    "schema":  {
                                                                                                                                                   "$ref":  "#/components/schemas/Error"
                                                                                                                                               }
                                                                                                                                }
                                                                                                       }
                                                                                       }
                                                                           }
                                                         }
                                             },
                  "/api/developer/devices":  {
                                                 "get":  {
                                                             "operationId":  "listDevices",
                                                             "description":  "Only devices owned by the scoped key account.",
                                                             "x-aegis-required-scope":  "devices:read",
                                                             "responses":  {
                                                                               "200":  {
                                                                                           "description":  "Success.",
                                                                                           "content":  {
                                                                                                           "application/json":  {
                                                                                                                                    "schema":  {
                                                                                                                                                   "$ref":  "#/components/schemas/Devices"
                                                                                                                                               }
                                                                                                                                }
                                                                                                       }
                                                                                       },
                                                                               "400":  {
                                                                                           "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                           "content":  {
                                                                                                           "application/json":  {
                                                                                                                                    "schema":  {
                                                                                                                                                   "$ref":  "#/components/schemas/Error"
                                                                                                                                               }
                                                                                                                                }
                                                                                                       }
                                                                                       },
                                                                               "401":  {
                                                                                           "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                           "content":  {
                                                                                                           "application/json":  {
                                                                                                                                    "schema":  {
                                                                                                                                                   "$ref":  "#/components/schemas/Error"
                                                                                                                                               }
                                                                                                                                }
                                                                                                       }
                                                                                       },
                                                                               "403":  {
                                                                                           "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                           "content":  {
                                                                                                           "application/json":  {
                                                                                                                                    "schema":  {
                                                                                                                                                   "$ref":  "#/components/schemas/Error"
                                                                                                                                               }
                                                                                                                                }
                                                                                                       }
                                                                                       },
                                                                               "404":  {
                                                                                           "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                           "content":  {
                                                                                                           "application/json":  {
                                                                                                                                    "schema":  {
                                                                                                                                                   "$ref":  "#/components/schemas/Error"
                                                                                                                                               }
                                                                                                                                }
                                                                                                       }
                                                                                       },
                                                                               "409":  {
                                                                                           "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                           "content":  {
                                                                                                           "application/json":  {
                                                                                                                                    "schema":  {
                                                                                                                                                   "$ref":  "#/components/schemas/Error"
                                                                                                                                               }
                                                                                                                                }
                                                                                                       }
                                                                                       },
                                                                               "429":  {
                                                                                           "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                           "content":  {
                                                                                                           "application/json":  {
                                                                                                                                    "schema":  {
                                                                                                                                                   "$ref":  "#/components/schemas/Error"
                                                                                                                                               }
                                                                                                                                }
                                                                                                       }
                                                                                       },
                                                                               "503":  {
                                                                                           "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                           "content":  {
                                                                                                           "application/json":  {
                                                                                                                                    "schema":  {
                                                                                                                                                   "$ref":  "#/components/schemas/Error"
                                                                                                                                               }
                                                                                                                                }
                                                                                                       }
                                                                                       },
                                                                               "502":  {
                                                                                           "description":  "Upstream temporarily unavailable; error is a safe code.",
                                                                                           "content":  {
                                                                                                           "application/json":  {
                                                                                                                                    "schema":  {
                                                                                                                                                   "$ref":  "#/components/schemas/Error"
                                                                                                                                               }
                                                                                                                                }
                                                                                                       }
                                                                                       }
                                                                           }
                                                         }
                                             },
                  "/api/developer/devices/{id}":  {
                                                      "delete":  {
                                                                     "operationId":  "revokeDevice",
                                                                     "description":  "Revoke one owned device; never automatically retry.",
                                                                     "x-aegis-required-scope":  "devices:revoke",
                                                                     "parameters":  [
                                                                                        {
                                                                                            "name":  "id",
                                                                                            "in":  "path",
                                                                                            "required":  true,
                                                                                            "schema":  {
                                                                                                           "type":  "string",
                                                                                                           "minLength":  1,
                                                                                                           "maxLength":  128
                                                                                                       }
                                                                                        }
                                                                                    ],
                                                                     "responses":  {
                                                                                       "204":  {
                                                                                                   "description":  "Owned device revoked."
                                                                                               },
                                                                                       "400":  {
                                                                                                   "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                                   "content":  {
                                                                                                                   "application/json":  {
                                                                                                                                            "schema":  {
                                                                                                                                                           "$ref":  "#/components/schemas/Error"
                                                                                                                                                       }
                                                                                                                                        }
                                                                                                               }
                                                                                               },
                                                                                       "401":  {
                                                                                                   "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                                   "content":  {
                                                                                                                   "application/json":  {
                                                                                                                                            "schema":  {
                                                                                                                                                           "$ref":  "#/components/schemas/Error"
                                                                                                                                                       }
                                                                                                                                        }
                                                                                                               }
                                                                                               },
                                                                                       "403":  {
                                                                                                   "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                                   "content":  {
                                                                                                                   "application/json":  {
                                                                                                                                            "schema":  {
                                                                                                                                                           "$ref":  "#/components/schemas/Error"
                                                                                                                                                       }
                                                                                                                                        }
                                                                                                               }
                                                                                               },
                                                                                       "404":  {
                                                                                                   "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                                   "content":  {
                                                                                                                   "application/json":  {
                                                                                                                                            "schema":  {
                                                                                                                                                           "$ref":  "#/components/schemas/Error"
                                                                                                                                                       }
                                                                                                                                        }
                                                                                                               }
                                                                                               },
                                                                                       "409":  {
                                                                                                   "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                                   "content":  {
                                                                                                                   "application/json":  {
                                                                                                                                            "schema":  {
                                                                                                                                                           "$ref":  "#/components/schemas/Error"
                                                                                                                                                       }
                                                                                                                                        }
                                                                                                               }
                                                                                               },
                                                                                       "429":  {
                                                                                                   "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                                   "content":  {
                                                                                                                   "application/json":  {
                                                                                                                                            "schema":  {
                                                                                                                                                           "$ref":  "#/components/schemas/Error"
                                                                                                                                                       }
                                                                                                                                        }
                                                                                                               }
                                                                                               },
                                                                                       "503":  {
                                                                                                   "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                                   "content":  {
                                                                                                                   "application/json":  {
                                                                                                                                            "schema":  {
                                                                                                                                                           "$ref":  "#/components/schemas/Error"
                                                                                                                                                       }
                                                                                                                                        }
                                                                                                               }
                                                                                               },
                                                                                       "502":  {
                                                                                                   "description":  "Upstream temporarily unavailable; error is a safe code.",
                                                                                                   "content":  {
                                                                                                                   "application/json":  {
                                                                                                                                            "schema":  {
                                                                                                                                                           "$ref":  "#/components/schemas/Error"
                                                                                                                                                       }
                                                                                                                                        }
                                                                                                               }
                                                                                               }
                                                                                   }
                                                                 }
                                                  },
                  "/api/partners/summary":  {
                                                "get":  {
                                                            "operationId":  "getPartnerSummary",
                                                            "description":  "Current terms and full aggregate counters; a disabled module may return only enabled=false and mode=off.",
                                                            "x-aegis-required-scope":  "partners:read",
                                                            "responses":  {
                                                                              "200":  {
                                                                                          "description":  "Success.",
                                                                                          "content":  {
                                                                                                          "application/json":  {
                                                                                                                                   "schema":  {
                                                                                                                                                  "$ref":  "#/components/schemas/PartnerSummary"
                                                                                                                                              }
                                                                                                                               }
                                                                                                      }
                                                                                      },
                                                                              "400":  {
                                                                                          "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                          "content":  {
                                                                                                          "application/json":  {
                                                                                                                                   "schema":  {
                                                                                                                                                  "$ref":  "#/components/schemas/Error"
                                                                                                                                              }
                                                                                                                               }
                                                                                                      }
                                                                                      },
                                                                              "401":  {
                                                                                          "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                          "content":  {
                                                                                                          "application/json":  {
                                                                                                                                   "schema":  {
                                                                                                                                                  "$ref":  "#/components/schemas/Error"
                                                                                                                                              }
                                                                                                                               }
                                                                                                      }
                                                                                      },
                                                                              "403":  {
                                                                                          "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                          "content":  {
                                                                                                          "application/json":  {
                                                                                                                                   "schema":  {
                                                                                                                                                  "$ref":  "#/components/schemas/Error"
                                                                                                                                              }
                                                                                                                               }
                                                                                                      }
                                                                                      },
                                                                              "404":  {
                                                                                          "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                          "content":  {
                                                                                                          "application/json":  {
                                                                                                                                   "schema":  {
                                                                                                                                                  "$ref":  "#/components/schemas/Error"
                                                                                                                                              }
                                                                                                                               }
                                                                                                      }
                                                                                      },
                                                                              "409":  {
                                                                                          "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                          "content":  {
                                                                                                          "application/json":  {
                                                                                                                                   "schema":  {
                                                                                                                                                  "$ref":  "#/components/schemas/Error"
                                                                                                                                              }
                                                                                                                               }
                                                                                                      }
                                                                                      },
                                                                              "429":  {
                                                                                          "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                          "content":  {
                                                                                                          "application/json":  {
                                                                                                                                   "schema":  {
                                                                                                                                                  "$ref":  "#/components/schemas/Error"
                                                                                                                                              }
                                                                                                                               }
                                                                                                      }
                                                                                      },
                                                                              "503":  {
                                                                                          "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                          "content":  {
                                                                                                          "application/json":  {
                                                                                                                                   "schema":  {
                                                                                                                                                  "$ref":  "#/components/schemas/Error"
                                                                                                                                              }
                                                                                                                               }
                                                                                                      }
                                                                                      },
                                                                              "502":  {
                                                                                          "description":  "Upstream temporarily unavailable; error is a safe code.",
                                                                                          "content":  {
                                                                                                          "application/json":  {
                                                                                                                                   "schema":  {
                                                                                                                                                  "$ref":  "#/components/schemas/Error"
                                                                                                                                              }
                                                                                                                               }
                                                                                                      }
                                                                                      }
                                                                          }
                                                        }
                                            },
                  "/api/partners/sales":  {
                                              "get":  {
                                                          "operationId":  "listPartnerSales",
                                                          "description":  "Latest 100 owned sales.",
                                                          "x-aegis-required-scope":  "partners:read",
                                                          "responses":  {
                                                                            "200":  {
                                                                                        "description":  "Success.",
                                                                                        "content":  {
                                                                                                        "application/json":  {
                                                                                                                                 "schema":  {
                                                                                                                                                "$ref":  "#/components/schemas/Sales"
                                                                                                                                            }
                                                                                                                             }
                                                                                                    }
                                                                                    },
                                                                            "400":  {
                                                                                        "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                        "content":  {
                                                                                                        "application/json":  {
                                                                                                                                 "schema":  {
                                                                                                                                                "$ref":  "#/components/schemas/Error"
                                                                                                                                            }
                                                                                                                             }
                                                                                                    }
                                                                                    },
                                                                            "401":  {
                                                                                        "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                        "content":  {
                                                                                                        "application/json":  {
                                                                                                                                 "schema":  {
                                                                                                                                                "$ref":  "#/components/schemas/Error"
                                                                                                                                            }
                                                                                                                             }
                                                                                                    }
                                                                                    },
                                                                            "403":  {
                                                                                        "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                        "content":  {
                                                                                                        "application/json":  {
                                                                                                                                 "schema":  {
                                                                                                                                                "$ref":  "#/components/schemas/Error"
                                                                                                                                            }
                                                                                                                             }
                                                                                                    }
                                                                                    },
                                                                            "404":  {
                                                                                        "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                        "content":  {
                                                                                                        "application/json":  {
                                                                                                                                 "schema":  {
                                                                                                                                                "$ref":  "#/components/schemas/Error"
                                                                                                                                            }
                                                                                                                             }
                                                                                                    }
                                                                                    },
                                                                            "409":  {
                                                                                        "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                        "content":  {
                                                                                                        "application/json":  {
                                                                                                                                 "schema":  {
                                                                                                                                                "$ref":  "#/components/schemas/Error"
                                                                                                                                            }
                                                                                                                             }
                                                                                                    }
                                                                                    },
                                                                            "429":  {
                                                                                        "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                        "content":  {
                                                                                                        "application/json":  {
                                                                                                                                 "schema":  {
                                                                                                                                                "$ref":  "#/components/schemas/Error"
                                                                                                                                            }
                                                                                                                             }
                                                                                                    }
                                                                                    },
                                                                            "503":  {
                                                                                        "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                        "content":  {
                                                                                                        "application/json":  {
                                                                                                                                 "schema":  {
                                                                                                                                                "$ref":  "#/components/schemas/Error"
                                                                                                                                            }
                                                                                                                             }
                                                                                                    }
                                                                                    },
                                                                            "502":  {
                                                                                        "description":  "Upstream temporarily unavailable; error is a safe code.",
                                                                                        "content":  {
                                                                                                        "application/json":  {
                                                                                                                                 "schema":  {
                                                                                                                                                "$ref":  "#/components/schemas/Error"
                                                                                                                                            }
                                                                                                                             }
                                                                                                    }
                                                                                    }
                                                                        }
                                                      }
                                          },
                  "/api/partners/payouts":  {
                                                "get":  {
                                                            "operationId":  "listPartnerPayouts",
                                                            "description":  "Latest 100 owned payouts; wallet addresses are masked.",
                                                            "x-aegis-required-scope":  "partners:read",
                                                            "responses":  {
                                                                              "200":  {
                                                                                          "description":  "Success.",
                                                                                          "content":  {
                                                                                                          "application/json":  {
                                                                                                                                   "schema":  {
                                                                                                                                                  "$ref":  "#/components/schemas/Payouts"
                                                                                                                                              }
                                                                                                                               }
                                                                                                      }
                                                                                      },
                                                                              "400":  {
                                                                                          "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                          "content":  {
                                                                                                          "application/json":  {
                                                                                                                                   "schema":  {
                                                                                                                                                  "$ref":  "#/components/schemas/Error"
                                                                                                                                              }
                                                                                                                               }
                                                                                                      }
                                                                                      },
                                                                              "401":  {
                                                                                          "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                          "content":  {
                                                                                                          "application/json":  {
                                                                                                                                   "schema":  {
                                                                                                                                                  "$ref":  "#/components/schemas/Error"
                                                                                                                                              }
                                                                                                                               }
                                                                                                      }
                                                                                      },
                                                                              "403":  {
                                                                                          "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                          "content":  {
                                                                                                          "application/json":  {
                                                                                                                                   "schema":  {
                                                                                                                                                  "$ref":  "#/components/schemas/Error"
                                                                                                                                              }
                                                                                                                               }
                                                                                                      }
                                                                                      },
                                                                              "404":  {
                                                                                          "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                          "content":  {
                                                                                                          "application/json":  {
                                                                                                                                   "schema":  {
                                                                                                                                                  "$ref":  "#/components/schemas/Error"
                                                                                                                                              }
                                                                                                                               }
                                                                                                      }
                                                                                      },
                                                                              "409":  {
                                                                                          "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                          "content":  {
                                                                                                          "application/json":  {
                                                                                                                                   "schema":  {
                                                                                                                                                  "$ref":  "#/components/schemas/Error"
                                                                                                                                              }
                                                                                                                               }
                                                                                                      }
                                                                                      },
                                                                              "429":  {
                                                                                          "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                          "content":  {
                                                                                                          "application/json":  {
                                                                                                                                   "schema":  {
                                                                                                                                                  "$ref":  "#/components/schemas/Error"
                                                                                                                                              }
                                                                                                                               }
                                                                                                      }
                                                                                      },
                                                                              "503":  {
                                                                                          "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                          "content":  {
                                                                                                          "application/json":  {
                                                                                                                                   "schema":  {
                                                                                                                                                  "$ref":  "#/components/schemas/Error"
                                                                                                                                              }
                                                                                                                               }
                                                                                                      }
                                                                                      },
                                                                              "502":  {
                                                                                          "description":  "Upstream temporarily unavailable; error is a safe code.",
                                                                                          "content":  {
                                                                                                          "application/json":  {
                                                                                                                                   "schema":  {
                                                                                                                                                  "$ref":  "#/components/schemas/Error"
                                                                                                                                              }
                                                                                                                               }
                                                                                                      }
                                                                                      }
                                                                          }
                                                        },
                                                "post":  {
                                                             "operationId":  "requestPayout",
                                                             "description":  "Reserve funds for manual payout review. confirmed means request accepted, not a completed blockchain transaction. Requires owner acceptance of current terms.",
                                                             "x-aegis-required-scope":  "payouts:request",
                                                             "requestBody":  {
                                                                                 "required":  true,
                                                                                 "content":  {
                                                                                                 "application/json":  {
                                                                                                                          "schema":  {
                                                                                                                                         "$ref":  "#/components/schemas/PayoutRequest"
                                                                                                                                     }
                                                                                                                      }
                                                                                             }
                                                                             },
                                                             "responses":  {
                                                                               "200":  {
                                                                                           "description":  "Success.",
                                                                                           "content":  {
                                                                                                           "application/json":  {
                                                                                                                                    "schema":  {
                                                                                                                                                   "$ref":  "#/components/schemas/Operation"
                                                                                                                                               }
                                                                                                                                }
                                                                                                       }
                                                                                       },
                                                                               "400":  {
                                                                                           "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                           "content":  {
                                                                                                           "application/json":  {
                                                                                                                                    "schema":  {
                                                                                                                                                   "$ref":  "#/components/schemas/Error"
                                                                                                                                               }
                                                                                                                                }
                                                                                                       }
                                                                                       },
                                                                               "401":  {
                                                                                           "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                           "content":  {
                                                                                                           "application/json":  {
                                                                                                                                    "schema":  {
                                                                                                                                                   "$ref":  "#/components/schemas/Error"
                                                                                                                                               }
                                                                                                                                }
                                                                                                       }
                                                                                       },
                                                                               "403":  {
                                                                                           "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                           "content":  {
                                                                                                           "application/json":  {
                                                                                                                                    "schema":  {
                                                                                                                                                   "$ref":  "#/components/schemas/Error"
                                                                                                                                               }
                                                                                                                                }
                                                                                                       }
                                                                                       },
                                                                               "404":  {
                                                                                           "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                           "content":  {
                                                                                                           "application/json":  {
                                                                                                                                    "schema":  {
                                                                                                                                                   "$ref":  "#/components/schemas/Error"
                                                                                                                                               }
                                                                                                                                }
                                                                                                       }
                                                                                       },
                                                                               "409":  {
                                                                                           "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                           "content":  {
                                                                                                           "application/json":  {
                                                                                                                                    "schema":  {
                                                                                                                                                   "$ref":  "#/components/schemas/Error"
                                                                                                                                               }
                                                                                                                                }
                                                                                                       }
                                                                                       },
                                                                               "429":  {
                                                                                           "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                           "content":  {
                                                                                                           "application/json":  {
                                                                                                                                    "schema":  {
                                                                                                                                                   "$ref":  "#/components/schemas/Error"
                                                                                                                                               }
                                                                                                                                }
                                                                                                       }
                                                                                       },
                                                                               "503":  {
                                                                                           "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                           "content":  {
                                                                                                           "application/json":  {
                                                                                                                                    "schema":  {
                                                                                                                                                   "$ref":  "#/components/schemas/Error"
                                                                                                                                               }
                                                                                                                                }
                                                                                                       }
                                                                                       },
                                                                               "502":  {
                                                                                           "description":  "Upstream temporarily unavailable; error is a safe code.",
                                                                                           "content":  {
                                                                                                           "application/json":  {
                                                                                                                                    "schema":  {
                                                                                                                                                   "$ref":  "#/components/schemas/Error"
                                                                                                                                               }
                                                                                                                                }
                                                                                                       }
                                                                                       }
                                                                           }
                                                         }
                                            },
                  "/api/partners/operations/{uuid}":  {
                                                          "get":  {
                                                                      "operationId":  "getPartnerOperation",
                                                                      "description":  "Reconcile a caller-owned UUID. not_found does not prove that a previous network request will never arrive.",
                                                                      "x-aegis-required-scope":  "partners:read",
                                                                      "parameters":  [
                                                                                         {
                                                                                             "name":  "uuid",
                                                                                             "in":  "path",
                                                                                             "required":  true,
                                                                                             "schema":  {
                                                                                                            "type":  "string",
                                                                                                            "format":  "uuid",
                                                                                                            "minLength":  36,
                                                                                                            "maxLength":  36
                                                                                                        }
                                                                                         }
                                                                                     ],
                                                                      "responses":  {
                                                                                        "200":  {
                                                                                                    "description":  "Success.",
                                                                                                    "content":  {
                                                                                                                    "application/json":  {
                                                                                                                                             "schema":  {
                                                                                                                                                            "$ref":  "#/components/schemas/Operation"
                                                                                                                                                        }
                                                                                                                                         }
                                                                                                                }
                                                                                                },
                                                                                        "400":  {
                                                                                                    "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                                    "content":  {
                                                                                                                    "application/json":  {
                                                                                                                                             "schema":  {
                                                                                                                                                            "$ref":  "#/components/schemas/Error"
                                                                                                                                                        }
                                                                                                                                         }
                                                                                                                }
                                                                                                },
                                                                                        "401":  {
                                                                                                    "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                                    "content":  {
                                                                                                                    "application/json":  {
                                                                                                                                             "schema":  {
                                                                                                                                                            "$ref":  "#/components/schemas/Error"
                                                                                                                                                        }
                                                                                                                                         }
                                                                                                                }
                                                                                                },
                                                                                        "403":  {
                                                                                                    "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                                    "content":  {
                                                                                                                    "application/json":  {
                                                                                                                                             "schema":  {
                                                                                                                                                            "$ref":  "#/components/schemas/Error"
                                                                                                                                                        }
                                                                                                                                         }
                                                                                                                }
                                                                                                },
                                                                                        "404":  {
                                                                                                    "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                                    "content":  {
                                                                                                                    "application/json":  {
                                                                                                                                             "schema":  {
                                                                                                                                                            "$ref":  "#/components/schemas/Error"
                                                                                                                                                        }
                                                                                                                                         }
                                                                                                                }
                                                                                                },
                                                                                        "409":  {
                                                                                                    "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                                    "content":  {
                                                                                                                    "application/json":  {
                                                                                                                                             "schema":  {
                                                                                                                                                            "$ref":  "#/components/schemas/Error"
                                                                                                                                                        }
                                                                                                                                         }
                                                                                                                }
                                                                                                },
                                                                                        "429":  {
                                                                                                    "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                                    "content":  {
                                                                                                                    "application/json":  {
                                                                                                                                             "schema":  {
                                                                                                                                                            "$ref":  "#/components/schemas/Error"
                                                                                                                                                        }
                                                                                                                                         }
                                                                                                                }
                                                                                                },
                                                                                        "503":  {
                                                                                                    "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                                    "content":  {
                                                                                                                    "application/json":  {
                                                                                                                                             "schema":  {
                                                                                                                                                            "$ref":  "#/components/schemas/Error"
                                                                                                                                                        }
                                                                                                                                         }
                                                                                                                }
                                                                                                },
                                                                                        "502":  {
                                                                                                    "description":  "Upstream temporarily unavailable; error is a safe code.",
                                                                                                    "content":  {
                                                                                                                    "application/json":  {
                                                                                                                                             "schema":  {
                                                                                                                                                            "$ref":  "#/components/schemas/Error"
                                                                                                                                                        }
                                                                                                                                         }
                                                                                                                }
                                                                                                }
                                                                                    }
                                                                  }
                                                      },
                  "/api/partners/service":  {
                                                "post":  {
                                                             "operationId":  "createManagedService",
                                                             "description":  "Create the owner\u0027s managed Aegis service and standard offers. Requires owner acceptance of current terms.",
                                                             "x-aegis-required-scope":  "partners:write",
                                                             "requestBody":  {
                                                                                 "required":  true,
                                                                                 "content":  {
                                                                                                 "application/json":  {
                                                                                                                          "schema":  {
                                                                                                                                         "$ref":  "#/components/schemas/CreateServiceRequest"
                                                                                                                                     }
                                                                                                                      }
                                                                                             }
                                                                             },
                                                             "responses":  {
                                                                               "200":  {
                                                                                           "description":  "Success.",
                                                                                           "content":  {
                                                                                                           "application/json":  {
                                                                                                                                    "schema":  {
                                                                                                                                                   "$ref":  "#/components/schemas/Operation"
                                                                                                                                               }
                                                                                                                                }
                                                                                                       }
                                                                                       },
                                                                               "400":  {
                                                                                           "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                           "content":  {
                                                                                                           "application/json":  {
                                                                                                                                    "schema":  {
                                                                                                                                                   "$ref":  "#/components/schemas/Error"
                                                                                                                                               }
                                                                                                                                }
                                                                                                       }
                                                                                       },
                                                                               "401":  {
                                                                                           "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                           "content":  {
                                                                                                           "application/json":  {
                                                                                                                                    "schema":  {
                                                                                                                                                   "$ref":  "#/components/schemas/Error"
                                                                                                                                               }
                                                                                                                                }
                                                                                                       }
                                                                                       },
                                                                               "403":  {
                                                                                           "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                           "content":  {
                                                                                                           "application/json":  {
                                                                                                                                    "schema":  {
                                                                                                                                                   "$ref":  "#/components/schemas/Error"
                                                                                                                                               }
                                                                                                                                }
                                                                                                       }
                                                                                       },
                                                                               "404":  {
                                                                                           "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                           "content":  {
                                                                                                           "application/json":  {
                                                                                                                                    "schema":  {
                                                                                                                                                   "$ref":  "#/components/schemas/Error"
                                                                                                                                               }
                                                                                                                                }
                                                                                                       }
                                                                                       },
                                                                               "409":  {
                                                                                           "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                           "content":  {
                                                                                                           "application/json":  {
                                                                                                                                    "schema":  {
                                                                                                                                                   "$ref":  "#/components/schemas/Error"
                                                                                                                                               }
                                                                                                                                }
                                                                                                       }
                                                                                       },
                                                                               "429":  {
                                                                                           "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                           "content":  {
                                                                                                           "application/json":  {
                                                                                                                                    "schema":  {
                                                                                                                                                   "$ref":  "#/components/schemas/Error"
                                                                                                                                               }
                                                                                                                                }
                                                                                                       }
                                                                                       },
                                                                               "503":  {
                                                                                           "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                           "content":  {
                                                                                                           "application/json":  {
                                                                                                                                    "schema":  {
                                                                                                                                                   "$ref":  "#/components/schemas/Error"
                                                                                                                                               }
                                                                                                                                }
                                                                                                       }
                                                                                       },
                                                                               "502":  {
                                                                                           "description":  "Upstream temporarily unavailable; error is a safe code.",
                                                                                           "content":  {
                                                                                                           "application/json":  {
                                                                                                                                    "schema":  {
                                                                                                                                                   "$ref":  "#/components/schemas/Error"
                                                                                                                                               }
                                                                                                                                }
                                                                                                       }
                                                                                       }
                                                                           }
                                                         }
                                            },
                  "/api/partners/service/status":  {
                                                       "post":  {
                                                                    "operationId":  "setManagedServiceStatus",
                                                                    "description":  "Pause or activate the owner\u0027s service. Requires owner acceptance of current terms.",
                                                                    "x-aegis-required-scope":  "partners:write",
                                                                    "requestBody":  {
                                                                                        "required":  true,
                                                                                        "content":  {
                                                                                                        "application/json":  {
                                                                                                                                 "schema":  {
                                                                                                                                                "$ref":  "#/components/schemas/ServiceStatusRequest"
                                                                                                                                            }
                                                                                                                             }
                                                                                                    }
                                                                                    },
                                                                    "responses":  {
                                                                                      "200":  {
                                                                                                  "description":  "Success.",
                                                                                                  "content":  {
                                                                                                                  "application/json":  {
                                                                                                                                           "schema":  {
                                                                                                                                                          "$ref":  "#/components/schemas/Operation"
                                                                                                                                                      }
                                                                                                                                       }
                                                                                                              }
                                                                                              },
                                                                                      "400":  {
                                                                                                  "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                                  "content":  {
                                                                                                                  "application/json":  {
                                                                                                                                           "schema":  {
                                                                                                                                                          "$ref":  "#/components/schemas/Error"
                                                                                                                                                      }
                                                                                                                                       }
                                                                                                              }
                                                                                              },
                                                                                      "401":  {
                                                                                                  "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                                  "content":  {
                                                                                                                  "application/json":  {
                                                                                                                                           "schema":  {
                                                                                                                                                          "$ref":  "#/components/schemas/Error"
                                                                                                                                                      }
                                                                                                                                       }
                                                                                                              }
                                                                                              },
                                                                                      "403":  {
                                                                                                  "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                                  "content":  {
                                                                                                                  "application/json":  {
                                                                                                                                           "schema":  {
                                                                                                                                                          "$ref":  "#/components/schemas/Error"
                                                                                                                                                      }
                                                                                                                                       }
                                                                                                              }
                                                                                              },
                                                                                      "404":  {
                                                                                                  "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                                  "content":  {
                                                                                                                  "application/json":  {
                                                                                                                                           "schema":  {
                                                                                                                                                          "$ref":  "#/components/schemas/Error"
                                                                                                                                                      }
                                                                                                                                       }
                                                                                                              }
                                                                                              },
                                                                                      "409":  {
                                                                                                  "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                                  "content":  {
                                                                                                                  "application/json":  {
                                                                                                                                           "schema":  {
                                                                                                                                                          "$ref":  "#/components/schemas/Error"
                                                                                                                                                      }
                                                                                                                                       }
                                                                                                              }
                                                                                              },
                                                                                      "429":  {
                                                                                                  "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                                  "content":  {
                                                                                                                  "application/json":  {
                                                                                                                                           "schema":  {
                                                                                                                                                          "$ref":  "#/components/schemas/Error"
                                                                                                                                                      }
                                                                                                                                       }
                                                                                                              }
                                                                                              },
                                                                                      "503":  {
                                                                                                  "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                                  "content":  {
                                                                                                                  "application/json":  {
                                                                                                                                           "schema":  {
                                                                                                                                                          "$ref":  "#/components/schemas/Error"
                                                                                                                                                      }
                                                                                                                                       }
                                                                                                              }
                                                                                              },
                                                                                      "502":  {
                                                                                                  "description":  "Upstream temporarily unavailable; error is a safe code.",
                                                                                                  "content":  {
                                                                                                                  "application/json":  {
                                                                                                                                           "schema":  {
                                                                                                                                                          "$ref":  "#/components/schemas/Error"
                                                                                                                                                      }
                                                                                                                                       }
                                                                                                              }
                                                                                              }
                                                                                  }
                                                                }
                                                   },
                  "/api/partners/terms/accept":  {
                                                     "post":  {
                                                                  "operationId":  "acceptPartnerTerms",
                                                                  "description":  "Record explicit owner acceptance of the current terms version; do not silently accept terms.",
                                                                  "x-aegis-required-scope":  "partners:write",
                                                                  "requestBody":  {
                                                                                      "required":  true,
                                                                                      "content":  {
                                                                                                      "application/json":  {
                                                                                                                               "schema":  {
                                                                                                                                              "$ref":  "#/components/schemas/Intent"
                                                                                                                                          }
                                                                                                                           }
                                                                                                  }
                                                                                  },
                                                                  "responses":  {
                                                                                    "200":  {
                                                                                                "description":  "Success.",
                                                                                                "content":  {
                                                                                                                "application/json":  {
                                                                                                                                         "schema":  {
                                                                                                                                                        "$ref":  "#/components/schemas/Operation"
                                                                                                                                                    }
                                                                                                                                     }
                                                                                                            }
                                                                                            },
                                                                                    "400":  {
                                                                                                "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                                "content":  {
                                                                                                                "application/json":  {
                                                                                                                                         "schema":  {
                                                                                                                                                        "$ref":  "#/components/schemas/Error"
                                                                                                                                                    }
                                                                                                                                     }
                                                                                                            }
                                                                                            },
                                                                                    "401":  {
                                                                                                "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                                "content":  {
                                                                                                                "application/json":  {
                                                                                                                                         "schema":  {
                                                                                                                                                        "$ref":  "#/components/schemas/Error"
                                                                                                                                                    }
                                                                                                                                     }
                                                                                                            }
                                                                                            },
                                                                                    "403":  {
                                                                                                "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                                "content":  {
                                                                                                                "application/json":  {
                                                                                                                                         "schema":  {
                                                                                                                                                        "$ref":  "#/components/schemas/Error"
                                                                                                                                                    }
                                                                                                                                     }
                                                                                                            }
                                                                                            },
                                                                                    "404":  {
                                                                                                "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                                "content":  {
                                                                                                                "application/json":  {
                                                                                                                                         "schema":  {
                                                                                                                                                        "$ref":  "#/components/schemas/Error"
                                                                                                                                                    }
                                                                                                                                     }
                                                                                                            }
                                                                                            },
                                                                                    "409":  {
                                                                                                "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                                "content":  {
                                                                                                                "application/json":  {
                                                                                                                                         "schema":  {
                                                                                                                                                        "$ref":  "#/components/schemas/Error"
                                                                                                                                                    }
                                                                                                                                     }
                                                                                                            }
                                                                                            },
                                                                                    "429":  {
                                                                                                "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                                "content":  {
                                                                                                                "application/json":  {
                                                                                                                                         "schema":  {
                                                                                                                                                        "$ref":  "#/components/schemas/Error"
                                                                                                                                                    }
                                                                                                                                     }
                                                                                                            }
                                                                                            },
                                                                                    "503":  {
                                                                                                "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                                "content":  {
                                                                                                                "application/json":  {
                                                                                                                                         "schema":  {
                                                                                                                                                        "$ref":  "#/components/schemas/Error"
                                                                                                                                                    }
                                                                                                                                     }
                                                                                                            }
                                                                                            },
                                                                                    "502":  {
                                                                                                "description":  "Upstream temporarily unavailable; error is a safe code.",
                                                                                                "content":  {
                                                                                                                "application/json":  {
                                                                                                                                         "schema":  {
                                                                                                                                                        "$ref":  "#/components/schemas/Error"
                                                                                                                                                    }
                                                                                                                                     }
                                                                                                            }
                                                                                            }
                                                                                }
                                                              }
                                                 },
                  "/api/partners/credit":  {
                                               "post":  {
                                                            "operationId":  "creditSubscription",
                                                            "description":  "Exchange earnings for the owner\u0027s subscription at the current server-owned exact price. Requires owner acceptance of current terms.",
                                                            "x-aegis-required-scope":  "subscription:credit",
                                                            "requestBody":  {
                                                                                "required":  true,
                                                                                "content":  {
                                                                                                "application/json":  {
                                                                                                                         "schema":  {
                                                                                                                                        "$ref":  "#/components/schemas/CreditRequest"
                                                                                                                                    }
                                                                                                                     }
                                                                                            }
                                                                            },
                                                            "responses":  {
                                                                              "200":  {
                                                                                          "description":  "Success.",
                                                                                          "content":  {
                                                                                                          "application/json":  {
                                                                                                                                   "schema":  {
                                                                                                                                                  "$ref":  "#/components/schemas/Operation"
                                                                                                                                              }
                                                                                                                               }
                                                                                                      }
                                                                                      },
                                                                              "400":  {
                                                                                          "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                          "content":  {
                                                                                                          "application/json":  {
                                                                                                                                   "schema":  {
                                                                                                                                                  "$ref":  "#/components/schemas/Error"
                                                                                                                                              }
                                                                                                                               }
                                                                                                      }
                                                                                      },
                                                                              "401":  {
                                                                                          "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                          "content":  {
                                                                                                          "application/json":  {
                                                                                                                                   "schema":  {
                                                                                                                                                  "$ref":  "#/components/schemas/Error"
                                                                                                                                              }
                                                                                                                               }
                                                                                                      }
                                                                                      },
                                                                              "403":  {
                                                                                          "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                          "content":  {
                                                                                                          "application/json":  {
                                                                                                                                   "schema":  {
                                                                                                                                                  "$ref":  "#/components/schemas/Error"
                                                                                                                                              }
                                                                                                                               }
                                                                                                      }
                                                                                      },
                                                                              "404":  {
                                                                                          "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                          "content":  {
                                                                                                          "application/json":  {
                                                                                                                                   "schema":  {
                                                                                                                                                  "$ref":  "#/components/schemas/Error"
                                                                                                                                              }
                                                                                                                               }
                                                                                                      }
                                                                                      },
                                                                              "409":  {
                                                                                          "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                          "content":  {
                                                                                                          "application/json":  {
                                                                                                                                   "schema":  {
                                                                                                                                                  "$ref":  "#/components/schemas/Error"
                                                                                                                                              }
                                                                                                                               }
                                                                                                      }
                                                                                      },
                                                                              "429":  {
                                                                                          "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                          "content":  {
                                                                                                          "application/json":  {
                                                                                                                                   "schema":  {
                                                                                                                                                  "$ref":  "#/components/schemas/Error"
                                                                                                                                              }
                                                                                                                               }
                                                                                                      }
                                                                                      },
                                                                              "503":  {
                                                                                          "description":  "Request rejected or temporarily unavailable; error is a safe code.",
                                                                                          "content":  {
                                                                                                          "application/json":  {
                                                                                                                                   "schema":  {
                                                                                                                                                  "$ref":  "#/components/schemas/Error"
                                                                                                                                              }
                                                                                                                               }
                                                                                                      }
                                                                                      },
                                                                              "502":  {
                                                                                          "description":  "Upstream temporarily unavailable; error is a safe code.",
                                                                                          "content":  {
                                                                                                          "application/json":  {
                                                                                                                                   "schema":  {
                                                                                                                                                  "$ref":  "#/components/schemas/Error"
                                                                                                                                              }
                                                                                                                               }
                                                                                                      }
                                                                                      }
                                                                          }
                                                        }
                                           }
              },
    "components":  {
                       "securitySchemes":  {
                                               "ScopedKey":  {
                                                                 "type":  "http",
                                                                 "scheme":  "bearer",
                                                                 "bearerFormat":  "aegis_sk_*",
                                                                 "description":  "Owner-issued scoped key from the cabinet. x-aegis-required-scope describes permissions enforced by the backend; a scoped key cannot issue keys."
                                                             }
                                           },
                       "schemas":  {
                                       "Error":  {
                                                     "type":  "object",
                                                     "properties":  {
                                                                        "error":  {
                                                                                      "type":  "string"
                                                                                  }
                                                                    },
                                                     "required":  [
                                                                      "error"
                                                                  ]
                                                 },
                                       "Account":  {
                                                       "type":  "object",
                                                       "properties":  {
                                                                          "account_ref":  {
                                                                                              "type":  "string"
                                                                                          },
                                                                          "status":  {
                                                                                         "type":  "string"
                                                                                     },
                                                                          "tariff":  {
                                                                                         "type":  "string"
                                                                                     },
                                                                          "source":  {
                                                                                         "type":  "string"
                                                                                     },
                                                                          "expires_at":  {
                                                                                             "type":  "string",
                                                                                             "format":  "date-time"
                                                                                         },
                                                                          "max_devices":  {
                                                                                              "type":  "integer",
                                                                                              "format":  "int64",
                                                                                              "minimum":  1
                                                                                          }
                                                                      },
                                                       "required":  [
                                                                        "account_ref",
                                                                        "status",
                                                                        "tariff",
                                                                        "source",
                                                                        "expires_at",
                                                                        "max_devices"
                                                                    ]
                                                   },
                                       "Device":  {
                                                      "type":  "object",
                                                      "properties":  {
                                                                         "device_id":  {
                                                                                           "type":  "string"
                                                                                       },
                                                                         "name":  {
                                                                                      "type":  "string"
                                                                                  },
                                                                         "status":  {
                                                                                        "type":  "string"
                                                                                    },
                                                                         "registered_at":  {
                                                                                               "type":  "string"
                                                                                           },
                                                                         "last_seen_at":  {
                                                                                              "type":  "string"
                                                                                          }
                                                                     },
                                                      "required":  [
                                                                       "device_id",
                                                                       "name",
                                                                       "status",
                                                                       "registered_at",
                                                                       "last_seen_at"
                                                                   ]
                                                  },
                                       "Devices":  {
                                                       "type":  "object",
                                                       "properties":  {
                                                                          "devices":  {
                                                                                          "type":  "array",
                                                                                          "items":  {
                                                                                                        "$ref":  "#/components/schemas/Device"
                                                                                                    }
                                                                                      }
                                                                      },
                                                       "required":  [
                                                                        "devices"
                                                                    ]
                                                   },
                                       "Balances":  {
                                                        "type":  "object",
                                                        "properties":  {
                                                                           "pending_minor":  {
                                                                                                 "type":  "integer",
                                                                                                 "format":  "int64",
                                                                                                 "minimum":  0
                                                                                             },
                                                                           "available_minor":  {
                                                                                                   "type":  "integer",
                                                                                                   "format":  "int64",
                                                                                                   "minimum":  0
                                                                                               },
                                                                           "reserved_minor":  {
                                                                                                  "type":  "integer",
                                                                                                  "format":  "int64",
                                                                                                  "minimum":  0
                                                                                              },
                                                                           "paid_minor":  {
                                                                                              "type":  "integer",
                                                                                              "format":  "int64",
                                                                                              "minimum":  0
                                                                                          },
                                                                           "credited_minor":  {
                                                                                                  "type":  "integer",
                                                                                                  "format":  "int64",
                                                                                                  "minimum":  0
                                                                                              },
                                                                           "debt_minor":  {
                                                                                              "type":  "integer",
                                                                                              "format":  "int64",
                                                                                              "minimum":  0
                                                                                          }
                                                                       },
                                                        "required":  [
                                                                         "pending_minor",
                                                                         "available_minor",
                                                                         "reserved_minor",
                                                                         "paid_minor",
                                                                         "credited_minor",
                                                                         "debt_minor"
                                                                     ]
                                                    },
                                       "Referral":  {
                                                        "type":  "object",
                                                        "properties":  {
                                                                           "code":  {
                                                                                        "type":  "string"
                                                                                    },
                                                                           "url":  {
                                                                                       "type":  "string",
                                                                                       "format":  "uri"
                                                                                   },
                                                                           "share_bps":  {
                                                                                             "type":  "integer",
                                                                                             "format":  "int64",
                                                                                             "minimum":  0,
                                                                                             "maximum":  10000
                                                                                         }
                                                                       },
                                                        "required":  [
                                                                         "code",
                                                                         "url",
                                                                         "share_bps"
                                                                     ]
                                                    },
                                       "Offer":  {
                                                     "type":  "object",
                                                     "properties":  {
                                                                        "id":  {
                                                                                   "type":  "string"
                                                                               },
                                                                        "tariff":  {
                                                                                       "type":  "string",
                                                                                       "enum":  [
                                                                                                    "month",
                                                                                                    "year"
                                                                                                ]
                                                                                   },
                                                                        "price_minor":  {
                                                                                            "type":  "integer",
                                                                                            "format":  "int64",
                                                                                            "minimum":  0
                                                                                        }
                                                                    },
                                                     "required":  [
                                                                      "id",
                                                                      "tariff",
                                                                      "price_minor"
                                                                  ]
                                                 },
                                       "ManagedService":  {
                                                              "type":  "object",
                                                              "properties":  {
                                                                                 "id":  {
                                                                                            "type":  "string"
                                                                                        },
                                                                                 "name":  {
                                                                                              "type":  "string"
                                                                                          },
                                                                                 "description":  {
                                                                                                     "type":  "string"
                                                                                                 },
                                                                                 "status":  {
                                                                                                "type":  "string",
                                                                                                "enum":  [
                                                                                                             "active",
                                                                                                             "paused"
                                                                                                         ]
                                                                                            },
                                                                                 "url":  {
                                                                                             "type":  "string"
                                                                                         },
                                                                                 "offers":  {
                                                                                                "type":  "array",
                                                                                                "items":  {
                                                                                                              "$ref":  "#/components/schemas/Offer"
                                                                                                          }
                                                                                            }
                                                                             },
                                                              "required":  [
                                                                               "id",
                                                                               "name",
                                                                               "description",
                                                                               "status",
                                                                               "url",
                                                                               "offers"
                                                                           ]
                                                          },
                                       "PartnerTerms":  {
                                                            "type":  "object",
                                                            "properties":  {
                                                                               "version":  {
                                                                                               "type":  "string"
                                                                                           },
                                                                               "url":  {
                                                                                           "type":  "string",
                                                                                           "format":  "uri"
                                                                                       },
                                                                               "referral_share_bps":  {
                                                                                                          "type":  "integer",
                                                                                                          "format":  "int64",
                                                                                                          "minimum":  0,
                                                                                                          "maximum":  10000
                                                                                                      },
                                                                               "partner_share_bps":  {
                                                                                                         "type":  "integer",
                                                                                                         "format":  "int64",
                                                                                                         "minimum":  0,
                                                                                                         "maximum":  10000
                                                                                                     },
                                                                               "hold_days":  {
                                                                                                 "type":  "integer",
                                                                                                 "format":  "int64",
                                                                                                 "minimum":  0
                                                                                             },
                                                                               "payout_min_minor":  {
                                                                                                        "type":  "integer",
                                                                                                        "format":  "int64",
                                                                                                        "minimum":  0
                                                                                                    },
                                                                               "credits_enabled":  {
                                                                                                       "type":  "boolean"
                                                                                                   },
                                                                               "payouts_enabled":  {
                                                                                                       "type":  "boolean"
                                                                                                   },
                                                                               "payout_networks":  {
                                                                                                       "type":  "array",
                                                                                                       "items":  {
                                                                                                                     "type":  "string",
                                                                                                                     "enum":  [
                                                                                                                                  "TON",
                                                                                                                                  "TRC20"
                                                                                                                              ]
                                                                                                                 }
                                                                                                   },
                                                                               "payout_processing":  {
                                                                                                         "type":  "string",
                                                                                                         "enum":  [
                                                                                                                      "manual"
                                                                                                                  ]
                                                                                                     },
                                                                               "credit_prices":  {
                                                                                                     "type":  "object",
                                                                                                     "properties":  {
                                                                                                                        "month_minor":  {
                                                                                                                                            "type":  "integer",
                                                                                                                                            "format":  "int64",
                                                                                                                                            "minimum":  0
                                                                                                                                        },
                                                                                                                        "year_minor":  {
                                                                                                                                           "type":  "integer",
                                                                                                                                           "format":  "int64",
                                                                                                                                           "minimum":  0
                                                                                                                                       }
                                                                                                                    },
                                                                                                     "required":  [
                                                                                                                      "month_minor",
                                                                                                                      "year_minor"
                                                                                                                  ]
                                                                                                 },
                                                                               "credit_days":  {
                                                                                                   "type":  "object",
                                                                                                   "properties":  {
                                                                                                                      "month":  {
                                                                                                                                    "type":  "integer",
                                                                                                                                    "format":  "int64",
                                                                                                                                    "const":  30
                                                                                                                                },
                                                                                                                      "year":  {
                                                                                                                                   "type":  "integer",
                                                                                                                                   "format":  "int64",
                                                                                                                                   "const":  365
                                                                                                                               }
                                                                                                                  },
                                                                                                   "required":  [
                                                                                                                    "month",
                                                                                                                    "year"
                                                                                                                ]
                                                                                               }
                                                                           },
                                                            "required":  [
                                                                             "version",
                                                                             "url",
                                                                             "referral_share_bps",
                                                                             "partner_share_bps",
                                                                             "hold_days",
                                                                             "payout_min_minor",
                                                                             "credits_enabled",
                                                                             "payouts_enabled",
                                                                             "payout_networks",
                                                                             "payout_processing",
                                                                             "credit_prices",
                                                                             "credit_days"
                                                                         ]
                                                        },
                                       "PartnerSummary":  {
                                                              "type":  "object",
                                                              "properties":  {
                                                                                 "enabled":  {
                                                                                                 "type":  "boolean"
                                                                                             },
                                                                                 "mode":  {
                                                                                              "type":  "string",
                                                                                              "enum":  [
                                                                                                           "off",
                                                                                                           "active",
                                                                                                           "read_only"
                                                                                                       ]
                                                                                          },
                                                                                 "account_ref":  {
                                                                                                     "type":  "string"
                                                                                                 },
                                                                                 "currency":  {
                                                                                                  "type":  "string",
                                                                                                  "enum":  [
                                                                                                               "RUB"
                                                                                                           ]
                                                                                              },
                                                                                 "accepted_terms_version":  {
                                                                                                                "type":  "string"
                                                                                                            },
                                                                                 "referral":  {
                                                                                                  "anyOf":  [
                                                                                                                {
                                                                                                                    "$ref":  "#/components/schemas/Referral"
                                                                                                                },
                                                                                                                {
                                                                                                                    "type":  "null"
                                                                                                                }
                                                                                                            ]
                                                                                              },
                                                                                 "balances":  {
                                                                                                  "$ref":  "#/components/schemas/Balances"
                                                                                              },
                                                                                 "service":  {
                                                                                                 "anyOf":  [
                                                                                                               {
                                                                                                                   "$ref":  "#/components/schemas/ManagedService"
                                                                                                               },
                                                                                                               {
                                                                                                                   "type":  "null"
                                                                                                               }
                                                                                                           ]
                                                                                             },
                                                                                 "terms":  {
                                                                                               "$ref":  "#/components/schemas/PartnerTerms"
                                                                                           },
                                                                                 "stats":  {
                                                                                               "type":  "object",
                                                                                               "properties":  {
                                                                                                                  "sales_count":  {
                                                                                                                                      "type":  "integer",
                                                                                                                                      "format":  "int64",
                                                                                                                                      "minimum":  0
                                                                                                                                  },
                                                                                                                  "paid_sales_count":  {
                                                                                                                                           "type":  "integer",
                                                                                                                                           "format":  "int64",
                                                                                                                                           "minimum":  0
                                                                                                                                       },
                                                                                                                  "customers_count":  {
                                                                                                                                          "type":  "integer",
                                                                                                                                          "format":  "int64",
                                                                                                                                          "minimum":  0
                                                                                                                                      }
                                                                                                              },
                                                                                               "required":  [
                                                                                                                "sales_count",
                                                                                                                "paid_sales_count",
                                                                                                                "customers_count"
                                                                                                            ]
                                                                                           }
                                                                             },
                                                              "required":  [
                                                                               "enabled",
                                                                               "mode"
                                                                           ]
                                                          },
                                       "Sale":  {
                                                    "type":  "object",
                                                    "properties":  {
                                                                       "id":  {
                                                                                  "type":  "string"
                                                                              },
                                                                       "kind":  {
                                                                                    "type":  "string",
                                                                                    "enum":  [
                                                                                                 "referral",
                                                                                                 "service"
                                                                                             ]
                                                                                },
                                                                       "tariff":  {
                                                                                      "type":  "string",
                                                                                      "enum":  [
                                                                                                   "month",
                                                                                                   "year",
                                                                                                   ""
                                                                                               ]
                                                                                  },
                                                                       "amount_minor":  {
                                                                                            "type":  "integer",
                                                                                            "format":  "int64",
                                                                                            "minimum":  0
                                                                                        },
                                                                       "reward_minor":  {
                                                                                            "type":  "integer",
                                                                                            "format":  "int64",
                                                                                            "minimum":  0
                                                                                        },
                                                                       "status":  {
                                                                                      "type":  "string"
                                                                                  },
                                                                       "created_at":  {
                                                                                          "type":  "string",
                                                                                          "format":  "date-time"
                                                                                      }
                                                                   },
                                                    "required":  [
                                                                     "id",
                                                                     "kind",
                                                                     "tariff",
                                                                     "amount_minor",
                                                                     "reward_minor",
                                                                     "status",
                                                                     "created_at"
                                                                 ]
                                                },
                                       "Sales":  {
                                                     "type":  "object",
                                                     "properties":  {
                                                                        "sales":  {
                                                                                      "type":  "array",
                                                                                      "maxItems":  100,
                                                                                      "items":  {
                                                                                                    "$ref":  "#/components/schemas/Sale"
                                                                                                }
                                                                                  }
                                                                    },
                                                     "required":  [
                                                                      "sales"
                                                                  ]
                                                 },
                                       "Payout":  {
                                                      "type":  "object",
                                                      "properties":  {
                                                                         "id":  {
                                                                                    "type":  "string"
                                                                                },
                                                                         "amount_minor":  {
                                                                                              "type":  "integer",
                                                                                              "format":  "int64",
                                                                                              "minimum":  1,
                                                                                              "maximum":  1000000000000
                                                                                          },
                                                                         "network":  {
                                                                                         "type":  "string"
                                                                                     },
                                                                         "address_masked":  {
                                                                                                "type":  "string"
                                                                                            },
                                                                         "status":  {
                                                                                        "type":  "string"
                                                                                    },
                                                                         "created_at":  {
                                                                                            "type":  "string",
                                                                                            "format":  "date-time"
                                                                                        }
                                                                     },
                                                      "required":  [
                                                                       "id",
                                                                       "amount_minor",
                                                                       "network",
                                                                       "address_masked",
                                                                       "status",
                                                                       "created_at"
                                                                   ]
                                                  },
                                       "Payouts":  {
                                                       "type":  "object",
                                                       "properties":  {
                                                                          "payouts":  {
                                                                                          "type":  "array",
                                                                                          "maxItems":  100,
                                                                                          "items":  {
                                                                                                        "$ref":  "#/components/schemas/Payout"
                                                                                                    }
                                                                                      }
                                                                      },
                                                       "required":  [
                                                                        "payouts"
                                                                    ]
                                                   },
                                       "Operation":  {
                                                         "type":  "object",
                                                         "properties":  {
                                                                            "id":  {
                                                                                       "type":  "string"
                                                                                   },
                                                                            "status":  {
                                                                                           "type":  "string",
                                                                                           "enum":  [
                                                                                                        "pending",
                                                                                                        "confirmed",
                                                                                                        "failed",
                                                                                                        "not_found"
                                                                                                    ]
                                                                                       },
                                                                            "kind":  {
                                                                                         "type":  "string"
                                                                                     },
                                                                            "error":  {
                                                                                          "type":  "string"
                                                                                      }
                                                                        },
                                                         "required":  [
                                                                          "status"
                                                                      ]
                                                     },
                                       "Intent":  {
                                                      "type":  "object",
                                                      "properties":  {
                                                                         "idempotency_key":  {
                                                                                                 "type":  "string",
                                                                                                 "format":  "uuid",
                                                                                                 "minLength":  36,
                                                                                                 "maxLength":  36
                                                                                             },
                                                                         "terms_version":  {
                                                                                               "type":  "string",
                                                                                               "minLength":  1,
                                                                                               "maxLength":  160
                                                                                           }
                                                                     },
                                                      "required":  [
                                                                       "idempotency_key",
                                                                       "terms_version"
                                                                   ],
                                                      "additionalProperties":  false
                                                  },
                                       "CreateServiceRequest":  {
                                                                    "type":  "object",
                                                                    "properties":  {
                                                                                       "idempotency_key":  {
                                                                                                               "type":  "string",
                                                                                                               "format":  "uuid",
                                                                                                               "minLength":  36,
                                                                                                               "maxLength":  36
                                                                                                           },
                                                                                       "terms_version":  {
                                                                                                             "type":  "string",
                                                                                                             "minLength":  1,
                                                                                                             "maxLength":  160
                                                                                                         },
                                                                                       "name":  {
                                                                                                    "type":  "string",
                                                                                                    "minLength":  2,
                                                                                                    "maxLength":  60
                                                                                                },
                                                                                       "description":  {
                                                                                                           "type":  "string",
                                                                                                           "maxLength":  300
                                                                                                       }
                                                                                   },
                                                                    "required":  [
                                                                                     "idempotency_key",
                                                                                     "terms_version",
                                                                                     "name"
                                                                                 ],
                                                                    "additionalProperties":  false
                                                                },
                                       "ServiceStatusRequest":  {
                                                                    "type":  "object",
                                                                    "properties":  {
                                                                                       "idempotency_key":  {
                                                                                                               "type":  "string",
                                                                                                               "format":  "uuid",
                                                                                                               "minLength":  36,
                                                                                                               "maxLength":  36
                                                                                                           },
                                                                                       "terms_version":  {
                                                                                                             "type":  "string",
                                                                                                             "minLength":  1,
                                                                                                             "maxLength":  160
                                                                                                         },
                                                                                       "service_id":  {
                                                                                                          "type":  "string",
                                                                                                          "minLength":  1,
                                                                                                          "maxLength":  128
                                                                                                      },
                                                                                       "status":  {
                                                                                                      "type":  "string",
                                                                                                      "enum":  [
                                                                                                                   "active",
                                                                                                                   "paused"
                                                                                                               ]
                                                                                                  }
                                                                                   },
                                                                    "required":  [
                                                                                     "idempotency_key",
                                                                                     "terms_version",
                                                                                     "service_id",
                                                                                     "status"
                                                                                 ],
                                                                    "additionalProperties":  false
                                                                },
                                       "PayoutRequest":  {
                                                             "type":  "object",
                                                             "properties":  {
                                                                                "idempotency_key":  {
                                                                                                        "type":  "string",
                                                                                                        "format":  "uuid",
                                                                                                        "minLength":  36,
                                                                                                        "maxLength":  36
                                                                                                    },
                                                                                "terms_version":  {
                                                                                                      "type":  "string",
                                                                                                      "minLength":  1,
                                                                                                      "maxLength":  160
                                                                                                  },
                                                                                "amount_minor":  {
                                                                                                     "type":  "integer",
                                                                                                     "format":  "int64",
                                                                                                     "minimum":  1,
                                                                                                     "maximum":  1000000000000
                                                                                                 },
                                                                                "network":  {
                                                                                                "type":  "string",
                                                                                                "enum":  [
                                                                                                             "TON",
                                                                                                             "TRC20"
                                                                                                         ]
                                                                                            },
                                                                                "address":  {
                                                                                                "type":  "string",
                                                                                                "minLength":  1,
                                                                                                "maxLength":  160
                                                                                            }
                                                                            },
                                                             "required":  [
                                                                              "idempotency_key",
                                                                              "terms_version",
                                                                              "amount_minor",
                                                                              "network",
                                                                              "address"
                                                                          ],
                                                             "additionalProperties":  false
                                                         },
                                       "CreditRequest":  {
                                                             "type":  "object",
                                                             "properties":  {
                                                                                "idempotency_key":  {
                                                                                                        "type":  "string",
                                                                                                        "format":  "uuid",
                                                                                                        "minLength":  36,
                                                                                                        "maxLength":  36
                                                                                                    },
                                                                                "terms_version":  {
                                                                                                      "type":  "string",
                                                                                                      "minLength":  1,
                                                                                                      "maxLength":  160
                                                                                                  },
                                                                                "tariff":  {
                                                                                               "type":  "string",
                                                                                               "enum":  [
                                                                                                            "month",
                                                                                                            "year"
                                                                                                        ]
                                                                                           },
                                                                                "expected_amount_minor":  {
                                                                                                              "type":  "integer",
                                                                                                              "format":  "int64",
                                                                                                              "minimum":  1,
                                                                                                              "maximum":  1000000000000
                                                                                                          }
                                                                            },
                                                             "required":  [
                                                                              "idempotency_key",
                                                                              "terms_version",
                                                                              "tariff",
                                                                              "expected_amount_minor"
                                                                          ],
                                                             "additionalProperties":  false
                                                         }
                                   }
                   }
}
