This request will create a new destination.
A destination consists of the prefixes (e.g. +4677 and +4674 for Swedish high-rated numbers) that is the beginning of the number you dial to get to a number in that destination, the country it belongs to, the type of numbers that the destination holds (landline, mobile, special, free) and the connection fee and rates for calling a number in the destination.
| URL | https://api.telecomx.dk/destination | ||
|---|---|---|---|
| Method | POST | ||
| Access level | RESELLER_ADMIN with FINANCE feature, or ADMIN | ||
| Body | _id | String | ISO3166 2-char uppercase country code. |
| prefix | String | Prefix for the country, e.g. +45. | |
| region | String | The region the country belongs to: HOMELAND, EU_NORDIC, REST_OF_EUROPE, WORLD1, WORLD2, WORLD3. | |
| breakouts | Array | List of breakouts within a country, with prefix, type, fee-cost, fee-rate | |
| breakouts[].prefix | Array | Array of strings, which is the prefixes, that this destination/type covers | |
| breakouts[].type | String | FIXED, MOBILE, SPECIAL | |
| breakouts[].cost | Object | Cost prices for each peer. | |
| breakouts[].cost.<PeerId> | Object | Cost prices for one peer, keyed by peer id: TELENOR, SUPERTEL or TDC. | |
| breakouts[].cost.<PeerId>.fee | Number | Connection fee cost. | |
| breakouts[].cost.<PeerId>.rate | Number | Pr. minute cost. | |
| breakouts[].cost.<PeerId>.rates | Array | List of cost rates for the prefixes in this breakout. | |
| fixed | Object | prices for fixed destinations | |
| fixed.wholesaleFee | Number | Connection fee for reseller | |
| fixed.customerFee | Number | Connection fee for customer | |
| fixed.wholesaleRate | Number | Pr. minute rate for reseller | |
| fixed.customerRate | Number | Pr. minute rate for customer | |
| mobile | Object | prices for mobile destinations | |
| mobile.wholesaleFee | Number | Connection fee for reseller | |
| mobile.customerFee | Number | Connection fee for customer | |
| mobile.wholesaleRate | Number | Pr. minute rate for reseller | |
| mobile.customerRate | Number | Pr. minute rate for customer | |
| special | Object | prices for special destinations | |
| special.wholesaleFee | Number | Connection fee for reseller | |
| special.customerFee | Number | Connection fee for customer | |
| special.wholesaleRate | Number | Pr. minute rate for reseller | |
| special.customerRate | Number | Pr. minute rate for customer | |
At least one breakout is required. The three price sections and every price field in them default to 0 when omitted.
{ "_id": "DE", "prefix": "+49", "region": "EU_NORDIC", "breakouts": [ { "prefix": [ "+4915", "+49151", "+49152", "+49160", "+49170" ], "type": "MOBILE", "cost": { "TELENOR": { "fee": 0.02, "rate": 0.1795 }, "TDC": { "fee": 0, "rate": 0.2931 }, "SUPERTEL": { "fee": 0, "rate": 0.161, "rates": [ 0.1523, 0.161 ] } } }, { "prefix": [ "+49", "+4930", "+4940" ], "type": "FIXED", "cost": { "TELENOR": { "fee": 0.02, "rate": 0.0955 }, "TDC": { "fee": 0, "rate": 0.4266 }, "SUPERTEL": { "fee": 0, "rate": 0.0647, "rates": [ 0.055, 0.0647 ] } } }, { "prefix": [ "+49700", "+49701" ], "type": "SPECIAL", "cost": { "TELENOR": { "fee": 0.2, "rate": 0.1975 }, "TDC": { "fee": 0, "rate": 0.18 } } } ], "fixed": { "wholesaleFee": 0.1, "wholesaleRate": 0.15, "customerFee": 0.2, "customerRate": 0.25 }, "mobile": { "wholesaleFee": 0.1, "wholesaleRate": 0.5, "customerFee": 0.2, "customerRate": 0.75 } }
| JSON object | ||
|---|---|---|
| _id | String | ISO3166 2-char uppercase country code. |
| prefix | String | Prefix for the country, e.g. +45. |
| region | String | The region the country belongs to: HOMELAND, EU_NORDIC, REST_OF_EUROPE, WORLD1, WORLD2, WORLD3. |
| breakouts | Array | List of breakouts within a country, with prefix, type, fee-cost, fee-rate |
| breakouts[].prefix | Array | Array of strings, which is the prefixes, that this destination/type covers |
| breakouts[].type | String | FIXED, MOBILE, SPECIAL |
| breakouts[].cost | Object | Cost prices for each peer. |
| breakouts[].cost.<PeerId> | Object | Cost prices for one peer, keyed by peer id: TELENOR, SUPERTEL or TDC. |
| breakouts[].cost.<PeerId>.fee | Number | Connection fee cost. |
| breakouts[].cost.<PeerId>.rate | Number | Pr. minute cost. |
| breakouts[].cost.<PeerId>.rates | Array | List of cost rates for the prefixes in this breakout. |
| fixed | Object | prices for fixed destinations |
| fixed.wholesaleFee | Number | Connection fee for reseller |
| fixed.customerFee | Number | Connection fee for customer |
| fixed.wholesaleRate | Number | Pr. minute rate for reseller |
| fixed.customerRate | Number | Pr. minute rate for customer |
| mobile | Object | prices for mobile destinations |
| mobile.wholesaleFee | Number | Connection fee for reseller |
| mobile.customerFee | Number | Connection fee for customer |
| mobile.wholesaleRate | Number | Pr. minute rate for reseller |
| mobile.customerRate | Number | Pr. minute rate for customer |
| special | Object | prices for special destinations |
| special.wholesaleFee | Number | Connection fee for reseller |
| special.customerFee | Number | Connection fee for customer |
| special.wholesaleRate | Number | Pr. minute rate for reseller |
| special.customerRate | Number | Pr. minute rate for customer |
Note that properties holding no value may be omitted from the object.
{ "_id": "DE", "prefix": "+49", "region": "EU_NORDIC", "breakouts": [ { "prefix": [ "+4915", "+49151", "+49152", "+49160", "+49170" ], "type": "MOBILE", "cost": { "TELENOR": { "fee": 0.02, "rate": 0.1795 }, "TDC": { "fee": 0, "rate": 0.2931 }, "SUPERTEL": { "fee": 0, "rate": 0.161, "rates": [ 0.1523, 0.161 ] } } }, { "prefix": [ "+49", "+4930", "+4940" ], "type": "FIXED", "cost": { "TELENOR": { "fee": 0.02, "rate": 0.0955 }, "TDC": { "fee": 0, "rate": 0.4266 }, "SUPERTEL": { "fee": 0, "rate": 0.0647, "rates": [ 0.055, 0.0647 ] } } }, { "prefix": [ "+49700", "+49701" ], "type": "SPECIAL", "cost": { "TELENOR": { "fee": 0.2, "rate": 0.1975 }, "TDC": { "fee": 0, "rate": 0.18 } } } ], "fixed": { "wholesaleFee": 0.1, "wholesaleRate": 0.15, "customerFee": 0.2, "customerRate": 0.25 }, "mobile": { "wholesaleFee": 0.1, "wholesaleRate": 0.5, "customerFee": 0.2, "customerRate": 0.75 }, "special": { "wholesaleFee": 0, "wholesaleRate": 0, "customerFee": 0, "customerRate": 0 } }
| Error code | Message | Description |
|---|---|---|
| 404 | _id | Country code is missing |
| 404 | prefix | Prefix is missing |
| 404 | region | Region is missing |
| 404 | breakouts | Breakouts is missing |
| 422 | _id | Country code is not valid |
| 422 | prefix | Prefix is not valid |
| 422 | region | Region is not valid |
| 422 | breakouts | At least one breakout is required |
| 422 | breakouts.prefix | Breakout prefix XXX is listed multiple times |
| 422 | breakouts.prefix | Breakout prefix XXX must start with YYY |
| 422 | breakouts.type | Breakout type is not valid |
| 422 | breakouts.type | Breakout type XXX is listed multiple times |
| 422 | breakouts.cost.<PeerId>.fee | Cost fee is not valid |
| 422 | breakouts.cost.<PeerId>.rate | Cost rate is not valid |
| 422 | fixed.wholesaleFee | WholesaleFee is not valid |
| 422 | fixed.wholesaleRate | WholesaleRate is not valid |
| 422 | fixed.customerFee | CustomerFee is not valid |
| 422 | fixed.customerRate | CustomerRate is not valid |
| 422 | mobile.wholesaleFee | WholesaleFee is not valid |
| 422 | mobile.wholesaleRate | WholesaleRate is not valid |
| 422 | mobile.customerFee | CustomerFee is not valid |
| 422 | mobile.customerRate | CustomerRate is not valid |
| 422 | special.wholesaleFee | WholesaleFee is not valid |
| 422 | special.wholesaleRate | WholesaleRate is not valid |
| 422 | special.customerFee | CustomerFee is not valid |
| 422 | special.customerRate | CustomerRate is not valid |
| 409 | _id | Country code already in use |
| 409 | breakouts.prefix | One or more prefixes is in use by another destination |
| 403 | access_denied | Insufficient access level |
| 500 | internal_error | <Unspecified> |