{
  "openapi": "3.1.1",
  "info": {
    "title": "ZoltVPN Reseller API",
    "description": "Send your API key as `Authorization: Bearer zrk_…`. The guide is on the API page of the reseller portal.",
    "version": "v1"
  },
  "servers": [
    {
      "url": "https://app.zoltvpn.com"
    }
  ],
  "paths": {
    "/api/reseller-api/v1/me": {
      "get": {
        "tags": [
          "Account"
        ],
        "summary": "Your account, wallet, limits and this key",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Me"
                }
              }
            }
          }
        }
      }
    },
    "/api/reseller-api/v1/plans": {
      "get": {
        "tags": [
          "Plans"
        ],
        "summary": "The plans you may sell, with your price and the retail price",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlanList"
                }
              }
            }
          }
        }
      }
    },
    "/api/reseller-api/v1/quote": {
      "get": {
        "tags": [
          "Plans"
        ],
        "summary": "What a purchase would cost now",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "clientId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "planId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "billingInterval",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "quantity",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "addonId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuoteView"
                }
              }
            }
          }
        }
      }
    },
    "/api/reseller-api/v1/clients": {
      "get": {
        "tags": [
          "Clients"
        ],
        "summary": "Your clients, with plan, expiry, devices and usage",
        "parameters": [
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "default": "all"
            }
          },
          {
            "name": "scope",
            "in": "query",
            "schema": {
              "type": "string",
              "default": "all"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string",
              "default": "createdAt"
            }
          },
          {
            "name": "dir",
            "in": "query",
            "schema": {
              "type": "string",
              "default": "desc"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedOfClientSummary"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Clients"
        ],
        "summary": "Create a client, optionally with a plan (scope: purchase)",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateClientBody"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateClientBody"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateClientBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreatedClient"
                }
              }
            }
          }
        }
      }
    },
    "/api/reseller-api/v1/clients/{id}": {
      "get": {
        "tags": [
          "Clients"
        ],
        "summary": "One client in detail",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientDetail"
                }
              }
            }
          }
        }
      }
    },
    "/api/reseller-api/v1/clients/{id}/usage": {
      "get": {
        "tags": [
          "Clients"
        ],
        "summary": "Daily traffic and traffic per location",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "days",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 30
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientUsageView"
                }
              }
            }
          }
        }
      }
    },
    "/api/reseller-api/v1/clients/{id}/data-addons": {
      "get": {
        "tags": [
          "Clients"
        ],
        "summary": "Extra-data packs you can sell this client",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataAddonList"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Clients"
        ],
        "summary": "Buy an extra-data pack (scope: purchase)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BuyDataAddonBody"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/BuyDataAddonBody"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/BuyDataAddonBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataAddonBought"
                }
              }
            }
          }
        }
      }
    },
    "/api/reseller-api/v1/clients/{id}/extend": {
      "post": {
        "tags": [
          "Clients"
        ],
        "summary": "Renew, or change the plan (scope: purchase)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExtendBody"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ExtendBody"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ExtendBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Extended"
                }
              }
            }
          }
        }
      }
    },
    "/api/reseller-api/v1/clients/{id}/devices": {
      "post": {
        "tags": [
          "Clients"
        ],
        "summary": "Extra devices until the client's expiry (scope: purchase)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DevicesBody"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/DevicesBody"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/DevicesBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DevicesAdded"
                }
              }
            }
          }
        }
      }
    },
    "/api/reseller-api/v1/clients/{id}/static-ip": {
      "post": {
        "tags": [
          "Clients"
        ],
        "summary": "A static IP until the client's expiry (scope: purchase)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StaticIpAdded"
                }
              }
            }
          }
        }
      }
    },
    "/api/reseller-api/v1/clients/{id}/suspend": {
      "post": {
        "tags": [
          "Clients"
        ],
        "summary": "Disable sign-in and drop live connections (scope: manage)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuspendResult"
                }
              }
            }
          }
        }
      }
    },
    "/api/reseller-api/v1/clients/{id}/resume": {
      "post": {
        "tags": [
          "Clients"
        ],
        "summary": "Re-enable a suspended client (scope: manage)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuspendResult"
                }
              }
            }
          }
        }
      }
    },
    "/api/reseller-api/v1/clients/{id}/disconnect": {
      "post": {
        "tags": [
          "Clients"
        ],
        "summary": "Drop live connections (scope: manage)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Disconnected"
                }
              }
            }
          }
        }
      }
    },
    "/api/reseller-api/v1/codes": {
      "get": {
        "tags": [
          "Codes"
        ],
        "summary": "Your subscription codes",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedOfCodeItem"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Codes"
        ],
        "summary": "Buy subscription codes (scope: purchase)",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCodesBody"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCodesBody"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCodesBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodesCreated"
                }
              }
            }
          }
        }
      }
    },
    "/api/reseller-api/v1/codes/{id}/void": {
      "post": {
        "tags": [
          "Codes"
        ],
        "summary": "Void an unused code, refunded to your wallet (scope: purchase)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodeVoided"
                }
              }
            }
          }
        }
      }
    },
    "/api/reseller-api/v1/codes/{id}/qr": {
      "get": {
        "tags": [
          "Codes"
        ],
        "summary": "The code's QR as a PNG",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "byte"
                }
              },
              "application/json": { }
            }
          }
        }
      }
    },
    "/api/reseller-api/v1/notifications": {
      "post": {
        "tags": [
          "Notifications"
        ],
        "summary": "Send a push notification to your clients (scope: notify)",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendNotificationBody"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SendNotificationBody"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SendNotificationBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotificationsSent"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Notifications"
        ],
        "summary": "The notifications you sent",
        "parameters": [
          {
            "name": "clientId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedOfNotificationItem"
                }
              }
            }
          }
        }
      }
    },
    "/api/reseller-api/v1/wallet": {
      "get": {
        "tags": [
          "Wallet"
        ],
        "summary": "Balance and transactions",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletView"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "BuyDataAddonBody": {
        "required": [
          "addonId"
        ],
        "type": "object",
        "properties": {
          "addonId": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "ClientDetail": {
        "required": [
          "id",
          "email",
          "name",
          "status",
          "isActive",
          "isVerified",
          "isDirect",
          "soldBy",
          "plan",
          "expiresAt",
          "isOnline",
          "lastSeenAt",
          "devices",
          "dataUsedTermBytes",
          "usage30dBytes",
          "createdAt",
          "subscription",
          "deviceList",
          "extraDevices",
          "staticIp",
          "activeSessions"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "email": {
            "type": "string"
          },
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "type": [
              "null",
              "string"
            ]
          },
          "isActive": {
            "type": "boolean"
          },
          "isVerified": {
            "type": "boolean"
          },
          "isDirect": {
            "type": "boolean"
          },
          "soldBy": {
            "type": [
              "null",
              "string"
            ]
          },
          "plan": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PlanRef"
              }
            ]
          },
          "expiresAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "isOnline": {
            "type": "boolean"
          },
          "lastSeenAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "devices": {
            "$ref": "#/components/schemas/DeviceCount"
          },
          "dataUsedTermBytes": {
            "type": "integer",
            "format": "int64"
          },
          "usage30dBytes": {
            "type": "integer",
            "format": "int64"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "subscription": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ClientSubscription"
              }
            ]
          },
          "deviceList": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ClientDevice"
            }
          },
          "extraDevices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ClientExtraDevice"
            }
          },
          "staticIp": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ClientStaticIp"
              }
            ]
          },
          "activeSessions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ClientSession"
            }
          }
        }
      },
      "ClientDevice": {
        "required": [
          "id",
          "name",
          "platform",
          "model",
          "appVersion",
          "status",
          "lastSeenAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "platform": {
            "type": [
              "null",
              "string"
            ]
          },
          "model": {
            "type": [
              "null",
              "string"
            ]
          },
          "appVersion": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "type": "string"
          },
          "lastSeenAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "ClientExtraDevice": {
        "required": [
          "id",
          "code",
          "status",
          "source",
          "expiresAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "code": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "type": [
              "null",
              "string"
            ]
          },
          "source": {
            "type": [
              "null",
              "string"
            ]
          },
          "expiresAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "ClientSession": {
        "required": [
          "countryCode",
          "startedAt",
          "seconds",
          "bytes"
        ],
        "type": "object",
        "properties": {
          "countryCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "startedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "seconds": {
            "type": "integer",
            "format": "int64"
          },
          "bytes": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "ClientStaticIp": {
        "required": [
          "ip",
          "source",
          "expiresAt"
        ],
        "type": "object",
        "properties": {
          "ip": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "expiresAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "ClientSubscription": {
        "required": [
          "planId",
          "planName",
          "startedAt",
          "expiresAt",
          "isExpired",
          "autoRenew"
        ],
        "type": "object",
        "properties": {
          "planId": {
            "type": "string",
            "format": "uuid"
          },
          "planName": {
            "type": [
              "null",
              "string"
            ]
          },
          "startedAt": {
            "type": "string",
            "format": "date-time"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "isExpired": {
            "type": "boolean"
          },
          "autoRenew": {
            "type": "boolean"
          }
        }
      },
      "ClientSummary": {
        "required": [
          "id",
          "email",
          "name",
          "status",
          "isVerified",
          "isDirect",
          "soldBy",
          "plan",
          "expiresAt",
          "isOnline",
          "lastSeenAt",
          "devices",
          "dataUsedTermBytes",
          "usage30dBytes",
          "createdAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "email": {
            "type": "string"
          },
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "type": "string"
          },
          "isVerified": {
            "type": "boolean"
          },
          "isDirect": {
            "type": "boolean"
          },
          "soldBy": {
            "type": [
              "null",
              "string"
            ]
          },
          "plan": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PlanRef"
              }
            ]
          },
          "expiresAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "isOnline": {
            "type": "boolean"
          },
          "lastSeenAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "devices": {
            "$ref": "#/components/schemas/DeviceCount"
          },
          "dataUsedTermBytes": {
            "type": "integer",
            "format": "int64"
          },
          "usage30dBytes": {
            "type": "integer",
            "format": "int64"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ClientUsageView": {
        "required": [
          "daily",
          "byLocation"
        ],
        "type": "object",
        "properties": {
          "daily": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UsageDay"
            }
          },
          "byLocation": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UsageLocation"
            }
          }
        }
      },
      "CodeItem": {
        "required": [
          "id",
          "code",
          "planId",
          "planName",
          "billingInterval",
          "status",
          "note",
          "pricePaidCents",
          "redeemedAt",
          "expiresAt",
          "batchId",
          "createdAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "code": {
            "type": "string"
          },
          "planId": {
            "type": "string",
            "format": "uuid"
          },
          "planName": {
            "type": [
              "null",
              "string"
            ]
          },
          "billingInterval": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "note": {
            "type": [
              "null",
              "string"
            ]
          },
          "pricePaidCents": {
            "type": "integer",
            "format": "int32"
          },
          "redeemedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "expiresAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "batchId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "CodesCreated": {
        "required": [
          "batchId",
          "balanceCents",
          "codes"
        ],
        "type": "object",
        "properties": {
          "batchId": {
            "type": "string",
            "format": "uuid"
          },
          "balanceCents": {
            "type": "integer",
            "format": "int64"
          },
          "codes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CodeItem"
            }
          }
        }
      },
      "CodeVoided": {
        "required": [
          "id",
          "status",
          "refunded",
          "balanceCents"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string"
          },
          "refunded": {
            "type": "boolean"
          },
          "balanceCents": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          }
        }
      },
      "CreateClientBody": {
        "required": [
          "email",
          "password"
        ],
        "type": "object",
        "properties": {
          "email": {
            "type": "string"
          },
          "password": {
            "type": "string"
          },
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "planId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "billingInterval": {
            "type": "string",
            "default": "monthly"
          }
        }
      },
      "CreateCodesBody": {
        "required": [
          "planId"
        ],
        "type": "object",
        "properties": {
          "planId": {
            "type": "string",
            "format": "uuid"
          },
          "billingInterval": {
            "type": "string",
            "default": "monthly"
          },
          "quantity": {
            "type": "integer",
            "format": "int32",
            "default": 1
          },
          "note": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CreatedClient": {
        "required": [
          "client",
          "chargedCents",
          "balanceCents"
        ],
        "type": "object",
        "properties": {
          "client": {
            "$ref": "#/components/schemas/ClientSummary"
          },
          "chargedCents": {
            "type": "integer",
            "format": "int64"
          },
          "balanceCents": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "DataAddonBought": {
        "required": [
          "grantId",
          "quotaBytes",
          "chargedCents",
          "balanceCents"
        ],
        "type": "object",
        "properties": {
          "grantId": {
            "type": "string",
            "format": "uuid"
          },
          "quotaBytes": {
            "type": "integer",
            "format": "int64"
          },
          "chargedCents": {
            "type": "integer",
            "format": "int64"
          },
          "balanceCents": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "DataAddonItem": {
        "required": [
          "id",
          "name",
          "quotaBytes",
          "priceCents",
          "retailPriceCents",
          "countryCode"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "quotaBytes": {
            "type": "integer",
            "format": "int64"
          },
          "priceCents": {
            "type": "integer",
            "format": "int32"
          },
          "retailPriceCents": {
            "type": "integer",
            "format": "int32"
          },
          "countryCode": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "DataAddonList": {
        "required": [
          "addons"
        ],
        "type": "object",
        "properties": {
          "addons": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DataAddonItem"
            }
          }
        }
      },
      "DeviceCount": {
        "required": [
          "active",
          "max"
        ],
        "type": "object",
        "properties": {
          "active": {
            "type": "integer",
            "format": "int32"
          },
          "max": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "DevicesAdded": {
        "required": [
          "devicesMax",
          "until",
          "chargedCents",
          "balanceCents",
          "codes"
        ],
        "type": "object",
        "properties": {
          "devicesMax": {
            "type": "integer",
            "format": "int32"
          },
          "until": {
            "type": "string",
            "format": "date-time"
          },
          "chargedCents": {
            "type": "integer",
            "format": "int64"
          },
          "balanceCents": {
            "type": "integer",
            "format": "int64"
          },
          "codes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "DevicesBody": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer",
            "format": "int32",
            "default": 1
          }
        }
      },
      "Disconnected": {
        "required": [
          "sessionsDisconnected"
        ],
        "type": "object",
        "properties": {
          "sessionsDisconnected": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "ExtendBody": {
        "required": [
          "planId"
        ],
        "type": "object",
        "properties": {
          "planId": {
            "type": "string",
            "format": "uuid"
          },
          "billingInterval": {
            "type": "string",
            "default": "monthly"
          },
          "confirmPlanChange": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "Extended": {
        "required": [
          "expiresAt",
          "chargedCents",
          "balanceCents"
        ],
        "type": "object",
        "properties": {
          "expiresAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "chargedCents": {
            "type": "integer",
            "format": "int64"
          },
          "balanceCents": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "Me": {
        "required": [
          "id",
          "email",
          "name",
          "walletBalanceCents",
          "currency",
          "lowBalanceThresholdCents",
          "clientLimit",
          "liveClients",
          "payingClients",
          "limitClientNotifications",
          "key",
          "rateLimits"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "email": {
            "type": "string"
          },
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "walletBalanceCents": {
            "type": "integer",
            "format": "int64"
          },
          "currency": {
            "type": "string"
          },
          "lowBalanceThresholdCents": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "clientLimit": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "liveClients": {
            "type": "integer",
            "format": "int32"
          },
          "payingClients": {
            "type": "integer",
            "format": "int32"
          },
          "limitClientNotifications": {
            "type": "boolean"
          },
          "key": {
            "$ref": "#/components/schemas/MeKey"
          },
          "rateLimits": {
            "$ref": "#/components/schemas/MeRateLimits"
          }
        }
      },
      "MeKey": {
        "required": [
          "id",
          "name",
          "prefix",
          "scopes",
          "expiresAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "prefix": {
            "type": "string"
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "expiresAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "MeRateLimits": {
        "required": [
          "perMinute",
          "perDay",
          "blockHours",
          "usedToday",
          "dayResetsAt"
        ],
        "type": "object",
        "properties": {
          "perMinute": {
            "type": "integer",
            "format": "int32"
          },
          "perDay": {
            "type": "integer",
            "format": "int32"
          },
          "blockHours": {
            "type": "integer",
            "format": "int32"
          },
          "usedToday": {
            "type": "integer",
            "format": "int64"
          },
          "dayResetsAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "NotificationItem": {
        "required": [
          "id",
          "clientId",
          "clientEmail",
          "title",
          "body",
          "status",
          "error",
          "createdAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "clientId": {
            "type": "string",
            "format": "uuid"
          },
          "clientEmail": {
            "type": [
              "null",
              "string"
            ]
          },
          "title": {
            "type": "string"
          },
          "body": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "error": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "NotificationResult": {
        "required": [
          "clientId",
          "status",
          "error"
        ],
        "type": "object",
        "properties": {
          "clientId": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string"
          },
          "error": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "NotificationsSent": {
        "required": [
          "sent",
          "refused",
          "results"
        ],
        "type": "object",
        "properties": {
          "sent": {
            "type": "integer",
            "format": "int32"
          },
          "refused": {
            "type": "integer",
            "format": "int32"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NotificationResult"
            }
          }
        }
      },
      "PagedOfClientSummary": {
        "required": [
          "total",
          "page",
          "pageSize",
          "items"
        ],
        "type": "object",
        "properties": {
          "total": {
            "type": "integer",
            "format": "int32"
          },
          "page": {
            "type": "integer",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "format": "int32"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ClientSummary"
            }
          }
        }
      },
      "PagedOfCodeItem": {
        "required": [
          "total",
          "page",
          "pageSize",
          "items"
        ],
        "type": "object",
        "properties": {
          "total": {
            "type": "integer",
            "format": "int32"
          },
          "page": {
            "type": "integer",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "format": "int32"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CodeItem"
            }
          }
        }
      },
      "PagedOfNotificationItem": {
        "required": [
          "total",
          "page",
          "pageSize",
          "items"
        ],
        "type": "object",
        "properties": {
          "total": {
            "type": "integer",
            "format": "int32"
          },
          "page": {
            "type": "integer",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "format": "int32"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NotificationItem"
            }
          }
        }
      },
      "PagedOfWalletTransaction": {
        "required": [
          "total",
          "page",
          "pageSize",
          "items"
        ],
        "type": "object",
        "properties": {
          "total": {
            "type": "integer",
            "format": "int32"
          },
          "page": {
            "type": "integer",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "format": "int32"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WalletTransaction"
            }
          }
        }
      },
      "PlanItem": {
        "required": [
          "id",
          "name",
          "maxDevices",
          "durationDays",
          "prices",
          "retailPrices",
          "extraDeviceMonthlyCents",
          "retailExtraDeviceMonthlyCents",
          "staticIpMonthlyCents"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "maxDevices": {
            "type": "integer",
            "format": "int32"
          },
          "durationDays": {
            "type": "integer",
            "format": "int32"
          },
          "prices": {
            "$ref": "#/components/schemas/TermPrices"
          },
          "retailPrices": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/TermPrices"
              }
            ]
          },
          "extraDeviceMonthlyCents": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "retailExtraDeviceMonthlyCents": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "staticIpMonthlyCents": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          }
        }
      },
      "PlanList": {
        "required": [
          "items"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PlanItem"
            }
          }
        }
      },
      "PlanRef": {
        "required": [
          "id",
          "name"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "QuoteTermView": {
        "required": [
          "startsAt",
          "expiresAt"
        ],
        "type": "object",
        "properties": {
          "startsAt": {
            "type": "string",
            "format": "date-time"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "QuoteView": {
        "required": [
          "sellable",
          "reason",
          "unitCents",
          "quantity",
          "totalCents",
          "balanceCents",
          "balanceAfterCents",
          "insufficient",
          "term",
          "planChange"
        ],
        "type": "object",
        "properties": {
          "sellable": {
            "type": "boolean"
          },
          "reason": {
            "type": [
              "null",
              "string"
            ]
          },
          "unitCents": {
            "type": "integer",
            "format": "int32"
          },
          "quantity": {
            "type": "integer",
            "format": "int32"
          },
          "totalCents": {
            "type": "integer",
            "format": "int64"
          },
          "balanceCents": {
            "type": "integer",
            "format": "int64"
          },
          "balanceAfterCents": {
            "type": "integer",
            "format": "int64"
          },
          "insufficient": {
            "type": "boolean"
          },
          "term": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/QuoteTermView"
              }
            ]
          },
          "planChange": {
            "type": "boolean"
          }
        }
      },
      "SendNotificationBody": {
        "required": [
          "clientIds",
          "title",
          "body"
        ],
        "type": "object",
        "properties": {
          "clientIds": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "title": {
            "type": [
              "null",
              "string"
            ]
          },
          "body": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "StaticIpAdded": {
        "required": [
          "ip",
          "until",
          "months",
          "extended",
          "chargedCents",
          "balanceCents"
        ],
        "type": "object",
        "properties": {
          "ip": {
            "type": "string"
          },
          "until": {
            "type": "string",
            "format": "date-time"
          },
          "months": {
            "type": "integer",
            "format": "int32"
          },
          "extended": {
            "type": "boolean"
          },
          "chargedCents": {
            "type": "integer",
            "format": "int64"
          },
          "balanceCents": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "SuspendResult": {
        "required": [
          "suspended",
          "sessionsDisconnected"
        ],
        "type": "object",
        "properties": {
          "suspended": {
            "type": "boolean"
          },
          "sessionsDisconnected": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "TermPrices": {
        "required": [
          "monthly",
          "6month",
          "yearly"
        ],
        "type": "object",
        "properties": {
          "monthly": {
            "type": "integer",
            "format": "int32"
          },
          "6month": {
            "type": "integer",
            "format": "int32"
          },
          "yearly": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "UsageDay": {
        "required": [
          "date",
          "downBytes",
          "upBytes"
        ],
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "format": "date"
          },
          "downBytes": {
            "type": "integer",
            "format": "int64"
          },
          "upBytes": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "UsageLocation": {
        "required": [
          "countryCode",
          "bytes"
        ],
        "type": "object",
        "properties": {
          "countryCode": {
            "type": "string"
          },
          "bytes": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "WalletTransaction": {
        "required": [
          "id",
          "type",
          "amountCents",
          "balanceAfterCents",
          "reference",
          "note",
          "createdAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "type": {
            "type": "string"
          },
          "amountCents": {
            "type": "integer",
            "format": "int64"
          },
          "balanceAfterCents": {
            "type": "integer",
            "format": "int64"
          },
          "reference": {
            "type": [
              "null",
              "string"
            ]
          },
          "note": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "WalletView": {
        "required": [
          "balanceCents",
          "currency",
          "transactions"
        ],
        "type": "object",
        "properties": {
          "balanceCents": {
            "type": "integer",
            "format": "int64"
          },
          "currency": {
            "type": "string"
          },
          "transactions": {
            "$ref": "#/components/schemas/PagedOfWalletTransaction"
          }
        }
      }
    },
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "description": "Your Reseller API key, created on the API page of the reseller portal.",
        "scheme": "bearer",
        "bearerFormat": "zrk_…"
      }
    }
  },
  "security": [
    {
      "apiKey": [ ]
    }
  ],
  "tags": [
    {
      "name": "Account"
    },
    {
      "name": "Plans"
    },
    {
      "name": "Clients"
    },
    {
      "name": "Codes"
    },
    {
      "name": "Notifications"
    },
    {
      "name": "Wallet"
    }
  ]
}