Return pricing info¶
POST/
Business Automation API · Pricing
Return pricing information.
Parameters¶
| Name | In | Type | Required | Description |
|---|---|---|---|---|
X-Distributor-ID | header | string | Yes | Distributor ID. |
Request body¶
Content type: application/json
Request body fields
resellerAccountNumberstringrequiredAccount number.
Must match the pattern
Must match the pattern
^[0-9]+$. Must be 1–8 characters long.transactionTypestringTransaction type.
Must be one of:
Must be one of:
new, renew.sectorstringrequiredSector.
Must be one of:
Must be one of:
corporate, education, government.linesarray of objectrequiredList of pricing lines.
Must contain 1–6 items.
Must contain 1–6 items.
Pricing line item request.
Show child attributesHide child attributes
lineIdstringLine ID.
Must be at least 1 character long.
Must be at least 1 character long.
productNamestringrequiredProduct code.
Must be at least 1 character long.
Must be at least 1 character long.
quantityintegerrequiredQuantity of the product.
Must be ≥ 1 and ≤ 5000.
Must be ≥ 1 and ≤ 5000.
termintegerrequiredTerm of the product in months.
Must be ≥ 1 and ≤ 60.
Must be ≥ 1 and ≤ 60.
discretionaryDiscountPercentnumberDiscretionary discount percentage that should be applied to the MSRP.
Must be ≥ 0 and ≤ 100.
Must be ≥ 0 and ≤ 100.
programmeDiscountstringProgramme discount.
Must be one of:
Must be one of:
dealReg, incumbent, teaming.promoCodesarray of stringList of applied promo codes.
Must contain at most 3 items.
Must contain at most 3 items.
Request samples¶
curl -X POST "https://api.central.sophos.com/business-automation/v1/pricing" -H "Authorization: Bearer <access-token>" -H "X-Distributor-ID: <X-Distributor-ID>" -H "Content-Type: application/json" -d "{
\"resellerAccountNumber\": \"12345678\",
\"transactionType\": \"new\",
\"sector\": \"corporate\",
\"lines\": [
{
\"lineId\": \"LINE-001\",
\"productName\": \"CIXA-U36STNDVF\",
\"quantity\": 10,
\"term\": 12,
\"discretionaryDiscountPercent\": 15.5,
\"programmeDiscount\": \"dealReg\"
}
],
\"promoCodes\": [
\"PROMO10\"
]
}"
import requests
response = requests.post(
"https://api.central.sophos.com/business-automation/v1/pricing",
headers={
"Authorization": "Bearer <access-token>",
"X-Distributor-ID": "<X-Distributor-ID>",
"Content-Type": "application/json",
},
json={ 'resellerAccountNumber': '12345678',
'transactionType': 'new',
'sector': 'corporate',
'lines': [ { 'lineId': 'LINE-001',
'productName': 'CIXA-U36STNDVF',
'quantity': 10,
'term': 12,
'discretionaryDiscountPercent': 15.5,
'programmeDiscount': 'dealReg'}],
'promoCodes': ['PROMO10']},
)
print(response.json())
$headers = @{
"Authorization" = "Bearer <access-token>"
"X-Distributor-ID" = "<X-Distributor-ID>"
"Content-Type" = "application/json"
}
$body = '{
"resellerAccountNumber": "12345678",
"transactionType": "new",
"sector": "corporate",
"lines": [
{
"lineId": "LINE-001",
"productName": "CIXA-U36STNDVF",
"quantity": 10,
"term": 12,
"discretionaryDiscountPercent": 15.5,
"programmeDiscount": "dealReg"
}
],
"promoCodes": [
"PROMO10"
]
}'
Invoke-RestMethod -Method POST -Uri "https://api.central.sophos.com/business-automation/v1/pricing" -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/business-automation/v1/pricing", strings.NewReader(`{
"resellerAccountNumber": "12345678",
"transactionType": "new",
"sector": "corporate",
"lines": [
{
"lineId": "LINE-001",
"productName": "CIXA-U36STNDVF",
"quantity": 10,
"term": 12,
"discretionaryDiscountPercent": 15.5,
"programmeDiscount": "dealReg"
}
],
"promoCodes": [
"PROMO10"
]
}`))
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer <access-token>")
req.Header.Set("X-Distributor-ID", "<X-Distributor-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/business-automation/v1/pricing", {
method: "POST",
headers: {
"Authorization": "Bearer <access-token>",
"X-Distributor-ID": "<X-Distributor-ID>",
"Content-Type": "application/json",
},
body: JSON.stringify({
"resellerAccountNumber": "12345678",
"transactionType": "new",
"sector": "corporate",
"lines": [
{
"lineId": "LINE-001",
"productName": "CIXA-U36STNDVF",
"quantity": 10,
"term": 12,
"discretionaryDiscountPercent": 15.5,
"programmeDiscount": "dealReg"
}
],
"promoCodes": [
"PROMO10"
]
}),
});
const data = await response.json();
console.log(data);
Responses¶
200 — List of pricing information.¶
Response fields
distributorobjectDistributor account company details.
Show child attributesHide child attributes
namestringCompany name.
addressobjectAddress of the distributor, partner, or end-user.
Show child attributesHide child attributes
address1stringLine 1 of the address.
address2stringLine 2 of the address.
citystringCity.
statestringState.
countryCodestringTwo-letter ISO country code.
postalCodestringPostal code.
accountNumberstringAccount number.
Must match the pattern
Must match the pattern
^[0-9]+$. Must be 1–8 characters long.resellerobjectPartner account company details.
Show child attributesHide child attributes
namestringCompany name.
levelstringPartner level.
Must be one of:
Must be one of:
select, authorized, silver, gold, platinum.accountNumberstringAccount number.
Must match the pattern
Must match the pattern
^[0-9]+$. Must be 1–8 characters long.addressobjectAddress of the distributor, partner, or end-user.
Show child attributesHide child attributes
address1stringLine 1 of the address.
address2stringLine 2 of the address.
citystringCity.
statestringState.
countryCodestringTwo-letter ISO country code.
postalCodestringPostal code.
contactobjectContact information for distributor, partner, or end-user.
Show child attributesHide child attributes
firstNamestringFirst name.
lastNamestringLast name.
emailstring (email)Email address.
phonestringPhone number.
mobilestringMobile number.
currencyCodestringCurrency ISO code for the pricing information.
sectorstringSector.
Must be one of:
Must be one of:
corporate, education, government.transactionTypestringTransaction type.
Must be one of:
Must be one of:
new, renew.msrpnumberPricebook price with applied multipliers.
specialTotalnumberCustomer / End User price of all products.
intermediateTierTotalnumberReseller price of all products.
totalnumberDistributor price of all products.
linesarray of objectList of pricing lines.
Pricing line item.
Show child attributesHide child attributes
lineIdstringLine ID.
productNamestringProduct code.
quantityintegerQuantity of the product.
termintegerTerm of the product in months.
msrpnumberTotal Pricebook price with applied multipliers for the line.
unitMsrpnumberUnit Pricebook price with applied multipliers for the line.
discretionaryDiscountPercentnumberDiscretionary Discount Percent.
promoDiscountPercentagenumberPromotional Discount Percent.
promoDiscountAmountnumberPromotional Discount Amount.
intermediateTierMarginnumberReseller Margin.
marginPercentagenumberDistributor Margin.
specialUnitPricenumberCustomer / End User Unit Price.
specialTotalnumberCustomer / End User Total Price.
intermediateTierUnitnumberReseller Unit Price.
intermediateTierTotalnumberReseller Total Price.
unitnumberDistributor Unit Price.
totalnumberDistributor Total Price.
skustringSophos Stock Keeping Unit.
messagesarray of objectList of info/warning/error messages related to the line item pricing.
Collection of info/warning/error messages.
Show child attributesHide child attributes
typestringMessage type.
Must be one of:
Must be one of:
info, warning, error.messagestringMessage text.
promoCodesarray of stringList of applied promo codes.
messagesarray of objectList of info/warning/error messages related to this line.
Collection of info/warning/error messages.
Show child attributesHide child attributes
typestringMessage type.
Must be one of:
Must be one of:
info, warning, error.messagestringMessage text.
Errors¶
| Status | Meaning |
|---|---|
400 | Bad request. |
500 | Unexpected error. |
All error responses share the same shape — see the error response object.
Response examples¶
200¶
{
"distributor": {
"name": "Example Disti, Inc.",
"address": {
"address1": "1134 Lane, Eastwood",
"address2": "New York 10001",
"city": "New York",
"state": "NY",
"countryCode": "US",
"postalCode": "10001"
},
"accountNumber": "12345678"
},
"reseller": {
"name": "Acme Corp",
"level": "gold",
"accountNumber": "12345678",
"address": {
"address1": "1134 Lane, Eastwood",
"address2": "New York 10001",
"city": "New York",
"state": "NY",
"countryCode": "US",
"postalCode": "10001"
},
"contact": {
"firstName": "John",
"lastName": "Smith",
"email": "john.smith@example.com",
"phone": "9111678231",
"mobile": "6311628237"
}
},
"currencyCode": "USD",
"sector": "corporate",
"transactionType": "new",
"msrp": 1234.56,
"specialTotal": 999.99,
"intermediateTierTotal": 899.99,
"total": 799.99,
"lines": [
{
"lineId": "LINE-001",
"productName": "CIXA-U36STNDVF",
"quantity": 10,
"term": 12,
"msrp": 100,
"unitMsrp": 10,
"discretionaryDiscountPercent": 15.5,
"promoDiscountPercentage": 10,
"promoDiscountAmount": 12.34,
"intermediateTierMargin": 7.5,
"marginPercentage": 4,
"specialUnitPrice": 15,
"specialTotal": 150,
"intermediateTierUnit": 13,
"intermediateTierTotal": 130,
"unit": 12,
"total": 120,
"sku": "XYZITA00123",
"messages": [
{
"type": "info",
"message": "This is an informational message."
}
]
}
],
"promoCodes": [
"PROMO10",
"DISCOUNT20"
],
"messages": [
{
"type": "info",
"message": "This is an informational message."
}
]
}
See the guide for a narrative walkthrough of this API.