Skip to content
Exchange P/L

Exchange P/L

Query the profit-and-loss detail of customer currency-conversion orders, reflecting the gain or loss arising between the exchange rate the broker offers the customer and the rate actually settled with the channel.

Request parameters

  • Combine business filters through filters (see the filter field descriptions below for the available fields), and use page, page_size, and orderBy to control pagination and sorting.

Business notes

  • The data comes from each debit and credit leg of a customer's conversion order, with forex_type distinguishing the debit leg (FROM) from the credit leg (TO).
  • Each record includes the customer conversion order number, the channel conversion order number, the currency, the customer amount and customer rate, the channel name, the channel amount and channel rate, the channel and settlement ledger dates, and the exchange profit or loss computed for that leg.
  • It is commonly used to tally and account for the FX-spread profit and loss of the currency-conversion business.

Returns

On success, returns the list of matching records with pagination information. See the response definition for the meaning of each returned column.

POSThttps://b-api.lbkrs.com/v1/datasets/atm_forex_profit_loss

Authorization

AuthorizationstringheaderRequired

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

Permission

lb_hk_conversion.exchangeincome_query

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

Request body application/json

filtersobject

Filters. Combines business filters. Omit a filter field to disable that filter.

Child attributes
forex_idstring

Conversion Order No.. Filters results by Conversion Order No..

client_ordidstring

Channel Conversion Order No.. Filters results by Channel Conversion Order No..

forex_typestring

Exchange Type. Filters results by Exchange Type.

Allowed values: FROM, TO

Values
FROM
TO
currencystring

Currency. Filters results by Currency.

Values are dynamic. Call GET /v1/datasets/refs/tenant_currencies_by_channel to retrieve the current data dictionary, and use the returned entry's key as this parameter's value.

updated_atobject

Updated Time. Filters results by Updated Time.

Child attributes
gtestring

Greater Than or Equal. Inclusive lower bound of the filter range.

ltestring

Less Than or Equal. Inclusive upper bound of the filter range.

pageinteger

Page. Page number to retrieve, starting from 1.

page_sizeinteger

Page Size. Number of records to return per page.

orderByarray<object>

Order By. Array of sorting rules. Each item defines a sort field and direction.

Responses

HTTP 200On success, returns paginated Exchange P/L records together with pagination metadata such as the page number, page size, and total record count.
Standard response envelopecodemessagedata
dataobjectdata structure
listarray<object>required

List. Returned value: Records matching the query conditions.

Child attributes
idstring

Record ID. Returned value: Record ID (row primary key); write operations on this record take it as their id.

forex_idstring

Conversion Order No.. Returned value: Conversion Order No..

client_ordidstring

Channel Conversion Order No.. Returned value: Channel Conversion Order No..

channel_namestring

Exchange Channel. Returned value: Exchange Channel.

forex_typestring

Exchange Type. Returned value: Exchange Type.

currencystring

Currency. Returned value: Currency.

channel_ratestring

Channel Exchange Rate. Returned value: Channel Exchange Rate.

channel_amountstring

Channel Amount. Returned value: Channel Amount.

user_ratestring

Client Exchange Rate. Returned value: Client Exchange Rate.

user_amountstring

Client Amount. Returned value: Client Amount.

channel_ledger_datestring

Channel accounting date. Returned value: Channel accounting date. The date or time format follows the value returned by the API.

sett_ledger_datestring

Date of liquidation. Returned value: Date of liquidation. The date or time format follows the value returned by the API.

profit_lossstring

Exchange P/L. Returned value: Exchange P/L.

order_offsetstring

Rounding. Returned value: Rounding.

updated_atstring

Updated Time. Returned value: Updated Time. The date or time format follows the value returned by the API.

totalintegerrequired

Total. Returned value: Total number of matching records, used for pagination.

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