Create Sites
Creates a new Site within a specified Account. Any fields not specified will be created as null.
| Verb | PUT |
|---|---|
| Endpoint | {base-url}/sites |
| Max Page Size | N/A |
Request Body
{
"body": [
{
"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
The ids of the created sites.
Response Body
[
1673
]
On Error
| HTTP Code | Error Code | Definition |
|---|---|---|
| 400 | NAME_UNIQUENESS | Site names must be unique at the account level when updating or creating. See the error message for what names caused the issue. |
| 400 | CHARGE_KEY_ERROR | You have attempted to use an invalid charge key. |
| 403 | DATA_ACCESS_VIOLATION | The body orgId, the referenced accountId, or a referenced chargeKeyId belongs to an organization you do not have access to. |
| 404 | MISSING_RECORD | The referenced accountId does not exist. |
| 422 | VALIDATION_ERROR | One or more of your sites failed validation. See the error message for more detailed information. |