This request will update the prices of a product's destinations. It only supports uploading the destinations as a CSV-file through a multipart-form.
The product must be a SIP_RATEPLAN or MVNO_RATEPLAN product. Master products can only be updated by ADMIN, or by RESELLER_ADMIN with the FINANCE feature.
Only the CustomerFee, CustomerRate, WholesaleFee and WholesaleRate columns are applied; the CostFee and CostRate columns are ignored. WholesaleFee and WholesaleRate are applied only for RESELLER_ADMIN and ADMIN - for other users those two columns are ignored. Negative or non-numeric prices and rows with an unknown CountryCode are skipped, and so are empty rows. The Type column must be FIXED, MOBILE or SPECIAL.
| URL | https://api.telecomx.dk/product/PRODUCT_ID/destination | ||
|---|---|---|---|
| Method | POST | ||
| Param | PRODUCT_ID | Id of the product to update | |
| Access level | RESELLER if the product belongs to the reseller. RESELLER_ADMIN or ADMIN for any inherited rate-plan product. RESELLER_ADMIN with FINANCE feature or ADMIN for a master product. |
||
| Form | ||
|---|---|---|
| file | File | The CSV file, filled out with destinations and their prices. |
The CSV file is expected to have the same headers as this request in CSV.
Country;CountryCode;CountryPrefix;Region;Type;Prefixes;CustomerFee;CustomerRate;WholesaleFee;WholesaleRate;CostFee;CostRate Nicaragua;NI;505;WORLD3;MOBILE;;0,5;2,5;0,1;2;0,02;1,678
| JSON object | ||
|---|---|---|
| success | Boolean | If the request succeeded, then this is true. |
| Error code | Message | Description |
|---|---|---|
| 422 | <property> | Invalid input for the named property - the request body, query or URL parameter failed validation |
| 403 | access_denied | Insufficient access level |
| 403 | inheritFrom | Insufficient access level to update master product |
| 403 | reseller | Insufficient access level to update the product |
| 404 | id | Product not found |
| 404 | file | File not found |
| 422 | file | Error parsing CSV-file: <details> |
| 422 | files | Only one file can be uploaded. |
| 422 | file_headers | File headers are not correct: expected <the 12 headers, separated by ;> |
| 422 | file_headers | File headers are not correct: the header <X> in the CSV-file is supposed to be <Y> |
| 422 | destinations[N] | Row N has X columns, expected 12 |
| 422 | destinations[N].type | Type needs to be FIXED or MOBILE |
| 500 | internal_error | <Unspecified> |