Reseller API v1.0


Overview

The Reseller API allows you to manage contracts and their associated admin users under your master reseller account. Registration in the IONOS Partner Program is required for use of this REST based API.

The Reseller API is Swagger-enabled. You can quickly explore it by visiting the Swagger Online Demo and entering https://api.profitbricks.com/reseller/swagger.json in the box at the top of the page. Then press Explore to have the JSON file parsed into an easily readable format.

Access and Authorization

You can consume the Reseller API using the following endpoint:

URL Description
https://api.profitbricks.com/reseller Reseller API Endpoint

The API is secured using HTTP Basic Authentication in conjunction with SSL/TLS.

You will need to Base64 encode your credentials. Separate your username and password with a colon, i.e., username:password. Additional information and examples can be found in the Authorization section of the Cloud API - Getting Started documentation.

Operations

Available API operations are grouped by contracts and then admin users assigned to the contract.

We can verify that the Reseller API is accessible by making a GET request to the endpoint:

curl --include \
     --request GET \
     --user 'username@domain.tld:password' \
     https://api.profitbricks.com/reseller/

If we have provided valid credentials, then a JSON body should be returned with some basic information about the API.

{
    "href": "https://api.profitbricks.com/reseller/",
    "name": "Reseller REST API",
    "version": "1.0"
}

Contracts

Operations involving contracts are accessed at: https://api.profitbricks.com/reseller/contracts

List Contracts

This provides a complete list of contracts that are provisioned under the master reseller contract.

Request

To list all contracts, send a GET request to https://api.profitbricks.com/reseller/contracts

Request Headers

The request headers should include Base64 encoded user credentials - for example:

Authorization: Basic dXNlcm5hbWVAZG9tYWluLnRsZDpwYXNzd29yZA==

Response

The response is a JSON array containing information about all available contracts.

[
{
    "id": 1,
    "href": "/contracts/1",
    "name": "Company ACME",
    "resellerReference": "11111-22222",
    "status": "BILLABLE",
    "resourceLimits": {
        "ramServerMax": 4096,
        "cpuServerMax": 8,
        "hddVolumeMaxSize": 102400,
        "ssdVolumeMaxSize": 102400,
        "ramContractMax": 40960,
        "cpuContractMax": 80,
        "hddVolumeContractMaxSize": 1024000,
        "ssdVolumeContractMaxSize": 1024000,
        "ips": 10
   }
},
{
    "id": 2,
    "href": "/contracts/2",
    "name": "Company Other",
    "status": "BILLABLE",
    "resellerReference": null,
    "resourceLimits": {
        "ramServerMax": 4096,
        "cpuServerMax": 8,
        "hddVolumeMaxSize": 102400,
        "ssdVolumeMaxSize": 102400,
        "ramContractMax": 40960,
        "cpuContractMax": 80,
        "hddVolumeContractMaxSize": 1024000,
        "ssdVolumeContractMaxSize": 1024000,
        "ips": 10
   }
}
]

Response Parameters

The following table describes the attributes returned in the response body:

Name Description
id The ID for the specific contract. This can be passed to other APIs using the pb-contract-number header to indicate which contract the operation should apply to.
href Contract's URL.
name The display name for the contract.
status The status of the contract such as "BILLABLE" or "CEASED".
resellerReference An optional ID you may specify to help associate contract this with your own CRM system.
resourceLimits The resource limits for the contract.

Resource Limit Details:

Name Description
ramServerMax Amount of RAM (in MB, multiple of 256) allowed to be assigned to a single VM.
cpuServerMax Number of CPU cores (Max: 62) allowed to be assigned to a single VM.
hddVolumeMaxSize Maximum HDD volume capacity (in MB) allowed.
ssdVolumeMaxSize Maximum SSD volume capacity (in MB) allowed.
ramContractMax Total amount of RAM (in MB, multiple of 256) allowed to be used in all VMs within the contract.
cpuContractMax Total number of CPU cores allowed to be assigned in all VMs within the contract.
hddVolumeContractMaxSize Total HDD volume capacity (in MB) allowed within the contract.
ssdVolumeContractMaxSize Total SSD volume capacity (in MB) allowed within the contract.
ips Total number of reserved public IP addresses allowed within the contract.

