Skip to content

Get usage report

GET/billing/usage/{year}/{month}

Partner API · Partner Billing

Usage report.

Required permissionaccount_management:read

Parameters

Name In Type Required Description
X-Partner-ID header string (uuid) Yes Partner ID.
month path integer Yes Month of the year.
Must be ≥ 1 and ≤ 12.
year path integer Yes Year.
Must be ≥ 2021.
pageSize query integer No The size of the page requested.
pageFromKey query string No The key of the item from where to fetch a page.
pageTotal query boolean No Whether the number of pages should be calculated and returned in the response.
fields query array of string No The fields to return in a partial response.
contactEmail query array of string No Tenant email for contact.
Must contain at most 50 items.
accountId query array of string (uuid) No Tenant Id.
Must contain at most 50 items.

Request samples

curl -X GET "https://api.central.sophos.com/partner/v1/billing/usage/0/0" -H "Authorization: Bearer <access-token>" -H "X-Partner-ID: <partner-id>"

import requests

response = requests.get(
    "https://api.central.sophos.com/partner/v1/billing/usage/0/0",
    headers={
        "Authorization": "Bearer <access-token>",
        "X-Partner-ID": "<partner-id>",
    },
)
print(response.json())

$headers = @{
    "Authorization" = "Bearer <access-token>"
    "X-Partner-ID" = "<partner-id>"
}
Invoke-RestMethod -Method GET -Uri "https://api.central.sophos.com/partner/v1/billing/usage/0/0" -Headers $headers

package main

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

func main() {
    req, err := http.NewRequest("GET", "https://api.central.sophos.com/partner/v1/billing/usage/0/0", nil)
    if err != nil {
        panic(err)
    }
    req.Header.Set("Authorization", "Bearer <access-token>")
    req.Header.Set("X-Partner-ID", "<partner-id>")

    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/billing/usage/0/0", {
  method: "GET",
  headers: {
    "Authorization": "Bearer <access-token>",
    "X-Partner-ID": "<partner-id>",
  },
});
const data = await response.json();
console.log(data);

Responses

200 — Billing report.

Response fields

itemsarray of objectrequired
Billing report items.
A single line in the partner's monthly billing report.
Show child attributesHide child attributes
partnerAccountIdstring (uuid)required
Partner ID.
partnerEdiAccountNumberstringrequired
Partner EDI account number (7-digit).
partnerAccountNamestringrequired
Partner account name.
billingStartDatestring (date)required
Billing start date.
billingEndDatestring (date)required
Billing end date.
orderNumberstringrequired
Order ID.
orderLineItemNumberstringrequired
Order line item number.
accountNumberOrSerialNumberstringrequired
Partner account number (7-digit) OR firewall serial number (alphanumeric).
assignedAccountIdentifierstring
Company name or (if applicable) the Company name provided by Firewall usage.
contactNamestring
Contact name.
contactEmailstring (email)
Contact email.
contactStreetstring
Contact street address.
contactCitystring
Contact city.
contactCountrystring
Contact country.
contactZipstring
Contact zipcode.
productDescriptionstringrequired
Product description.
productGroupstringrequired
MSP product group.
skustringrequired
Sophos Stock Keeping Unit.
billableQuantityintegerrequired
Total billable quantity.
unitMsrpCurrencystring
MSRP currency unit.
unitMsrpstring
Unit MSRP.
unitPriceCurrencystring
Unit price currency.
unitPricestring
Unit price (decimal).
netPriceCurrencystring
Net price currency.
netPricestring
Net price (decimal).
priceWithTaxesCurrencystring
Price with taxes currency.
priceWithTaxesstring
Price with taxes (decimal).
distributorAccountNamestring
MSP distributor company name.
additionalDiscountPercentagenumber
Additional discount percentage.
externalIdstring (uuid)required
End-user external ID.
accountIdstring (uuid)required
End-user account ID.
accountStatusstring (enum)required
Account status.
Must be one of: active, suspended, canceled.
orderedQuantityinteger
Quantity ordered.
actualQuantityintegerrequired
Actual quantity.
productCodestringrequired
Sophos product code.
pagesobjectrequired
Show child attributesHide child attributes
fromKeystring
The key of the first item in the returned page.
nextKeystring
The key to use when fetching the next page.
sizeintegerrequired
The size of the page being returned.
totalinteger
(Optional) The total number of pages that exist, if pageTotal=true in the request.
itemsinteger
(Optional) The total number of items on all the pages, if pageTotal=true was passed into the request.
maxSizeintegerrequired
The maximum page size that can be requested.

Errors

Status Meaning
404 No data for requested year or month.
500 Unexpected error.

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

Response examples

200

{
  "items": [
    {
      "partnerAccountId": "d31ab2df-7005-4c06-bd7d-2bc8de44be06",
      "partnerEdiAccountNumber": "1231231",
      "partnerAccountName": "ABC Corp",
      "billingStartDate": "2021-01-31",
      "billingEndDate": "2021-04-31",
      "orderNumber": "OrderID-123123123",
      "orderLineItemNumber": "OrderLine-12312312",
      "accountNumberOrSerialNumber": "C01234ABC1CDEF2",
      "assignedAccountIdentifier": "Safelog",
      "contactName": "John Smith",
      "contactEmail": "john.smith@example.com",
      "contactStreet": "1 Smith Avenue",
      "contactCity": "Smithfield",
      "contactCountry": "USA",
      "contactZip": "32932",
      "productDescription": "SW/Virtual EnterpriseGuard Plus - UP TO 2 CORES & 4GB RAM - 500-999 DEVICES - MSP Monthly",
      "productGroup": "User",
      "sku": "CEAZ1CSMG",
      "billableQuantity": 20,
      "unitMsrpCurrency": "USD",
      "unitMsrp": "1.40",
      "unitPriceCurrency": "USD",
      "unitPrice": "1.40",
      "netPriceCurrency": "USD",
      "netPrice": "1.40",
      "priceWithTaxesCurrency": "USD",
      "priceWithTaxes": "1.40",
      "distributorAccountName": "ABC Inc.",
      "additionalDiscountPercentage": 25,
      "externalId": "17b80674-f2cb-4b4f-a134-54ee24fbd5b3",
      "accountId": "718b6047-2fbc-b4f4-1a43-45ee42bf5d3b",
      "accountStatus": "active",
      "orderedQuantity": 20,
      "actualQuantity": 20,
      "productCode": "CIXA-MSP"
    }
  ],
  "pages": {
    "fromKey": "string",
    "nextKey": "string",
    "size": 0,
    "total": 0,
    "items": 0,
    "maxSize": 0
  }
}

See the guide for a narrative walkthrough of this API.