Skip to main content

Update rates by filter

POST 

/rates/bulk

JSON-RPC

rates.update_bulk

info

If any of the new values is not set, it will be left unchanged.

Request​

Bodyrequired

    actionstringrequired

    Bulk action.

    Possible values: [insert, update, delete, preview]

    search objectrequired

    Filter parameters.

    limitinteger

    Number of rows to return (for pagination).

    Default value: 20
    offsetinteger

    Number of rows to skip (for pagination).

    Default value: 0
    orderstring[]

    List of columns to order results by.

    Possible values: [code, -code, currencies_id, -currencies_id, effective_from, -effective_from, effective_till, -effective_till, end_date, -end_date, grace_volume, -grace_volume, id, -id, min_volume, -min_volume, notes, -notes, pay_interval, -pay_interval, pay_setup, -pay_setup, rate_tables_id, -rate_tables_id, src_code, -src_code, status, -status, tag, -tag, time_profiles_id, -time_profiles_id, value, -value]

    Default value: []
    rate_tables_idinteger

    Rate table ID.

    statestring

    Timeline state of the rate at the timestamp given in dt field.

    Possible values: [current_future, current, future, past, all]

    Default value: current_future
    dtdate-time

    Timestamp to be used in conjunction with state field to define the timestamp at which the rate state should be checked.

    qstring

    Quick search (wildcards allowed).

    codestring

    Destination code (wildcards allowed).

    Possible values: <= 64 characters

    code_instring[]

    Destination codes list.

    Possible values: <= 64 characters

    code_likestring

    Search by destination code or code name at the same time (wildcards allowed). Use with caution, depending on the state of other filters may by result consuming.

    code_namestring

    Destination code name (wildcards allowed).

    src_codestring

    Source code (wildcards allowed).

    Possible values: <= 64 characters

    src_code_instring[]

    Source codes list.

    Possible values: <= 64 characters

    src_code_namestring

    Source code name (wildcards allowed).

    idinteger[]

    Rate ID.

    statusstring

    Rate status.

    Possible values: [active, stashed]

    currencies_idinteger

    Currency ID.

    time_profiles_idinteger[]

    Time profile ID.

    tagstring[]

    Rate tag.

    pay_setupdecimal[]

    Setup fee.

    Possible values: >= 2, <= 2

    valuedecimal[]

    Rate value.

    Possible values: >= 2, <= 2

    end_datedate-time[]

    End date.

    Possible values: >= 2, <= 2

    min_volumeinteger[]

    Minimum billed volume.

    Possible values: >= 2, <= 2

    pay_intervalinteger[]

    Pay interval.

    Possible values: >= 2, <= 2

    grace_volumeinteger[]

    Grace volume.

    Possible values: >= 2, <= 2

    num_length_max_lteinteger

    Maximum destination number length.

    Possible values: >= 1

    num_length_min_gteinteger

    Minimum destination number length.

    Possible values: >= 1

    notesstring

    Rate notes.

    blockedboolean

    If True, return only blocked rates.

    next_rates_diff_statusstring

    Status of the next rate.

    Possible values: [new, increased, decreased, unchanged, blocked]

    prev_rates_diff_statusstring

    Status of the previous rate.

    Possible values: [new, increased, decreased, unchanged, blocked]

    notification_statusstring

    Rate notification status at the timestamp given in notification_dt field.

    Possible values: [sent, not_sent]

    notification_dtdate-time

    Timestamp to be used in conjunction with notification_status field to define the timestamp at which the rate notification status should be checked.

    rates_idinteger

    Special rate ID (to find related children rates).

    rate_tables_logs_idinteger

    Rate table log ID (to filter rates from the specific import).

    effective_fromdate-time

    Effective date to set.

    end_datedate-time

    End date to set.

    grace_volumeinteger

    Grace volume to set.

    Possible values: >= 0

    min_volumeinteger

    Minimum billed volume to set.

    Possible values: >= 1

    num_length_maxinteger

    Maximum number length to set.

    Possible values: >= 1

    num_length_mininteger

    Minimum number length to set.

    Possible values: >= 1

    pay_intervalinteger

    Payment interval to set.

    Possible values: >= 1

    pay_setupdecimal

    Setup fee value, check pay_setup_changes and pay_setup_type for the logic of the changes applied.

    pay_setup_typestring

    Setup fee value type. If abs the value will be taken as absolute, if rel - as percentage of the matched rate.

    Possible values: [abs, rel]

    Default value: abs
    pay_setup_changesstring

    Setup fee change direction. If inc the value will be increased, if dec - decreased, if set - set to the given value.

    Possible values: [none, set, inc, dec]

    Default value: none
    statusstring

    Status to set.

    Possible values: [active, stashed]

    tagstring

    Tag to set.

    time_profiles_idinteger

    Time profiles ID to set.

    valuedecimal

    Rate value, check value_changes and value_type for the logic of the changes applied.

    value_typestring

    Rate value type. If abs the value will be taken as absolute, if rel - as percentage of the matched rate.

    Possible values: [abs, rel]

    Default value: abs
    value_changesstring

    Rate value change direction. If inc the value will be increased, if dec - decreased, if set - set to the given value.

    Possible values: [none, set, inc, dec]

    Default value: none
    notesstring

    Notes to set.

Responses​

Number of the affected rows.

Schema
    integerinteger

Authorization: X-Api-Key

name: X-Api-Keytype: apiKeyin: headerdescription: Token for API access

Request Collapse all
Auth
Body required
{
  "action": "insert",
  "search": {
    "limit": 20,
    "offset": 0,
    "order": [
      "code"
    ],
    "rate_tables_id": 0,
    "state": "current_future",
    "dt": "2024-07-29T15:51:28.071Z",
    "q": "string",
    "code": "string",
    "code_in": [
      "string"
    ],
    "code_like": "string",
    "code_name": "string",
    "src_code": "string",
    "src_code_in": [
      "string"
    ],
    "src_code_name": "string",
    "id": [
      0
    ],
    "status": "active",
    "currencies_id": 0,
    "time_profiles_id": [
      0
    ],
    "tag": [
      "string"
    ],
    "pay_setup": [
      0
    ],
    "value": [
      0
    ],
    "end_date": [
      "2024-07-29T15:51:28.071Z"
    ],
    "min_volume": [
      0
    ],
    "pay_interval": [
      0
    ],
    "grace_volume": [
      0
    ],
    "num_length_max_lte": 0,
    "num_length_min_gte": 0,
    "notes": "string",
    "blocked": true,
    "next_rates_diff_status": "new",
    "prev_rates_diff_status": "new",
    "notification_status": "sent",
    "notification_dt": "2024-07-29T15:51:28.071Z",
    "rates_id": 0,
    "rate_tables_logs_id": 0
  },
  "effective_from": "2024-07-29T15:51:28.071Z",
  "end_date": "2024-07-29T15:51:28.071Z",
  "grace_volume": 0,
  "min_volume": 0,
  "num_length_max": 0,
  "num_length_min": 0,
  "pay_interval": 0,
  "pay_setup": 0,
  "pay_setup_type": "abs",
  "pay_setup_changes": "none",
  "status": "active",
  "tag": "string",
  "time_profiles_id": 0,
  "value": 0,
  "value_type": "abs",
  "value_changes": "none",
  "notes": "string"
}