Curl Example

The following shows how to submit the GET request using curl:

curl --include \
     --request GET \
     --user 'username@domain.tld:password' \
     https://api.profitbricks.com/reseller/contracts

Get Contract

Request

To request details on a specific contracts, send a GET request to https://api.profitbricks.com/reseller/contracts/{contractId}

Request Headers

The request headers should include Base64 encoded user credentials - for example:

Authorization: Basic dXNlcm5hbWVAZG9tYWluLnRsZDpwYXNzd29yZA==

Response

{
   "id": "{contractId}",
   "href": "/contracts/{contractId}",
   "name": "Company ACME",
   "status": "BILLABLE",
   "resellerReference": "11111-22222",
   "resourceLimits": {
       "ramServerMax": 4096,
       "cpuServerMax": 8,
       "hddVolumeMaxSize": 102400,
       "ssdVolumeMaxSize": 102400,
       "ramContractMax": 40960,
       "cpuContractMax": 80,
       "hddVolumeContractMaxSize": 1024000,
       "ssdVolumeContractMaxSize": 1024000,
       "ips": 10
   }
}
Response Parameters

The following table describes the attributes found in the response body:

Name Description
id The ID for the specific contract. This can be passed to other APIs using the pb-contract-number header to indicate which contract the operation should apply to.
href Contract's URL.
name The display name for the contract.
status The status of the contract such as "BILLABLE" or "CEASED".
resellerReference An optional ID you may specify to help associate contract this with your own CRM system.
resourceLimits The resource limits for the contract.

Resource Limit Details:

Name Description
ramServerMax Amount of RAM (in MB, multiple of 256) allowed to be assigned to a single VM.
cpuServerMax Number of CPU cores (Max: 62) allowed to be assigned to a single VM.
hddVolumeMaxSize Maximum HDD volume capacity (in MB) allowed.
ssdVolumeMaxSize Maximum SSD volume capacity (in MB) allowed.
ramContractMax Total amount of RAM (in MB, multiple of 256) allowed to be used in all VMs within the contract.
cpuContractMax Total number of CPU cores allowed to be assigned in all VMs within the contract.
hddVolumeContractMaxSize Total HDD volume capacity (in MB) allowed within the contract.
ssdVolumeContractMaxSize Total SSD volume capacity (in MB) allowed within the contract.
ips Total number of reserved public IP addresses allowed within the contract.

Curl Example

The following shows how to submit the GET request using curl:

curl --include \
     --request GET \
     --user 'username@domain.tld:password' \
     https://api.profitbricks.com/reseller/contracts/{contractId}

Create Contract

Request

A new contract is created by sending a POST request to https://api.profitbricks.com/reseller/contracts

Request Headers

The request headers should include Base64 encoded user credentials - for example:

Authorization: Basic dXNlcm5hbWVAZG9tYWluLnRsZDpwYXNzd29yZA==
Content-Type: application/json
Request Body
{
   "name": "Company ACME",
   "resellerReference": "11111-22222",
   "resourceLimits": {
       "ramServerMax": 4096,
       "cpuServerMax": 8,
       "hddVolumeMaxSize": 102400,
       "ssdVolumeMaxSize": 102400,
       "ramContractMax": 40960,
       "cpuContractMax": 80,
       "hddVolumeContractMaxSize": 1024000,
       "ssdVolumeContractMaxSize": 1024000,
       "ips": 10
   }
}
Request Parameters

The following table describes the request body:

Name Type Description Required
name String The display name for the contract. Yes
resellerReference String An optional ID you may specify to help associate contract this with your own CRM system. No
resourceLimits JSON Object Contract's assigned resource limits. Yes

