Update Sites
Updates the specified site(s). Below are the required fields and anything not specified will be set to null.
Info
Changes to the isEnabled flag will be disregarded, please use the un/delete routes instead.
| Verb | PATCH |
|---|---|
| Endpoint | {base-url}/sites |
| Max Page Size | N/A |
Request Body
Request Body
{
"body": [
{
"Id": 196,
"AccountId": 11,
"OrgId": 3,
"Name": "Bob's Grain Mill",
"contact": {
"firstName": "Jane",
"lastName": "Smith",
"telephoneNumber": "206-555-0142",
"emailAddress": "jane.smith@grainmill.com"
},
"CommissionPercentage": null,
"IsActive": true,
"TimeZone": "Pacific Standard Time",
"MaxChargePrice": 5,
"BillingAddress": "Bob's Grain Mill, 123 Main Street, Seattle, WA 11111",
"ShippingAddress": "Bob's Grain Mill, 123 Main Street, Seattle, WA 11111",
"MaximumMeterSalesJumpAllowed": 500,
"CommissionTerms": "Net10",
"ExternalAccountTerminalId": null,
"chargeKeyId": 1
}
]
}
Note
All changes in this request are atomic. If any item fails, the entire batch is rolled back and no changes are made.
Returns
On Success
204 - No Content
Response Body
// 204 - No Content
On Error
| HTTP Code | Error Code | Definition |
|---|---|---|
| 400 | NAME_UNIQUENESS | One or more site names are already in use within the same account. Site names must be unique at the account level. |
| 400 | CHARGE_KEY_ERROR | One or more sites referenced an invalid charge key. |
| 403 | DATA_ACCESS_VIOLATION | One or more sites (by id), the body orgId, or a referenced charge key belongs to an organization you do not have access to. |
| 403 | DATA_ACCESS_VIOLATION | One or more sites referenced a charge key belonging to an organization you do not have access to. |
| 404 | MISSING_RECORD | One or more of the specified site ids do not exist. |
| 422 | VALIDATION_ERROR | One or more sites failed model validation (e.g. name exceeds 100 characters, commissionPercentage is negative, maxChargePrice is negative, maximumMeterSalesJumpAllowed is negative, invalid commissionTerms value, invalid timeZone, contact name exceeds 50 characters, contact email exceeds 50 characters, contact telephone exceeds 13 characters). |