• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

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