Resource Limit Details:

Name Type Description Required
ramServerMax Integer Amount of RAM (in MB, multiple of 256) allowed to be assigned to a single VM. Yes
cpuServerMax Integer Number of CPU cores (Max: 62) allowed to be assigned to a single VM. Yes
hddVolumeMaxSize Integer Maximum HDD volume capacity (in MB) allowed. Yes
ssdVolumeMaxSize Integer Maximum SSD volume capacity (in MB) allowed. Yes
ramContractMax Integer Total amount of RAM (in MB, multiple of 256) allowed to be used in all VMs within the contract. Yes
cpuContractMax Integer Total number of CPU cores allowed to be assigned in all VMs within the contract. Yes
hddVolumeContractMaxSize Integer Total HDD volume capacity (in MB) allowed within the contract. Yes
ssdVolumeContractMaxSize Integer Total SSD volume capacity (in MB) allowed within the contract. Yes
ips Integer Total number of reserved public IP addresses allowed within the contract. Yes

Curl Example

The following shows how to submit the POST request using curl:

curl --include \
     --request POST \
     --user 'username@domain.tld:password' \
     --header "Content-Type: application/json" \
     --data-binary '{
       "name": "ExampleCompany001",
       "resellerReference": "ExampleRef001",
       "resourceLimits": {
           "ramServerMax": 8192,
           "cpuServerMax": 4,
           "hddVolumeMaxSize": 102400,
           "ssdVolumeMaxSize": 102400,
           "ramContractMax": 40960,
           "cpuContractMax": 40,
           "hddVolumeContractMaxSize": 1024000,
           "ssdVolumeContractMaxSize": 1024000,
           "ips": 12
       }' \
     https://api.profitbricks.com/reseller/contracts

Update Contract

The Reseller API accepts a PUT request to make updates to an existing contract. There are specific operations listed in the next two sections that can be used to update the name or resourceLimits of a contract. If you need to adjust another property, such as resellerReference, then you can use a PUT request as demonstrated here.

Request

A contract can be updated by sending a PUT request to: https://api.profitbricks.com/reseller/contracts/{contractId}

Request Headers

The request headers should include Base64 encoded user credentials - for example:

Authorization: Basic dXNlcm5hbWVAZG9tYWluLnRsZDpwYXNzd29yZA==
Content-Type: application/json
Request Body
{
   "name": "Company ACME",
   "resellerReference": "A001",
   "resourceLimits": {
       "ramServerMax": 4096,
       "cpuServerMax": 8,
       "hddVolumeMaxSize": 102400,
       "ssdVolumeMaxSize": 102400,
       "ramContractMax": 40960,
       "cpuContractMax": 80,
       "hddVolumeContractMaxSize": 1024000,
       "ssdVolumeContractMaxSize": 1024000,
       "ips": 10
   }
}

Curl Example

The following shows how to submit the PUT request using curl:

curl --include \
     --request PUT \
     --user 'username@domain.tld:password' \
     --header "Content-Type: application/json" \
     --data-binary '{
       "name": "Company ACME",
       "resellerReference": "A001",
       "resourceLimits": {
           "ramServerMax": 4096,
           "cpuServerMax": 8,
           "hddVolumeMaxSize": 102400,
           "ssdVolumeMaxSize": 102400,
           "ramContractMax": 40960,
           "cpuContractMax": 80,
           "hddVolumeContractMaxSize": 1024000,
           "ssdVolumeContractMaxSize": 1024000,
           "ips": 10
       }' \
     https://api.profitbricks.com/reseller/contracts

If the request is successful, you should get a 200 response showing the updated value for resellerReference that we passed in.

