Skip to content
Funds Alloc Config

Create Whale Package Rule

Create a fund-transfer (allocation) rule that defines how funds are automatically transferred between a specified source and destination according to a strategy.

Request parameters

  • Required: transfer_type, from_type (source type), to_type (destination type), transfer_strategy, package_type (frequency), currency, amount, postscript, status, priority
  • Required depending on the channels: from_main_account, from_main_account_type, from_account_id, to_main_account, to_main_account_type, to_account_id, allocation_channel; currency_type for HashKey settlement transfers
  • Optional: service_time (not sent for system-calculated frequencies)
  • See each field's definition for its format, value range, and business meaning.

Business notes

The rule defines the transfer strategy, frequency, currency, and amount from source to destination. status controls whether the rule is active.

Risk warning

This operation creates a rule that triggers real fund transfers; once active it may move real funds between accounts. Confirm the source, destination, amount, and strategy before calling.

Result

On success the fund-transfer rule is created; see the 200 response definition for the returned content.

POSThttps://b-api.lbkrs.com/atm/whale/package/rule

Authorization

AuthorizationstringheaderRequired

Send the Broker ACCESS_TOKEN as Authorization: Bearer <token>.

Permission

atm.funds_alloc_config_operation

The Broker ACCESS_TOKEN must be granted the permission above, or the call will be rejected.

Request body application/json

transfer_typestringrequired

Allocation type. Pass a key from the atm_whale_transfer_type data dictionary (GET /v1/datasets/refs/atm_whale_transfer_type).

In the Admin console, 1 (bank-to-bank transfer) fixes both from_type and to_type to 1, 2 (settlement account top-up) fixes from_type to 1, and 3 (settlement account withdrawal) fixes to_type to 1.

from_typestringrequired

Source channel type. The Admin console submits 1 for a bank and 2 for a settlement channel.

Allowed values: 1 Bank, 2 Settlement channel

Values
1
Bank
2
Settlement channel
from_main_accountstring

Main account (source; required when the source channel is not a bank)

from_main_account_typestring

Main account type (source)

from_account_idstring

Bank account (source; required when the source channel is a bank or the currency is not crypto)

to_typestringrequired

Destination channel type. The Admin console submits 1 for a bank and 2 for a settlement channel.

Allowed values: 1 Bank, 2 Settlement channel

Values
1
Bank
2
Settlement channel
to_main_accountstring

Main account (destination; required when the destination channel is not a bank)

to_main_account_typestring

Main account type (destination)

to_account_idstring

Bank account (destination; required when the destination channel is a bank or the currency is not crypto)

allocation_channelstring

Allocation channel (required when the source channel is a bank)

transfer_strategystringrequired

Allocation strategy. Pass a key from the atm_whale_transfer_strategy data dictionary (GET /v1/datasets/refs/atm_whale_transfer_strategy).

package_typestringrequired

Frequency. Pass a key from the atm_whale_package_type data dictionary (GET /v1/datasets/refs/atm_whale_package_type).

  • week uses service_time.week_rule; other time-based frequencies use service_time.time_rule.
  • For balance, coin_withdraw_quantity_submit, coin_withdraw_fee_submit, coin_withdraw_quantity_fail, coin_withdraw_fee_fail, and coin_deposit_success, the system calculates the amount: pass system for both currency and amount, and the Admin console does not send service_time.
currencystringrequired

Currency code from the global_currency data dictionary (global_coin for crypto). Pass system when the amount is system-calculated (see package_type).

currency_typestring

Currency category. Sent only when transfer_type is 4 and the source channel is settlement_hashkey_hk. Pass a key from the atm_ref_currency_type data dictionary; crypto switches currency to coin codes.

amountstringrequired

Transfer amount. Pass system when the amount is system-calculated (see package_type).

service_timestring

Execution time, as a JSON string. Times are HH:mm values on the half hour (00:00 to 23:30).

  • For time-based frequencies other than week: {"time_rule":["09:00","15:30"]}.
  • For week: {"week_rule":[{"week":1,"time":["09:00"]}]}, where week is 1 (Monday) to 7 (Sunday).
postscriptstringrequired

Transfer postscript

statusstringrequired

Rule status. Pass a key from the atm_status data dictionary (GET /v1/datasets/refs/atm_status); the Admin console sends 1 or 2.

Values
1
2
priorityintegerrequired

Rule priority, an integer from 0 to 999. Required by the Admin console form.

Responses

HTTP 200The request was processed successfully. The response data does not contain additional business fields.
Standard response envelopecodemessagedata
dataobjectdata structure

No nested fields

HTTP 400Bad request. Check the business error code in code and the error details in message.
Standard response envelopecodemessagedata
dataobjectdata structure

No nested fields

HTTP 401The user is not authenticated, or the login session has expired.
Standard response envelopecodemessagedata
dataobjectdata structure

No nested fields

HTTP 403The current account is not authorized to use this feature. Grant the required permission to the account in User Permission.
Standard response envelopecodemessagedata
dataobjectdata structure

No nested fields

HTTP 408The request timed out. Check the business error code in code and the error details in message.
Standard response envelopecodemessagedata
dataobjectdata structure

No nested fields

Whale Docs