# Datacenter & ISP Proxies

Operations for datacenter and ISP proxies

## Get active proxies by order

`GET /user/api/proxies/active`

```json
{
  "tags": [
    "Datacenter & ISP Proxies"
  ],
  "summary": "Get active proxies by order",
  "parameters": [
    {
      "in": "query",
      "name": "order_id",
      "required": true,
      "schema": {
        "type": "integer"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "Proxy list",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ActiveProxyItem"
                }
              },
              "order_tag": {
                "type": "string",
                "nullable": true
              }
            },
            "required": [
              "success",
              "data"
            ]
          }
        }
      }
    },
    "403": {
      "description": "Method is unavailable for this order",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ApiError"
          }
        }
      }
    }
  }
}
```

## Set per-IP deletion (del-np)

`POST /user/api/orders/{order_id}/del-np/set`

```json
{
  "tags": [
    "Datacenter & ISP Proxies"
  ],
  "summary": "Set per-IP deletion (del-np)",
  "description": "Only for Datacenter & ISP proxies. After updating, the order `quantity` and `price_paid` are recalculated.",
  "parameters": [
    {
      "in": "path",
      "name": "order_id",
      "required": true,
      "schema": {
        "type": "integer"
      }
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "items": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "ip": {
                    "type": "string"
                  },
                  "value": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "ip",
                  "value"
                ]
              }
            }
          },
          "required": [
            "items"
          ]
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "Success",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "400": {
      "description": "Validation error / not DC-ISP / keep=0",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ApiError"
          }
        }
      }
    }
  }
}
```

## Set the IP OS fingerprint

`POST /user/api/orders/{order_id}/signature/set`

```json
{
  "tags": [
    "Datacenter & ISP Proxies"
  ],
  "summary": "Set the IP OS fingerprint",
  "description": "Sets the OS-fingerprint signature for one or more proxy IPs.  \nRequires the `p0f_slots` add-on to be active on the order.\n\nEach IP that receives a signature permanently occupies one slot.\nChanging the OS value on an IP that already has a signature does not consume an extra slot.\n\n**Available signature values:**\n\n| Value | OS |\n|-------|----|\n| `ios` | iOS |\n| `macos` | macOS |\n| `android` | Android |\n| `linux` | Linux |\n| `win10` | Windows 10 |\n| `win11` | Windows 11 |",
  "parameters": [
    {
      "in": "path",
      "name": "order_id",
      "required": true,
      "schema": {
        "type": "integer"
      }
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "required": [
            "items"
          ],
          "properties": {
            "items": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "ip",
                  "signature"
                ],
                "properties": {
                  "ip": {
                    "type": "string"
                  },
                  "signature": {
                    "type": "string",
                    "description": "OS identifier to spoof.",
                    "enum": [
                      "ios",
                      "macos",
                      "android",
                      "linux",
                      "win10",
                      "win11"
                    ]
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "Success",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              },
              "updated": {
                "type": "integer",
                "description": "Number of IPs updated"
              }
            }
          }
        }
      }
    },
    "400": {
      "description": "Validation error or not enough slots",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ApiError"
          }
        }
      }
    }
  }
}
```

## Calculate add-on cost

`GET /user/api/orders/{order_id}/addons/calculate`

```json
{
  "tags": [
    "Datacenter & ISP Proxies"
  ],
  "summary": "Calculate add-on cost",
  "description": "Returns the price preview for purchasing additional units of a given add-on for an active datacenter/ISP order. Currently the only supported add-on key is `p0f_slots`; OS-fingerprint signature slots.",
  "parameters": [
    {
      "in": "path",
      "name": "order_id",
      "required": true,
      "description": "Order ID",
      "schema": {
        "type": "integer"
      }
    },
    {
      "in": "query",
      "name": "addon_key",
      "required": true,
      "description": "Add-on identifier (e.g. `p0f_slots`)",
      "schema": {
        "type": "string"
      }
    },
    {
      "in": "query",
      "name": "add_qty",
      "required": true,
      "description": "Number of units to add",
      "schema": {
        "type": "integer",
        "minimum": 1
      }
    }
  ],
  "responses": {
    "200": {
      "description": "Price preview",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "addon_key": {
                "type": "string"
              },
              "catalog_id": {
                "type": "integer"
              },
              "price_per_unit": {
                "type": "integer",
                "description": "Price per unit in cents"
              },
              "current_qty": {
                "type": "integer"
              },
              "add_qty": {
                "type": "integer"
              },
              "new_qty": {
                "type": "integer"
              },
              "add_total": {
                "type": "integer",
                "description": "Total charge for this purchase in cents"
              }
            }
          }
        }
      }
    }
  }
}
```

## Purchase an add-on

`POST /user/api/orders/{order_id}/addons/purchase`

```json
{
  "tags": [
    "Datacenter & ISP Proxies"
  ],
  "summary": "Purchase an add-on",
  "description": "Immediately charges the wallet and adds the requested number of add-on units to the order. The order must be **active**. The only currently available add-on key is `p0f_slots`.",
  "parameters": [
    {
      "in": "path",
      "name": "order_id",
      "required": true,
      "description": "Order ID",
      "schema": {
        "type": "integer"
      }
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "required": [
            "addon_key",
            "add_qty"
          ],
          "properties": {
            "addon_key": {
              "type": "string"
            },
            "add_qty": {
              "type": "integer",
              "minimum": 1
            }
          }
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "Add-on purchased",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              },
              "addons_price_paid": {
                "type": "integer",
                "description": "Cumulative add-on cost for this order (cents)"
              },
              "addons": {
                "type": "array",
                "description": "Updated add-on list stored on the order",
                "items": {
                  "$ref": "#/components/schemas/AddonLine"
                }
              }
            }
          }
        }
      }
    }
  }
}
```

## Schedule an add-on downgrade

`POST /user/api/orders/{order_id}/addons/schedule`

```json
{
  "tags": [
    "Datacenter & ISP Proxies"
  ],
  "summary": "Schedule an add-on downgrade",
  "description": "Schedules a **downgrade** of an add-on to take effect on the next renewal cycle. The new quantity must be lower than the current one. The change is stored as a `pending` marker and applied automatically when the order renews.",
  "parameters": [
    {
      "in": "path",
      "name": "order_id",
      "required": true,
      "description": "Order ID",
      "schema": {
        "type": "integer"
      }
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "required": [
            "addon_key",
            "action",
            "next_qty"
          ],
          "properties": {
            "addon_key": {
              "type": "string"
            },
            "action": {
              "type": "string",
              "enum": [
                "downgrade"
              ]
            },
            "next_qty": {
              "type": "integer",
              "description": "Target quantity after renewal. Must be less than current qty.",
              "minimum": 1
            }
          }
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "Downgrade scheduled",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              },
              "addons": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/AddonLine"
                }
              }
            }
          }
        }
      }
    }
  }
}
```

## Cancel scheduled downgrade

`POST /user/api/orders/{order_id}/addons/schedule/cancel`

```json
{
  "tags": [
    "Datacenter & ISP Proxies"
  ],
  "summary": "Cancel scheduled downgrade",
  "description": "Removes the pending downgrade that was set via the schedule endpoint.",
  "parameters": [
    {
      "in": "path",
      "name": "order_id",
      "required": true,
      "description": "Order ID",
      "schema": {
        "type": "integer"
      }
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "required": [
            "addon_key"
          ],
          "properties": {
            "addon_key": {
              "type": "string"
            }
          }
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "Pending downgrade cleared",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              },
              "addons": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/AddonLine"
                }
              }
            }
          }
        }
      }
    }
  }
}
```