HTTP/1.1 200 OK
Date: Sat, 25 Feb 2017 00:22:20 GMT
Server: Apache/2.4.10 (Debian)
Pragma: No-cache
Cache-Control: no-cache
Expires: Thu, 01 Jan 1970 00:00:00 UTC
Content-Location: https://api.profitbricks.com/reseller/contracts/{contractId}
Content-Type: application/json
Strict-Transport-Security: max-age=15768000
Transfer-Encoding: chunked

{
  "id" : "contractId",
  "href" : "https://api.profitbricks.com/reseller/contracts/{contractId}",
  "name" : "Company ACME",
  "resellerReference" : "A001",
  "status" : "BILLABLE",
  "resourceLimits" : {
    "ramServerMax" : 8192,
    "cpuServerMax" : 4,
    "hddVolumeMaxSize" : 102400,
    "ssdVolumeMaxSize" : 102400,
    "ramContractMax" : 40960,
    "cpuContractMax" : 40,
    "hddVolumeContractMaxSize" : 1024000,
    "ssdVolumeContractMaxSize" : 1024000,
    "ips" : 4
  }
}

If there was an issue, you should get a 400 response with an additional error code and message that may be helpful in resolving the issue.

HTTP/1.1 400 Bad Request
Date: Sat, 25 Feb 2017 00:19:27 GMT
Server: Apache/2.4.10 (Debian)
Pragma: No-cache
Cache-Control: no-cache
Expires: Thu, 01 Jan 1970 00:00:00 UTC
Content-Type: application/json
Strict-Transport-Security: max-age=15768000
Connection: close
Transfer-Encoding: chunked

{
  "httpStatus" : 400,
  "messages" : [ {
    "errorCode" : "303",
    "message" : "Failed to parse request body"
  } ]
}

In that particular case, the API could not parse the request body because there was a missing curly brace.

Update Name

The name associated with a specific contract can be changed by making a PUT request to https://api.profitbricks.com/reseller/contracts/{contractId}/name

Request Headers

The request headers should include Base64 encoded user credentials - for example:

Authorization: Basic dXNlcm5hbWVAZG9tYWluLnRsZDpwYXNzd29yZA==
Content-Type: plain/text
Request Body

The body is the new contract name.

Curl Example

The following shows how to submit the PUT request using curl:

curl --include \
     --request PUT \
     --user 'username@domain.tld:password' \
     --header "Content-Type: plain/text" \
     -d "NewContractName" \
     https://api.profitbricks.com/reseller/contracts/{contractId}/name

Update Resource Limits

The resource limits associated with a specific contract can be changed by making a PUT request to https://api.profitbricks.com/reseller/contracts/{contractId}/resourceLimits

Request Headers

The request headers should include the following:

Authorization: Basic dXNlcm5hbWVAZG9tYWluLnRsZDpwYXNzd29yZA==
Content-Type: application/json
Request Body

The body is a JSON object containing the new resource limits.

{
   "ramServerMax": 4096,
   "cpuServerMax": 8,
   "hddVolumeMaxSize": 102400,
   "ssdVolumeMaxSize": 102400,
   "ramContractMax": 40960,
   "cpuContractMax": 80,
   "hddVolumeContractMaxSize": 1024000,
   "ssdVolumeContractMaxSize": 1024000,
   "ips": 10
}

Curl Example

The following shows how to submit the PUT request using curl:

curl --include \
     --request PUT \
     --user 'username@domain.tld:password' \
     --header "Content-Type: application/json" \
     --data-binary '{
           "ramServerMax": 8192,
           "cpuServerMax": 4,
           "hddVolumeMaxSize": 102400,
           "ssdVolumeMaxSize": 102400,
           "ramContractMax": 40960,
           "cpuContractMax": 40,
           "hddVolumeContractMaxSize": 1024000,
           "ssdVolumeContractMaxSize": 1024000,
           "ips": 12
       }' \
     https://api.profitbricks.com/reseller/contracts/{contractId}/resourceLimits

Admin Users

Operations involving admin users require a valid contractId and are accessed at: https://api.profitbricks.com/reseller/contracts/{contractId}/admins

List Admin Users

