Supplier Rates Import API

1. Introduction

The Supplier Rates Import API Endpoint can be used to programmatically create and activate a Supplier Pricelist Range for an existing Supplier Price List with a collection of Pricelist Items describing the Price for a certain Country & Operator combination.

This API belongs to the Bulk PriceList domain. Subject Domain in the endpoint url is:

https://api.horisen.pro/bulk/pricelists

The API uses the HORISEN implementation of the OAuth 2.0 protocol. For more information refer to the Oauth2 Authentication Guidelines

2. Methods Overview

POST/sms/buying/{plId}/ranges-importThis Method is used to add Gate PriceList Range and ItemsRead More
POST/v2/sms/buying/{plid}/ranges/{rngid}/activateThis Method is used to activate a PriceListRead More

3. Methods Details

POST /sms/buying/{plId}/ranges-importThis Method is used to add Gate PriceList Range and ItemsUp

Method Overview

  • comment Can be omitted, default value "" will be used
  • status Can be omitted, default value draft will be used, if "I" or "imported" is used, imported is set, anything else will be set to draft
  • importReport Can be omitted, default value "" will be used
  • status , Default value 'R' = draft will be used
  • startDate Must be in format 2006-01-02T15:04:05Z
  • country Object must have at least one value operator object must have at least :( mcc and mnc ) or operator name
  • operatorJoin If there are two or more prices for the same operator, API will handle it, based on this parameter. If nothing said for operatorJoin it will be set to default value = same

    • same: multiple items with same operator_id that has same price will be handled first come first serve. The first item will be served and the rest of them will be rejected with warning

    • off: no multiple items with the same operator allowed. All items will be rejected and error will be sent

    • min, max: item with min or max price will be selected, rest will be rejected with warning If flag

  • importOnlyIfAllValid = true and we have operatorJoin=same and there are items with different prices and same operator, whole call will fail and error sent, in other case ( importOnlyIfValid=false ) only first item will be imported, rest will be rejected

Parameters

Name Type Description
plid (required) string (path) Gate PriceList id to get
importOnlyIfAllValid string(query) Only when all items are valid new range will be created. If there is one not valid item, no new range will be created and 409 status will be returned with input object enriched with comments about items ( warnings and errors). If set to false, all valid items (at least one) will be imported and new range created. 201 status will be returned with input object enriched with comments about items ( warnings and errors). Those items with errors are not imported! If there are no valid items, no new range will be created. and 409 status will be returned with input object enriched with comments about items ( warnings and errors) Default value : true
post data (required) object The status can be either imported or omitted. The starDate variable has the following format: YYYY-MM-DDTHH:MM:SSZ and endDate is set automatically to unlimited. Comment and importReport can be omitted.

Responses

Code Description
200 Gate PriceList Range added.
409 Gate PriceList Range not added as there are wrong input parameters.
default unexpected error

Data Objects

Post Data is object that belongs to the Parameter fields.

