Table of Contents

API : Product Update destinations

Introduction

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 that inherits from a master product. Master products cannot currently be updated through this request — such requests fail with a 500 error.

Only the CustomerFee, CustomerRate, WholesaleFee and WholesaleRate columns are applied; the CostFee and CostRate columns are ignored. Negative or non-numeric prices and rows with an unknown CountryCode are skipped. The Type column must be FIXED, MOBILE or SPECIAL.

Request

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.
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.

Example request file

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

Response

JSON object
success Boolean If the request succeeded, then this is true.

Errors

Error code Message Description
403 access_denied Insufficient access level
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: the header <X> in the CSV-file is supposed to be <Y>
422 destinations[N].type Type needs to be FIXED or MOBILE
500 unknown_error Returned for any request targeting a master product
500 internal_error <Unspecified>