Request

A list of all admin users associated with a particular contract is returned when submitting a GET request to https://api.profitbricks.com/reseller/contracts/{contractId}/admins

Request Headers

The request headers should include Base64 encoded user credentials - for example:

Authorization: Basic dXNlcm5hbWVAZG9tYWluLnRsZDpwYXNzd29yZA==

Response

[
{
   "id": "2201551",
   "href": "/contracts/{ID}/admins/2201551",
   "firstName": "John",
   "lastName": "Smith",
   "email": "jsmith@acme.com"
},
{
   "id": "2201552",
   "href": "/contracts/{ID}/admins/2201552",
   "firstName": "Bruce",
   "lastName": "Moore",
   "email": "bmoore@acme.com"
}
]

Response Parameters

The following table describes the attributes found in the response body:

Name Description
id The admin user's ID.
href Admin user's reference URL.
firstName Admin user's first name.
lastName Admin user's last name.
email The admin user's email address.

Curl Example

The following shows how to submit the GET request using curl:

curl --include \
     --request GET \
     --user 'username@domain.tld:password' \
     https://api.profitbricks.com/reseller/contracts/{contractId}/admins

Get Admin User

Request

Details about a specific admin associated with a particular contract are returned when submitting a GET request to https://api.profitbricks.com/reseller/contracts/{contractId}/admins/{adminId}

Request Headers

The request headers should include Base64 encoded user credentials - for example:

Authorization: Basic dXNlcm5hbWVAZG9tYWluLnRsZDpwYXNzd29yZA==

Response

{
   "id": "2201551",
   "href": "/contracts/{ID}/admins/2201551",
   "firstName": "John",
   "lastName": "Smith",
   "email": "jsmith@acme.com"
}
Response Parameters

The following table describes the attributes found in the response body:

Name Description
id The admin user's ID.
href Admin user's reference URL.
firstName Admin user's first name.
lastName Admin user's last name.
email The admin user's email address.

Curl Example

The following shows how to submit the GET request using curl:

curl --include \
     --request GET \
     --user 'username@domain.tld:password' \
     https://api.profitbricks.com/reseller/contracts/{contractId}/admins/{adminId}

Create Admin User

Request

A new admin user can be created by submitting a POST request to https://api.profitbricks.com/reseller/contracts/{contractId}/admins

Request Headers

The request headers should include Base64 encoded user credentials - for example:

Authorization: Basic dXNlcm5hbWVAZG9tYWluLnRsZDpwYXNzd29yZA==
Content-Type: application/json

Request Body

{
   "firstName": "John",
   "lastName": "Smith",
   "email": "jsmith@acme.com",
   "password": "R@nd0mPWd4$9"
}

Request Parameters

The following table describes the request body:

Name Type Description Required
firstName String The admin user's first name. Yes
lastName String The admin user's last name. Yes
email String The admin user's email address. Yes
password String The admin user's password. Yes

Response

{
   "id": {adminId},
   "href": "/contracts/{contractId}/admins/{adminId}",
   "firstName": "John",
   "lastName": "Smith",
   "email": "jsmith@acme.com"
}

Response Parameters

The following table describes the attributes found in the response body:

Name Description
id The admin user's ID.
href Admin user's reference URL.
firstName Admin user's first name.
lastName Admin user's last name.
email The admin user's email address.

Curl Example

curl --include \
     --request POST \
     --user 'username@domain.tld:password' \
     --header "Content-Type: application/json" \
     --data-binary '{
       "firstName": "John",
       "lastName": "Smith",
       "email": "jsmith@acme.com",
       "password": "R@nd0m$PWd4$9"
       }' \
     https://api.profitbricks.com/reseller/contracts/{contractId}/admins

Update Admin User

Request

The attributes of an Admin User can be updated by submitting a PATCH request to:

https://api.profitbricks.com/reseller/contracts/{contractId}/admins/{adminId}

Request Headers

