Skip to content

Select products

POST/tenants/{tenantId}/product-selection

Partner API · Tenants

Update tenant product selection.

Required permissionlicense_management:write

Parameters

Name In Type Required Description
X-Partner-ID header string (uuid) Yes Partner ID.
tenantId path string (uuid) Yes Tenant ID.

Request body

Content type: application/json

Request body fields

productsarray of objectrequired
Products list.
Items must be unique.
Sophos product code with an optional quantity.
Show child attributesHide child attributes
codestringrequired
Sophos product code.
Must match the pattern ^[A-Z][a-zA-Z]{0,19}([0-9]{0,4})([-_][a-zA-Z0-9]{0,20}([0-9]{0,3})){0,5}$.
quantityinteger
Quantity for the number of seats.
autoAssignServerboolean
Auto assign server products.
autoAssignEndpointboolean
Auto assign endpoint products.
previewOnlyboolean
Preview product selection.

Request samples

curl -X POST "https://api.central.sophos.com/partner/v1/tenants/<tenantId>/product-selection" -H "Authorization: Bearer <access-token>" -H "X-Partner-ID: <partner-id>" -H "Content-Type: application/json" -d "{
  \"products\": [
    {
      \"code\": \"CIXA-MSP\",
      \"quantity\": 10
    },
    {
      \"code\": \"CEMA-MSP\",
      \"quantity\": 10
    }
  ],
  \"autoAssignServer\": false,
  \"autoAssignEndpoint\": true,
  \"previewOnly\": false
}"

import requests

response = requests.post(
    "https://api.central.sophos.com/partner/v1/tenants/<tenantId>/product-selection",
    headers={
        "Authorization": "Bearer <access-token>",
        "X-Partner-ID": "<partner-id>",
        "Content-Type": "application/json",
    },
    json={   'products': [   {'code': 'CIXA-MSP', 'quantity': 10},
                    {'code': 'CEMA-MSP', 'quantity': 10}],
    'autoAssignServer': False,
    'autoAssignEndpoint': True,
    'previewOnly': False},
)
print(response.json())

$headers = @{
    "Authorization" = "Bearer <access-token>"
    "X-Partner-ID" = "<partner-id>"
    "Content-Type" = "application/json"
}
$body = '{
  "products": [
    {
      "code": "CIXA-MSP",
      "quantity": 10
    },
    {
      "code": "CEMA-MSP",
      "quantity": 10
    }
  ],
  "autoAssignServer": false,
  "autoAssignEndpoint": true,
  "previewOnly": false
}'
Invoke-RestMethod -Method POST -Uri "https://api.central.sophos.com/partner/v1/tenants/<tenantId>/product-selection" -Headers $headers -Body $body -ContentType "application/json"

package main

import (
    "fmt"
    "io"
    "net/http"
    "strings"
)

func main() {
    req, err := http.NewRequest("POST", "https://api.central.sophos.com/partner/v1/tenants/<tenantId>/product-selection", strings.NewReader(`{
  "products": [
    {
      "code": "CIXA-MSP",
      "quantity": 10
    },
    {
      "code": "CEMA-MSP",
      "quantity": 10
    }
  ],
  "autoAssignServer": false,
  "autoAssignEndpoint": true,
  "previewOnly": false
}`))
    if err != nil {
        panic(err)
    }
    req.Header.Set("Authorization", "Bearer <access-token>")
    req.Header.Set("X-Partner-ID", "<partner-id>")
    req.Header.Set("Content-Type", "application/json")

    resp, err := http.DefaultClient.Do(req)
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()

    body, _ := io.ReadAll(resp.Body)
    fmt.Println(string(body))
}

const response = await fetch("https://api.central.sophos.com/partner/v1/tenants/<tenantId>/product-selection", {
  method: "POST",
  headers: {
    "Authorization": "Bearer <access-token>",
    "X-Partner-ID": "<partner-id>",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
  "products": [
    {
      "code": "CIXA-MSP",
      "quantity": 10
    },
    {
      "code": "CEMA-MSP",
      "quantity": 10
    }
  ],
  "autoAssignServer": false,
  "autoAssignEndpoint": true,
  "previewOnly": false
}),
});
const data = await response.json();
console.log(data);

Responses

200 — Tenant products.

Response fields

productsarray of objectrequired
Products list.
Items must be unique.
Sophos product code with an optional quantity.
Show child attributesHide child attributes
codestringrequired
Sophos product code.
Must match the pattern ^[A-Z][a-zA-Z]{0,19}([0-9]{0,4})([-_][a-zA-Z0-9]{0,20}([0-9]{0,3})){0,5}$.
quantityinteger
Quantity for the number of seats.
productChangesobject
Product changes as a result of product selection.
Show child attributesHide child attributes
addedarray of object
Products list.
Items must be unique.
Sophos product code with an optional quantity.
Show child attributesHide child attributes
codestringrequired
Sophos product code.
Must match the pattern ^[A-Z][a-zA-Z]{0,19}([0-9]{0,4})([-_][a-zA-Z0-9]{0,20}([0-9]{0,3})){0,5}$.
quantityinteger
Quantity for the number of seats.
removedarray of object
Products list.
Items must be unique.
Sophos product code with an optional quantity.
Show child attributesHide child attributes
codestringrequired
Sophos product code.
Must match the pattern ^[A-Z][a-zA-Z]{0,19}([0-9]{0,4})([-_][a-zA-Z0-9]{0,20}([0-9]{0,3})){0,5}$.
quantityinteger
Quantity for the number of seats.
autoAssignServerboolean
Auto assign server products.
autoAssignEndpointboolean
Auto assign endpoint products.
previewOnlyboolean
Preview product selection.

Errors

Status Meaning
400 There is a problem with this request.
500 Unexpected error.

All error responses share the same shape — see the error response object.

Response examples

200

{
  "products": [
    {
      "code": "CIXA-MSP",
      "quantity": 1
    },
    {
      "code": "CEMA-MSP",
      "quantity": 1
    }
  ],
  "productChanges": {
    "added": {
      "items": [
        "CIXA-MSP"
      ]
    },
    "removed": {
      "items": [
        "WIFI_STANDARD"
      ]
    }
  },
  "autoAssignServer": false,
  "autoAssignEndpoint": true,
  "previewOnly": false
}

See the guide for a narrative walkthrough of this API.