• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • Support for BIND DNS has been removed from Plesk for Windows due to security and maintenance risks.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS.

Question Add plan with api

colubian

New Pleskian
Server operating system version
centos 7
Plesk version and microupdate number
last
Hello to all friends! I had a small question how to add a plan to a client with api because with api I can create clients but not assign them a plan?

thanks
 
In Plesk you don't assign a Service Plan to a customer, but to a subscription. On the REST API you can use the /domains endpoint and specify the Service Plan in the body. See example bellow.
JSON:
{
  "name": "example.com",
  "hosting_type": "virtual",
  "hosting_settings": {
    "ftp_login": "test_login",
    "ftp_password": "changeme1Q**"
  },
  "owner_client": {
    "id": 7,
    "login": "owner",
    "guid": "b623e93d-dc72-4102-b5f0-ded427cf0fb1",
    "external_id": "b623e93d-dc72-4102-b5f0-ded427cf0fb1"
  },
  "ip_addresses": [
    "93.184.216.34",
    "2606:2800:220:1:248:1893:25c8:1946"
  ],
  "plan": {
    "name": "Unlimited"
  }
}

On the XML API you'd use the webspace descriptor to create a subscription on which you can specify a Service Plan.
 
Back
Top