This request will create a new address on the customer.
| URL | https://api.telecomx.dk/customer/CUSTOMER_ID/address | ||
|---|---|---|---|
| Method | POST | ||
| Access level | VIEWER, MANAGER or OWNER if user belongs to the customer. RESELLER if customer belongs to the reseller. ADMIN. |
||
| Param | CUSTOMER_ID | Id of customer (24 hex-char string). | |
| Body | JSON object | ||
| primary | Boolean | True if this is the primary address. | |
| alternativeName | String | [optional] Alternative name for this address. |
|
| address | String | Street, number etc., min 5 chars. | |
| zip | String | Zip code, if country is Denmark or blank, zip is validated, otherwise min. 3 chars. | |
| city | String | City, if country is Denmark or blank, city is automatically set based on zip, otherwise min. 2 chars. | |
| state | String | [optional] State, only applies to US addresses. |
|
| country | String | ISO3166-1 2-char country code. | |
| fixedNumber | String | [optional] Fixed phone number on this address, if it differs from the primary. |
|
| faxNumber | String | [optional] Fax number on this address, if it differs from the primary. |
|
All properties marked as [optional] can be left out of the request.
{ address: 'Paradis Æblevej 23', zip: '123', city: 'Andeby', country: 'Cartoonistan', }
The response will be the newly created address, if no errors occurred.
| Json object | ||
|---|---|---|
| _id | Id | Id of address |
| primary | Boolean | True if this is the primary address |
| alternativeName | String | Alternative name for this address |
| address | String | Street, number etc., min. 5 chars. |
| zip | String | Zip code |
| city | String | City |
| state | String | State |
| country | String | Country |
| fixedNumber | String | Fixed phone number on this address, if it differs from the primary |
| faxNumber | String | Fax number on this address, if it differs from the primary |
| municipalityCode | Integer | Municipality code, automatically set by the system |
Note that properties holding no value may be omitted from the object.
{ _id: '52f4fd7734697b2800000001', primary: false, address: 'Paradis Æblevej 23', zip: '123', city: 'Andeby', country: 'Cartoonistan', municipalityCode: 101 }
| Error code | Message | Description |
|---|---|---|
| 400 | customer | Customer id not found in URI |
| 400 | address | Address not found in body of request |
| 422 | multiple | Multiple errors (the inner property holds an array of errors this request generated, which can be any of the errors below) |
| 422 | address | Invalid address |
| 404 | zip | Invalid zip code for Denmark |
| 422 | zip | Invalid zip code |
| 422 | country | Invalid country |
| 422 | city | Invalid city |
| 422 | fixedNumber | Number is not a valid phone number |
| 422 | faxNumber | Number is not a valid phone number |
| 500 | internal_error | <Unspecified> |