The request headers should include the following:

Authorization: Basic dXNlcm5hbWVAZG9tYWluLnRsZDpwYXNzd29yZA==
Content-Type: application/json

Request Body

{
   "firstName": "John",
   "lastName": "Smith",
   "email": "jsmith@acme.com"
}

Request Parameters

Name Type Description Required
firstName String Admin user's first name. No
lastName String Admin user's last name. No
email String Admin user's email address. No

Response

{
   "id": {adminId},
   "href": "/contracts/{contractId}/admins/{adminId}",
   "firstName": "John",
   "lastName": "Smith",
   "email": "jsmith@acme.com"
}
Response Parameters

The following table describes the attributes found in the response body:

Name Description
id Admin user's ID.
href Admin user's reference URL.
firstName Admin user's first name.
lastName Admin user's last name.
email Admin user's email address.

Curl Example

Here is an example demonstrating how to update an existing Admin User's firstName and lastName using curl:

curl --include \
     --request PATCH \
     --user 'username@domain.tld:password' \
     --header "Content-Type: application/json" \
     --data-binary '{
       "firstName": "Jonathan",
       "lastName": "Smythe"
       } \
     https://api.profitbricks.com/reseller/contracts/{contractId}/admins/{adminId}

Delete Admin User

An Admin User can be deleted by submitting a DELETE request to https://api.profitbricks.com/reseller/contracts/{contractId}/admins/{adminId}

Request Headers

The request headers should include Base64 encoded user credentials - for example:

Authorization: Basic dXNlcm5hbWVAZG9tYWluLnRsZDpwYXNzd29yZA==

Request Body

None

Response

None

Curl Example

curl --include \
     --request DELETE \
     --user 'username@domain.tld:password' \
     https://api.profitbricks.com/reseller/contracts/{contractId}/admins/{adminId}

Example

Let's go through an example of how to use the Reseller API in conjunction with the Cloud API to accomplish a basic provisioning task. These examples utilize curl, but other there are also browser-based plugins such as Postman that could be utilized to accomplish the same thing.

Create a Contract and Data Center

In this example, we'll use the reseller's account credentials to create a new contract. Using the same reseller credentials, we'll authenticate against the Cloud API, and provision a data center under the new contract.

First we make the request to create contract:

curl --include \
     --request POST \
     --user 'reseller_username@domain.tld:password' \
     --header "Content-Type: application/json" \
     --data-binary '{
       "name": "ExampleCompany001",
       "resourceLimits": {
           "ramServerMax": 8192,
           "cpuServerMax": 4,
           "hddVolumeMaxSize": 102400,
           "ssdVolumeMaxSize": 102400,
           "ramContractMax": 40960,
           "cpuContractMax": 40,
           "hddVolumeContractMaxSize": 1024000,
           "ssdVolumeContractMaxSize": 1024000,
           "ips": 4
         }
       }' \
     https://api.profitbricks.com/reseller/contracts

We should get a response similar to this:

HTTP/1.1 201 Created
Date: Fri, 19 Aug 2016 22:32:33 GMT
Server: ""
Location: https://api.profitbricks.com/reseller/contracts/31798850
Content-Type: application/json
Strict-Transport-Security: max-age=15768000
Transfer-Encoding: chunked

{
  "id" : "31798850",
   "href" : "https://api.profitbricks.com/reseller/contracts/31798850",
   "name" : "ExampleCompany001",
  "resellerReference" : null,
  "status" : "BILLABLE",
  "resourceLimits" : {
    "ramServerMax" : 8192,
    "cpuServerMax" : 4,
    "hddVolumeMaxSize" : 102400,
    "ssdVolumeMaxSize" : 102400,
    "ramContractMax" : 40960,
    "cpuContractMax" : 40,
    "hddVolumeContractMaxSize" : 1024000,
    "ssdVolumeContractMaxSize" : 1024000,
    "ips" : 4
  }
}

