{
  "openapi": "3.1.0",
  "info": {
    "title": "IZON API",
    "version": "1.0.0",
    "description": "API for the customer's own AI assistant to manage domains, DNS, hosting and orders on IZON. Payment and identity verification (eKYC) are never available through the API; they stay with the human owner. DNS changes are stored in IZON with trang_thai 'cho_dong_bo' (waiting to sync with the registrar) and installed by IZON staff during business hours; do not report them as live until trang_thai is 'da_dong_bo'. Plain-language guide for agents: /llms.txt. Error bodies: {ok:false, code (English), loi (Vietnamese)}. Rate limit 60 requests/minute per key."
  },
  "servers": [
    {
      "url": "/",
      "description": "Same origin as this file"
    }
  ],
  "security": [
    {
      "apiKey": []
    }
  ],
  "tags": [
    {
      "name": "Tài khoản"
    },
    {
      "name": "Tên miền"
    },
    {
      "name": "DNS"
    },
    {
      "name": "Hosting"
    },
    {
      "name": "Đơn hàng"
    }
  ],
  "paths": {
    "/api/v1": {
      "get": {
        "tags": [
          "Tài khoản"
        ],
        "operationId": "index",
        "summary": "API index (no auth)",
        "security": [],
        "responses": {
          "200": {
            "description": "Links to docs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "ten": {
                      "type": "string"
                    },
                    "tai_lieu": {
                      "type": "string"
                    },
                    "openapi": {
                      "type": "string"
                    },
                    "xac_thuc": {
                      "type": "string"
                    },
                    "lay_key": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/me": {
      "get": {
        "tags": [
          "Tài khoản"
        ],
        "operationId": "getMe",
        "summary": "Who owns this key",
        "responses": {
          "200": {
            "description": "Account",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "nguoi": {
                      "type": "object",
                      "properties": {
                        "email": {
                          "type": "string"
                        },
                        "ten": {
                          "type": "string"
                        },
                        "loai": {
                          "type": "string",
                          "enum": [
                            "ca_nhan",
                            "to_chuc"
                          ]
                        },
                        "ho_so_day_du": {
                          "type": "boolean",
                          "description": "Owner identity profile complete (needed to create orders)"
                        }
                      }
                    },
                    "so_ten_mien": {
                      "type": "integer"
                    },
                    "key": {
                      "type": "object",
                      "properties": {
                        "prefix": {
                          "type": "string"
                        }
                      }
                    },
                    "gioi_han": {
                      "type": "object",
                      "properties": {
                        "moi_phut": {
                          "type": "integer"
                        }
                      }
                    },
                    "viec_chu_tai_khoan_tu_lam": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Tasks only the human owner can do"
                    },
                    "quan_ly": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Loi"
          },
          "401": {
            "$ref": "#/components/responses/ChuaXacThuc"
          },
          "429": {
            "$ref": "#/components/responses/QuaNhanh"
          }
        }
      }
    },
    "/api/v1/kiem": {
      "get": {
        "tags": [
          "Tên miền"
        ],
        "operationId": "checkDomain",
        "summary": "Check availability and price",
        "parameters": [
          {
            "name": "ten",
            "in": "query",
            "required": true,
            "description": "A label (checks .vn, .com, .com.vn) or a full name",
            "schema": {
              "type": "string",
              "example": "tiembanhmai"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "ket_qua": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/KetQuaKiem"
                      }
                    },
                    "chu_thich": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Loi"
          },
          "401": {
            "$ref": "#/components/responses/ChuaXacThuc"
          },
          "429": {
            "$ref": "#/components/responses/QuaNhanh"
          }
        }
      }
    },
    "/api/v1/goi-y": {
      "post": {
        "tags": [
          "Tên miền"
        ],
        "operationId": "suggestDomains",
        "summary": "Domain name ideas (max 8/min)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GoiYVao"
              },
              "examples": {
                "vi_du": {
                  "value": {
                    "thuong_hieu": "Tiệm bánh Mai",
                    "nganh": "tiệm bánh kem",
                    "mo_ta": "bánh kem sinh nhật ở Thủ Đức"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Ideas (labels without extension)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "ai_chay": {
                      "type": "boolean"
                    },
                    "goi_y": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "ten": {
                            "type": "string"
                          },
                          "nhom": {
                            "type": "string",
                            "enum": [
                              "ca_nhan",
                              "ngan",
                              "tieng_viet",
                              "thuong_hieu"
                            ]
                          },
                          "y_nghia": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Loi"
          },
          "401": {
            "$ref": "#/components/responses/ChuaXacThuc"
          },
          "429": {
            "$ref": "#/components/responses/QuaNhanh"
          }
        }
      }
    },
    "/api/v1/ten-mien": {
      "get": {
        "tags": [
          "Tên miền"
        ],
        "operationId": "listDomains",
        "summary": "Owner's domains and names waiting for payment",
        "responses": {
          "200": {
            "description": "Domains",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "ten_mien": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/TenMien"
                      }
                    },
                    "dang_cho_thanh_toan": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "ten": {
                            "type": "string"
                          },
                          "ma_don": {
                            "type": "string"
                          },
                          "trang_thai_don": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "ghi_chu": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Loi"
          },
          "401": {
            "$ref": "#/components/responses/ChuaXacThuc"
          },
          "429": {
            "$ref": "#/components/responses/QuaNhanh"
          }
        }
      }
    },
    "/api/v1/ten-mien/{ten}": {
      "parameters": [
        {
          "name": "ten",
          "in": "path",
          "required": true,
          "description": "Domain name, e.g. tiembanhmai.vn",
          "schema": {
            "type": "string",
            "example": "tiembanhmai.vn"
          }
        }
      ],
      "get": {
        "tags": [
          "Tên miền"
        ],
        "operationId": "getDomain",
        "summary": "One domain with DNS records",
        "responses": {
          "200": {
            "description": "Domain",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "ten_mien": {
                      "$ref": "#/components/schemas/TenMien"
                    },
                    "dns": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/BanGhi"
                      }
                    },
                    "canh_bao": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/KhongThay"
          },
          "409": {
            "$ref": "#/components/responses/XungDot"
          },
          "400": {
            "$ref": "#/components/responses/Loi"
          },
          "401": {
            "$ref": "#/components/responses/ChuaXacThuc"
          },
          "429": {
            "$ref": "#/components/responses/QuaNhanh"
          }
        }
      }
    },
    "/api/v1/ten-mien/{ten}/dns": {
      "parameters": [
        {
          "name": "ten",
          "in": "path",
          "required": true,
          "description": "Domain name, e.g. tiembanhmai.vn",
          "schema": {
            "type": "string",
            "example": "tiembanhmai.vn"
          }
        }
      ],
      "get": {
        "tags": [
          "DNS"
        ],
        "operationId": "listDnsRecords",
        "summary": "List DNS records",
        "responses": {
          "200": {
            "description": "Records",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "ten_mien": {
                      "type": "string"
                    },
                    "dns": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/BanGhi"
                      }
                    },
                    "ghi_chu_dong_bo": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/KhongThay"
          },
          "400": {
            "$ref": "#/components/responses/Loi"
          },
          "401": {
            "$ref": "#/components/responses/ChuaXacThuc"
          },
          "429": {
            "$ref": "#/components/responses/QuaNhanh"
          }
        }
      },
      "post": {
        "tags": [
          "DNS"
        ],
        "operationId": "createDnsRecord",
        "summary": "Create a DNS record (stored as cho_dong_bo)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BanGhiVao"
              },
              "examples": {
                "a": {
                  "value": {
                    "type": "A",
                    "name": "shop",
                    "value": "103.97.125.10"
                  }
                },
                "mx": {
                  "value": {
                    "type": "MX",
                    "name": "@",
                    "value": "smtp.google.com",
                    "priority": 1
                  }
                },
                "txt": {
                  "value": {
                    "type": "TXT",
                    "name": "@",
                    "value": "google-site-verification=abc123"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "ban_ghi": {
                      "$ref": "#/components/schemas/BanGhi"
                    },
                    "ghi_chu_dong_bo": {
                      "type": "string"
                    },
                    "canh_bao": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/KhongThay"
          },
          "409": {
            "$ref": "#/components/responses/XungDot"
          },
          "400": {
            "$ref": "#/components/responses/Loi"
          },
          "401": {
            "$ref": "#/components/responses/ChuaXacThuc"
          },
          "429": {
            "$ref": "#/components/responses/QuaNhanh"
          }
        }
      }
    },
    "/api/v1/ten-mien/{ten}/dns/{id}": {
      "parameters": [
        {
          "name": "ten",
          "in": "path",
          "required": true,
          "description": "Domain name, e.g. tiembanhmai.vn",
          "schema": {
            "type": "string",
            "example": "tiembanhmai.vn"
          }
        },
        {
          "name": "id",
          "in": "path",
          "required": true,
          "description": "DNS record id",
          "schema": {
            "type": "integer"
          }
        }
      ],
      "patch": {
        "tags": [
          "DNS"
        ],
        "operationId": "updateDnsRecord",
        "summary": "Change name, value, ttl or priority (type is fixed)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "value": {
                    "type": "string"
                  },
                  "ttl": {
                    "type": "integer",
                    "minimum": 300,
                    "maximum": 86400
                  },
                  "priority": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 65535
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "ban_ghi": {
                      "$ref": "#/components/schemas/BanGhi"
                    },
                    "ghi_chu_dong_bo": {
                      "type": "string"
                    },
                    "ghi_chu": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/KhongThay"
          },
          "409": {
            "$ref": "#/components/responses/XungDot"
          },
          "400": {
            "$ref": "#/components/responses/Loi"
          },
          "401": {
            "$ref": "#/components/responses/ChuaXacThuc"
          },
          "429": {
            "$ref": "#/components/responses/QuaNhanh"
          }
        }
      },
      "delete": {
        "tags": [
          "DNS"
        ],
        "operationId": "deleteDnsRecord",
        "summary": "Delete a DNS record (ask the owner first)",
        "responses": {
          "200": {
            "description": "Deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "da_xoa": {
                      "$ref": "#/components/schemas/BanGhi"
                    },
                    "ghi_chu": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/KhongThay"
          },
          "400": {
            "$ref": "#/components/responses/Loi"
          },
          "401": {
            "$ref": "#/components/responses/ChuaXacThuc"
          },
          "429": {
            "$ref": "#/components/responses/QuaNhanh"
          }
        }
      }
    },
    "/api/v1/ten-mien/{ten}/gan-host": {
      "parameters": [
        {
          "name": "ten",
          "in": "path",
          "required": true,
          "description": "Domain name, e.g. tiembanhmai.vn",
          "schema": {
            "type": "string",
            "example": "tiembanhmai.vn"
          }
        }
      ],
      "post": {
        "tags": [
          "DNS"
        ],
        "operationId": "pointDomainToHost",
        "summary": "Point domain (A @ + CNAME www) or a subdomain (A) to a server IP",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "ip": {
                    "type": "string",
                    "description": "Public IPv4"
                  },
                  "hosting_id": {
                    "type": "integer",
                    "description": "Id from GET /api/v1/hosting with san_sang true"
                  },
                  "ten_phu": {
                    "type": "string",
                    "description": "Subdomain label, e.g. shop. Omit for root + www"
                  },
                  "thay_the": {
                    "type": "boolean",
                    "description": "Remove existing A/AAAA/CNAME on those names. Only after the owner agrees."
                  }
                }
              },
              "examples": {
                "ip": {
                  "value": {
                    "ip": "103.97.125.10"
                  }
                },
                "hosting": {
                  "value": {
                    "hosting_id": 7
                  }
                },
                "ten_phu": {
                  "value": {
                    "ip": "103.97.125.10",
                    "ten_phu": "shop"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Already pointing there",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "ban_ghi": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/BanGhi"
                      }
                    },
                    "ghi_chu": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "201": {
            "description": "Records created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "ban_ghi": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/BanGhi"
                      }
                    },
                    "da_go": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/BanGhi"
                      }
                    },
                    "nguon_ip": {
                      "type": "string",
                      "enum": [
                        "ip",
                        "hosting_id"
                      ]
                    },
                    "ip": {
                      "type": "string"
                    },
                    "ghi_chu_dong_bo": {
                      "type": "string"
                    },
                    "canh_bao": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/KhongThay"
          },
          "409": {
            "$ref": "#/components/responses/XungDot"
          },
          "400": {
            "$ref": "#/components/responses/Loi"
          },
          "401": {
            "$ref": "#/components/responses/ChuaXacThuc"
          },
          "429": {
            "$ref": "#/components/responses/QuaNhanh"
          }
        }
      }
    },
    "/api/v1/hosting": {
      "get": {
        "tags": [
          "Hosting"
        ],
        "operationId": "listHosting",
        "summary": "Hosting and VPS requested from IZON",
        "responses": {
          "200": {
            "description": "Hosting",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "hosting": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer"
                          },
                          "loai": {
                            "type": "string",
                            "enum": [
                              "hosting",
                              "vps"
                            ]
                          },
                          "goi": {
                            "type": "string"
                          },
                          "ten_mien": {
                            "type": "string"
                          },
                          "trang_thai": {
                            "$ref": "#/components/schemas/TrangThaiDichVu"
                          },
                          "ip": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "created_at": {
                            "type": "string"
                          },
                          "san_sang": {
                            "type": "boolean"
                          }
                        }
                      }
                    },
                    "ghi_chu": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Loi"
          },
          "401": {
            "$ref": "#/components/responses/ChuaXacThuc"
          },
          "429": {
            "$ref": "#/components/responses/QuaNhanh"
          }
        }
      }
    },
    "/api/v1/don-hang": {
      "get": {
        "tags": [
          "Đơn hàng"
        ],
        "operationId": "listOrders",
        "summary": "Domain orders and service requests",
        "responses": {
          "200": {
            "description": "Orders",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "don_hang": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/DonHang"
                      }
                    },
                    "yeu_cau_dich_vu": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/YeuCauDichVu"
                      }
                    },
                    "chu_thich": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Loi"
          },
          "401": {
            "$ref": "#/components/responses/ChuaXacThuc"
          },
          "429": {
            "$ref": "#/components/responses/QuaNhanh"
          }
        }
      },
      "post": {
        "tags": [
          "Đơn hàng"
        ],
        "operationId": "createOrder",
        "summary": "Create an order that waits for the OWNER to pay (never marks paid). Confirm with the owner first.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "items"
                ],
                "properties": {
                  "items": {
                    "type": "array",
                    "maxItems": 20,
                    "items": {
                      "type": "object",
                      "required": [
                        "ten"
                      ],
                      "properties": {
                        "ten": {
                          "type": "string",
                          "example": "tiembanhmai.vn"
                        },
                        "nam": {
                          "type": "integer",
                          "enum": [
                            1,
                            2,
                            3,
                            5
                          ],
                          "default": 1
                        },
                        "loai": {
                          "type": "string",
                          "enum": [
                            "moi",
                            "gia_han"
                          ],
                          "default": "moi"
                        }
                      }
                    }
                  }
                }
              },
              "examples": {
                "vi_du": {
                  "value": {
                    "items": [
                      {
                        "ten": "tiembanhmai.vn",
                        "nam": 1
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Order created, waiting for payment",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "don": {
                      "$ref": "#/components/schemas/DonHang"
                    },
                    "thanh_toan": {
                      "type": "string",
                      "description": "Tell the owner this; you cannot pay"
                    },
                    "xem_don": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/KhongThay"
          },
          "409": {
            "$ref": "#/components/responses/XungDot"
          },
          "400": {
            "$ref": "#/components/responses/Loi"
          },
          "401": {
            "$ref": "#/components/responses/ChuaXacThuc"
          },
          "429": {
            "$ref": "#/components/responses/QuaNhanh"
          }
        }
      }
    },
    "/api/v1/dich-vu": {
      "post": {
        "tags": [
          "Hosting"
        ],
        "operationId": "requestService",
        "summary": "Request hosting, VPS, email or SSL (IZON emails a quote). Confirm with the owner first.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "loai"
                ],
                "properties": {
                  "loai": {
                    "type": "string",
                    "enum": [
                      "hosting",
                      "vps",
                      "email",
                      "ssl",
                      "web",
                      "seo",
                      "maps",
                      "tro_ly_ai"
                    ]
                  },
                  "goi": {
                    "type": "string",
                    "maxLength": 80
                  },
                  "ten_mien": {
                    "type": "string"
                  },
                  "ghi_chu": {
                    "type": "string",
                    "maxLength": 1000
                  }
                }
              },
              "examples": {
                "vi_du": {
                  "value": {
                    "loai": "hosting",
                    "goi": "Cơ bản",
                    "ten_mien": "tiembanhmai.vn",
                    "ghi_chu": "Web bán bánh"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Request stored",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "yeu_cau": {
                      "$ref": "#/components/schemas/YeuCauDichVu"
                    },
                    "ghi_chu": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Loi"
          },
          "401": {
            "$ref": "#/components/responses/ChuaXacThuc"
          },
          "429": {
            "$ref": "#/components/responses/QuaNhanh"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "izon_ + 40 base62 chars",
        "description": "Authorization: Bearer izon_... The owner creates it at /quan-ly#ket-noi-ai."
      }
    },
    "responses": {
      "Loi": {
        "description": "Bad request",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Loi"
            }
          }
        }
      },
      "ChuaXacThuc": {
        "description": "Missing, malformed or revoked key",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Loi"
            }
          }
        }
      },
      "QuaNhanh": {
        "description": "Rate limited (60/min per key). Wait 60 s.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Loi"
            }
          }
        }
      },
      "KhongThay": {
        "description": "Not found (domain_not_found, record_not_found, hosting_not_found)",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Loi"
            }
          }
        }
      },
      "XungDot": {
        "description": "Conflict (domain_not_paid, duplicate, cname_conflict, records_exist, hosting_not_ready, profile_incomplete, domain_taken, limit_reached)",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Loi"
            }
          }
        }
      }
    },
    "schemas": {
      "Loi": {
        "type": "object",
        "required": [
          "ok",
          "code",
          "loi"
        ],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": false
          },
          "code": {
            "type": "string",
            "description": "English error code"
          },
          "loi": {
            "type": "string",
            "description": "Vietnamese message, safe to show the owner"
          },
          "ban_ghi_dang_co": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BanGhi"
            }
          },
          "ban_ghi_trung": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "khong_duoc": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "KetQuaKiem": {
        "type": "object",
        "properties": {
          "ten": {
            "type": "string"
          },
          "trang_thai": {
            "type": "string",
            "enum": [
              "trong",
              "co_chu",
              "khong_ro"
            ],
            "description": "trong = available, co_chu = taken, khong_ro = unknown"
          },
          "gia_nam_dau_chua_thue": {
            "type": "integer",
            "description": "VND per year before VAT"
          },
          "tien_1_nam_gom_thue": {
            "type": "integer",
            "description": "VND, 1 year including VAT"
          }
        }
      },
      "GoiYVao": {
        "type": "object",
        "properties": {
          "thuong_hieu": {
            "type": "string",
            "description": "Brand name"
          },
          "nganh": {
            "type": "string",
            "description": "Industry"
          },
          "ho_ten": {
            "type": "string",
            "description": "Owner name (for personal domains)"
          },
          "biet_danh": {
            "type": "string",
            "description": "Nickname"
          },
          "mo_ta": {
            "type": "string",
            "description": "Short business description"
          }
        }
      },
      "TenMien": {
        "type": "object",
        "properties": {
          "ten": {
            "type": "string"
          },
          "trang_thai": {
            "type": "string",
            "enum": [
              "hoat_dong",
              "cho_ekyc",
              "tam_khoa",
              "het_han"
            ]
          },
          "da_xac_thuc_chinh_chu": {
            "type": "boolean"
          },
          "ngay_dang_ky": {
            "type": "string"
          },
          "ngay_het_han": {
            "type": "string"
          },
          "tu_gia_han": {
            "type": "boolean"
          },
          "khoa_chuyen": {
            "type": "boolean"
          },
          "may_chu_ten": {
            "oneOf": [
              {
                "type": "string",
                "const": "mac_dinh_izon"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ]
          }
        }
      },
      "BanGhiVao": {
        "type": "object",
        "required": [
          "type",
          "value"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "A",
              "AAAA",
              "CNAME",
              "MX",
              "TXT"
            ]
          },
          "name": {
            "type": "string",
            "default": "@",
            "description": "@ for root, a label, or a full name"
          },
          "value": {
            "type": "string"
          },
          "ttl": {
            "type": "integer",
            "minimum": 300,
            "maximum": 86400,
            "default": 3600
          },
          "priority": {
            "type": "integer",
            "minimum": 0,
            "maximum": 65535,
            "default": 10,
            "description": "MX only"
          }
        }
      },
      "BanGhi": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "type": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "ten_day_du": {
            "type": "string"
          },
          "value": {
            "type": "string"
          },
          "ttl": {
            "type": "integer"
          },
          "priority": {
            "type": [
              "integer",
              "null"
            ]
          },
          "trang_thai": {
            "type": "string",
            "enum": [
              "cho_dong_bo",
              "da_dong_bo"
            ],
            "description": "cho_dong_bo = stored in IZON, waiting for IZON staff to install at the registrar; da_dong_bo = installed at the registrar"
          },
          "created_by": {
            "type": "string",
            "enum": [
              "web",
              "api"
            ]
          },
          "created_at": {
            "type": "string"
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "TrangThaiDichVu": {
        "type": "string",
        "enum": [
          "moi",
          "dang_xu_ly",
          "da_ban_giao",
          "da_huy"
        ]
      },
      "YeuCauDichVu": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "loai": {
            "type": "string",
            "enum": [
              "hosting",
              "vps",
              "email",
              "ssl",
              "web",
              "seo",
              "maps",
              "tro_ly_ai"
            ]
          },
          "goi": {
            "type": "string"
          },
          "ten_mien": {
            "type": "string"
          },
          "ghi_chu": {
            "type": "string"
          },
          "trang_thai": {
            "$ref": "#/components/schemas/TrangThaiDichVu"
          },
          "created_at": {
            "type": "string"
          }
        }
      },
      "DonHang": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "ten": {
                  "type": "string"
                },
                "tld": {
                  "type": "string"
                },
                "nam": {
                  "type": "integer"
                },
                "loai": {
                  "type": "string",
                  "enum": [
                    "moi",
                    "gia_han"
                  ]
                },
                "truocThue": {
                  "type": "integer"
                },
                "thue": {
                  "type": "integer"
                },
                "tong": {
                  "type": "integer"
                }
              }
            }
          },
          "subtotal": {
            "type": "integer"
          },
          "tax": {
            "type": "integer"
          },
          "total": {
            "type": "integer"
          },
          "status": {
            "type": "string",
            "enum": [
              "cho_thanh_toan",
              "cho_xac_nhan",
              "da_thanh_toan",
              "da_huy"
            ]
          },
          "created_at": {
            "type": "string"
          },
          "paid_at": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      }
    }
  }
}