Get usage report¶
GET/
Partner API · Partner Billing
Usage report.
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 objectrequiredBilling report items.
A single line in the partner's monthly billing report.
Show child attributesHide child attributes
partnerAccountIdstring (uuid)requiredPartner ID.
partnerEdiAccountNumberstringrequiredPartner EDI account number (7-digit).
partnerAccountNamestringrequiredPartner account name.
billingStartDatestring (date)requiredBilling start date.
billingEndDatestring (date)requiredBilling end date.
orderNumberstringrequiredOrder ID.
orderLineItemNumberstringrequiredOrder line item number.
accountNumberOrSerialNumberstringrequiredPartner account number (7-digit) OR firewall serial number (alphanumeric).
assignedAccountIdentifierstringCompany name or (if applicable) the Company name provided by Firewall usage.
contactNamestringContact name.
contactEmailstring (email)Contact email.
contactStreetstringContact street address.
contactCitystringContact city.
contactCountrystringContact country.
contactZipstringContact zipcode.
productDescriptionstringrequiredProduct description.
productGroupstringrequiredMSP product group.
skustringrequiredSophos Stock Keeping Unit.
billableQuantityintegerrequiredTotal billable quantity.
unitMsrpCurrencystringMSRP currency unit.
unitMsrpstringUnit MSRP.
unitPriceCurrencystringUnit price currency.
unitPricestringUnit price (decimal).
netPriceCurrencystringNet price currency.
netPricestringNet price (decimal).
priceWithTaxesCurrencystringPrice with taxes currency.
priceWithTaxesstringPrice with taxes (decimal).
distributorAccountNamestringMSP distributor company name.
additionalDiscountPercentagenumberAdditional discount percentage.
externalIdstring (uuid)requiredEnd-user external ID.
accountIdstring (uuid)requiredEnd-user account ID.
accountStatusstring (enum)requiredAccount status.
Must be one of:
Must be one of:
active, suspended, canceled.orderedQuantityintegerQuantity ordered.
actualQuantityintegerrequiredActual quantity.
productCodestringrequiredSophos product code.
pagesobjectrequiredShow child attributesHide child attributes
fromKeystringThe key of the first item in the returned page.
nextKeystringThe key to use when fetching the next page.
sizeintegerrequiredThe 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.
maxSizeintegerrequiredThe 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.