Name Type Description
startDate string must be in format 2006-01-02T15:04:05Z
endDate string is set automatically to unlimited
comment string can be omitted, default value "" will be used
status string can be omitted, default value draft will be used, if "I" or "imported" is used, imported is set, anything else will be set to draft
importReport string can be omitted, default value "" will be used
items list of items [List of Items
operatorJoin string

If there are two or more prices for the same operator, API will handle it, based on this parameter.

  • If nothing said for operatorJoin it will be set to default value = same
  • same: multiple items with same operator_id that has same price will be handled first come first serve. The first item will be served and the rest of them will be rejected with warning
  • off: no multiple items with the same operator allowed. All items will be rejected and error will be sent
  • min, max: item with min or max price will be selected, rest will be rejected with warning
  • If flag importOnlyIfAllValid = true and we have operatorJoin=same and there are items with different

Items-list: status, price, country, operator. Country and Operator are separated objects in the list and has their own fields that are described in the tables below.

Name Type Description
GateImportItemsWO object Gate import object
Status string Can be either in import or active
Price number($float) Price
Country object The object must have at least one value. For further information check the table below.
operator object object must have at least - ( mcc and mnc ) or operator name. For further information check the table below.

Gate Import country WO object is related to the country of the Operator

Name Type Description
GateImportCountryWO object Gate import object for the country
countryIsoCode integer Country code
mcc string Mobile country code
countryCode2 string Country code 2
countryCode3 string Country code 3
countryName string Name of the country

Gate Import operator WO: This object is related to the operator and it's country code and network code

Name Type Description
GateImportOperatorWO object Gate import object for the operator
mcc string Mobile country code
mnc string Mobile network code
operatorName string Name of the operator

Post data object example:

 
{
  "startDate": "string",
  "endDate": "string",
  "comment": "string",
  "status": "string",
  "importReport": "string",
  "items": [
    {
      "status": "string",
      "price": 0,
      "country": {
        "countryIsoCode": 0,
        "mcc": "string",
        "countryCode2": "string",
        "countryCode3": "string",
        "countryName": "string"
      },
      "operator": {
        "mcc": "string",
        "mnc": "string",
        "operatorName": "string"
      }
    }
  ],
  "operatorJoin": "off"
}

Gate Pricelist range added

Name Type Description
id string ID of the Pricelist Range that was returned
gatePriceListId string ID of the Gate Pricelist
startDate string The start Date of a Pricelist date Range and must be in format YYYY-MM-DDTHH:MM:SSZ
endDate string The end Date of a Pricelist date Range
currencyId string ID of a currency
currencyCode string Currency code
baseCurrency string Base Currency
baseCurrencyCode string Base Currency code
status string The Status of a Pricelist
comment string Comment
importReport string Can be omitted, default value "" will be used
isOverlaping boolean Is the pricelist range overlaps or not
overlaping string Object - startDate and EndDate attribute
deletable boolean Is this deletable or not
nextRangeEndDate string End date of a next Pricelist range
Input Object click here for Object info
operatorJoin array Off
createdBy Boolean -

Input object

Name Type Description
startDate string Start Date
comment string Comment
status string Status of a price list
importReport string Import report
Items List of items click here for more info
status string Status of a price list
status string Status of a price list

Error list

The available error codes are listed below:

  • "PRICELIST_RANGE_ITEM_IMPORT_COUNTRY_IS_MISSING"
  • "PRICELIST_RANGE_IMPORT_COUNTRY_IS_WRONG"
  • "PRICELIST_RANGE_IMPORT_COUNTRY_NOT_FOUND"
  • "PRICELIST_RANGE_ITEM_IMPORT_OPERATOR_IS_MISSING"
  • "PRICELIST_RANGE_ITEM_IMPORT_OPERATOR_IS_AMBIGIOUS"
  • "PRICELIST_RANGE_ITEM_IMPORT_OPERATOR_MCC_IS_MISSING"
  • "PRICELIST_RANGE_ITEM_IMPORT_OPERATOR_MNC_IS_MISSING"
  • "PRICELIST_RANGE_ITEM_IMPORT_OPERATOR_MCC_IS_WRONG"
  • "PRICELIST_RANGE_ITEM_IMPORT_OPERATOR_IS_WRONG"
  • "PRICELIST_RANGE_ITEM_IMPORT_ALLCOUNTRY_IS_ALREADY_IN_USE"
  • "PRICELIST_RANGE_ITEM_IMPORT_OPERATOR_IS_AMBIGIOUS"
  • "PRICELIST_RANGE_ITEM_STATUS_IS_WRONG"
  • "PRICELIST_RANGE_ITEM_IMPORT_STATUS_IS_MISSING"
  • "PRICELIST_RANGE_ITEM_PRICE_IS_MISSING"
  • "PRICELIST_RANGE_ITEM_IMPORT_PRICE_IS_WRONG"
  • "PRICELIST_RANGE_ITEM_IMPORT_SAME_OPERATOR_IN_MULTIPLE_ITEMS"
  • "PRICELIST_RANGE_ITEM_IMPORT_SAME_OPERATOR_DIFFERENT_PRICE"
POST/sms/buying/{plid}/ranges/{rngid}/activateThis Method is used to activate a Date RangeUp

Method Overview

This Method can be used to activate a previously created Supplier Price List Data Range. Authorization privilege needed for this endpoint: bulk-supplier-pricelist.

Manage Ranges in draft mode that have startDate in future will be activated. EndDate of the actual active range will be set to be endDate of the new range. StartDate of new range will be set to be EndDate of actual active range. Ranges in Draft and Imported status can be activated. When activating range approval_status will be set to 'manually_approved' and approval_status_dt will be set to the time of change.

Parameters

Name Type Description
plid string GatePriceList id
rngid string GatePriceList range id

Responses

Code Description
200 Gate PriceList Range activated.
default unexpected error

4. Questions and Answers

Q: "...As I understand this API should be used to upload rates per supplier. I don't see option to specify the supplier ID / Name that should match suppliers already in your platform. There is also no place for currency of the rate. "

A: You don't need to specify both parameters, as the import is done in a previously via UI created Supplier Price List (in Bulk App, under Rates Manager/Suppliers/SMS Gate Price List). This defines Supplier and Currency of Pricelist you then can import rates and create a new date range from them. (Explications on how Rates Manager and Date Ranges Management in Application work Are available in our User Guides)

You can get the needed PLID (Price List Id) you need by going to Rates Manager/Suppliers/SMS Gate Price List in your Bulk SMS Application

Once there you need to open the price list column link. You will see an URL like this:

/en/rates-manager/suppliers/pricelist/XXXXX/range?main:paging=1,10

Where XXXX is the PLID