Create a new store location under an account in one transaction: a bundle_id=2 location-account record + its company options, the store row, and a store_options row (inheriting who_will_pay). If the account has a most-recent company_plan, the store is auto-attached to that plan and blank store_review_site rows are seeded. Rejects duplicates (same name+address+zip+city under bundle_id=2). Logs an audit event and emails a location-added notification.
Auth: Partner — authentication, under the partner/ group. The target account is account_id: must exists in company with bundle_id=3 and not deleted, AND pass an ownership check (must be an account inside the caller's partner tree).
Rate limit: No rate limit.
Request
- Body:
| Field | Type | Required | Notes |
|---|---|---|---|
| name | string | required | max 255; NameNoAngleBrackets (no </>) |
| storeid | string | optional | max 100; NameNoAngleBrackets |
| client_location_id | string | optional | max 100; NameNoAngleBrackets |
| address | string | required | max 255; NameNoAngleBrackets |
| city_id | int | required | must exist:city,id |
| postal_code | string | required | min 3, max 12; NameNoAngleBrackets |
| site_url | string | optional | must be a valid URL |
| company_phone | string | optional | min 9, max 15 digits — primary business phone |
| phone | string | optional | min 9, max 15 digits — secondary line |
| account_id | int | required | parent account company id; bundle_id=3, not deleted, + an ownership check |
Response — { data. } envelope.
status(string) —success.message(string) —Location has been created successfully!.
A duplicate location currently comes back as 500 with { status: "error", message: "This location is already registered!" }.
Errors: 422 on validation failure.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