The significant portion of the output is the newly assigned contract "id" of 31798850.

The next set of calls will be made against the Cloud API v4 with an endpoint of https://api.profitbricks.com/cloudapi/v4/. We'll create a data center under this new contract. The significant difference from our normal interaction with the Cloud API is the addition of a new header, pb-contract-number, which allows us to specify the contract ID. Anytime we are making calls to the Cloud API with an account that has more than one contract under it, which is the case with our reseller account, we need to supply a valid contract number.

Here is the curl request to create a Virtual Data Center under this new contract:

curl --include \
     --request POST \
     --user 'reseller_username@domain.tld:password' \
     --header 'Content-Type: application/json' \
     --header 'pb-contract-number: 31798850' \
     --data-binary '{
       "properties": {
         "name": "ExampleDC001",
         "description": "Example Data Center 001",
         "location": "us/las"
       }
     }' \
     https://api.profitbricks.com/cloudapi/v4/datacenters

This should result in the return of output similar to:

HTTP/1.1 202 Accepted
Date: Fri, 19 Aug 2016 22:45:17 GMT
Server: ""
Location: https://api.profitbricks.com/cloudapi/v4/requests/3826ac07-82b8-485e-835d-3926621746a5/status
X-RateLimit-Remaining: 49
X-RateLimit-Burst: 50
X-RateLimit-Limit: 120
ETag: 3bc0c723a80f62531c6840d474e52a77
Content-Type: application/json
Strict-Transport-Security: max-age=15768000
Transfer-Encoding: chunked

{
  "id" : "06ac2bc3-f130-42bf-94c6-04d052285d61",
  "type" : "datacenter",
  "href" : "https://api.profitbricks.com/cloudapi/v4/datacenters/06ac2bc3-f130-42bf-94c6-04d052285d61",
  "metadata" : {
    "createdDate" : "2016-08-19T22:45:18Z",
    "createdBy" : "reseller_username@domain.tld:password",
    "etag" : "3bc0c723a80f62531c6840d474e52a77",
    "lastModifiedDate" : "2016-08-19T22:45:18Z",
    "lastModifiedBy" : "reseller_username@domain.tld:password",
    "state" : "BUSY"
  },
  "properties" : {
     "name" : "ExampleDC001",
     "description" : "Example Data Center 001",
     "location" : "us/las",
     "version" : null,
     "features" : [ ]
  }
 }

We can make use of the Location header returned in that output to make a query to see when provisioning has completed.

curl --include \
     --request GET \
     --user 'reseller_username@domain.tld:password' \
     --header 'pb-contract-number: 31798850' \
     https://api.profitbricks.com/cloudapi/v4/requests/3826ac07-82b8-485e-835d-3926621746a5/status

The output returned indicates the Virtual Data Center has been provisioned successfully:

HTTP/1.1 200 OK
...
Transfer-Encoding: chunked

{
  "id" : "3826ac07-82b8-485e-835d-3926621746a5/status",
  "type" : "request-status",
  "href" : "https://api.profitbricks.com/cloudapi/v4/requests/3826ac07-82b8-485e-835d-3926621746a5/status",
   "metadata" : {
    "status" : "DONE",
    "message" : "Request has been successfully executed",
    "etag" : "2ba22e58ca17bb728d522bba36cf8350",
    "targets" : [ {
      "target" : {
        "id" : "06ac2bc3-f130-42bf-94c6-04d052285d61",
        "type" : "datacenter",
        "href" : "https://api.profitbricks.com/cloudapi/v4/datacenters/06ac2bc3-f130-42bf-94c6-04d052285d61"
      },
      "status" : "DONE"
    } ]
  }
}

We also received the Virtual Data Center id, 06ac2bc3-f130-42bf-94c6-04d052285d61, which will be needed to provision additional resources.

We can continue interacting with the Cloud API, just remember to include the pb-contract-number header with all requests. This ensures that all newly provisioned resources will be associated with the correct contract.