External Settlement

External system adjustment

post

1: When a user places an order within a platform, the platform will send this request to an external system. This request must be replied to within 3 seconds, otherwise the platform will consider it as a timeout and cancel the operation, while also sending a 'cancel external system adjustment' to the external system to maintain data consistency. 2: Special note, when calling the 'cancel external system adjustment' interface, if an exception occurs or the correct response is not received, it will retry a specified number of times and then abort subsequent operations.

Header parameters
tracestringRequired

Global link identifier

Example: {{mock_trace}}
companyIdintegerOptional

Company Id, country where the user is located

Example: 0
timestampnumberRequired

Request initiation timestamp, accurate to the millisecond, 13 digits

Example: 0
Body
thirdServerCodestringRequired

Unique customer number for third-party systems

userNamestring · max: 48Required

TradeBoss user identity unique number

currencystring · max: 16Required

Account currency code, standard ISO 3-character currency unit

bizTypeintegerRequired

Business type, 1-Market price open; 2-Market price close; 10-Limit price pending order; 11-Stop loss pending order; 12-Limit price open

operationTypestringRequired

Operation type, OPEN_POSITION=Opening position, NORMAL_CLOSE=Normal closing, ABNORMAL_OVERTRADING=Abnormal overtrading. When it is NORMAL_CLOSE or OPEN_POSITION, the amount can only be a positive number; when it is ABNORMAL_OVERTRADING, the amount is a negative number. The external system can independently decide whether to continue deducting the quota to complete this transaction, or ignore this request.

amountstringRequired

Amount, combined with operationType

amountDigitsintegerRequired

Amount decimal places

orderIdinteger · longRequired

Order ID

requestUniqueNostring · max: 48Required

Request unique number, multiple requests need to maintain business idempotence

requestTimeinteger · longRequired

Request initiation timestamp, accurate to the millisecond, 13 digits

ipstringRequired

User IP

metadatastring · max: 200Optional

Remarks, JSON format

Responses
200Success
application/json
post
/
POST /api/ HTTP/1.1
Host: prewppc-3.cmfbl.com
trace: text
timestamp: 1
Content-Type: application/json
Accept: */*
Content-Length: 102

{
  "tradeType": 81,
  "accountId": 15,
  "sortType": "desc",
  "sortFieldName": "orderTime",
  "accountCurrency": "USDT"
}
200Success
{
  "msgParams": "veniam sit",
  "msg": "anim nisi consectetur sit sed",
  "trace": "laboris",
  "tm": 62,
  "bizCode": "10",
  "data": {},
  "code": "100",
  "fail": false,
  "ok": true
}
Deprecated

Transfer to CP when closing position

post

When a member has finished a game they have bet on and has a net win amount, CATS2 will send this request to the CP system. The CP system needs to adjust the member's account balance. This request will be sent continuously until it is processed and responded to correctly.

Header parameters
companyIdstringOptionalExample: {{company}}
tokenstringOptionalExample: {{LoginResult.data.token}}
langstringOptionalExample: en-US
groupstringOptionalExample: tradeApi
tracestringOptionalExample: {{mock_trace}}
versionstringOptionalExample: 0.0.1
Body
usernamestring · max: 48Required

Unique customer identity number

currencystring · max: 16Required

Account currency code, standard ISO 3-character currency unit

amountstringRequired

Operation amount

amountDigistintegerRequired

Amount decimal places

txidstring · max: 48Required

Unique transaction number, business idempotent needs to be maintained for multiple requests

requesttimeinteger · longOptional

Request initiation timestamp, accurate to the millisecond, 13 digits

ipstringRequired

User IP

remarkstring · max: 200Required

Third-party business remark information

Responses
200Success
application/json
post
/global/tradeapi.app.OrderApiService.queryPBOOrderPage
POST /api/global/tradeapi.app.OrderApiService.queryPBOOrderPage HTTP/1.1
Host: prewppc-3.cmfbl.com
Content-Type: application/json
Accept: */*
Content-Length: 102

{
  "tradeType": 81,
  "accountId": 15,
  "sortType": "desc",
  "sortFieldName": "orderTime",
  "accountCurrency": "USDT"
}
200Success
{
  "msgParams": "veniam sit",
  "msg": "anim nisi consectetur sit sed",
  "trace": "laboris",
  "tm": 62,
  "bizCode": "10",
  "data": {},
  "code": "100",
  "fail": false,
  "ok": true
}

Cancel external system adjustment

post

When an 'external system adjustment' request times out or the external system returns an error message, the platform will send this request to the external system to ensure data consistency.

Header parameters
tracestringRequired

Global link identifier

Example: {{mock_trace}}
companyIdintegerOptional

Company Id, country where the user is located

Example: 0
timestampnumberRequired

Request initiation timestamp, accurate to the millisecond, 13 digits

Example: 0
Body
thirdServerCodestringOptional

Unique customer number for third-party systems

userNamestring · max: 48Required

TradeBoss user identity unique number

currencystring · max: 16Required

Account currency code, standard ISO 3-character currency unit

bizTypeintegerRequired

Business type, 1-Market price open; 2-Market price close; 10-Limit price pending order; 11-Stop loss pending order; 12-Limit price open

amountstringRequired

Amount, can only be a positive number

amountDigitsintegerRequired

Amount decimal places

orderIdinteger · longOptional

Order ID

requestUniqueNostring · max: 48Required

Request unique number, multiple requests need to maintain business idempotence

reverseRequestUniqueNostringRequired

This number corresponds to the requestUniqueNo when the 'external system adjusts the amount' request was made. The external system needs to check if this number has been processed. If processed correctly, the correct amount needs to be returned to the client; if the request was received but not processed correctly, return code=US_0000001. If no request with this number was received, return code=US_0000002

requestTimeinteger · longRequired

Request initiation timestamp, accurate to the millisecond, 13 digits

ipstringRequired

User IP

cancelRemarkstring · max: 200Required

Cancellation reason

metadatastring · max: 200Optional

Remarks, JSON format

Responses
200Success
application/json
post
/get-user-amount
POST /api/get-user-amount HTTP/1.1
Host: prewppc-3.cmfbl.com
trace: text
timestamp: 1
Content-Type: application/json
Accept: */*
Content-Length: 102

{
  "tradeType": 81,
  "accountId": 15,
  "sortType": "desc",
  "sortFieldName": "orderTime",
  "accountCurrency": "USDT"
}
200Success
{
  "msgParams": "veniam sit",
  "msg": "anim nisi consectetur sit sed",
  "trace": "laboris",
  "tm": 62,
  "bizCode": "10",
  "data": {},
  "code": "100",
  "fail": false,
  "ok": true
}

External System Credit Limit Adjustment

post

1: When a user places an order within the TradeBoss platform, the platform sends this request to an external system. The external system must respond within 3 seconds, otherwise the TradeBoss platform will consider it as a timeout and cancel the operation. At the same time, it will also send a "Cancel external system credit limit adjustment" request to maintain data consistency with the external system.

2: It is important to note that when calling the "Cancel external system credit limit adjustment" interface, if any exceptions occur or if a correct response is not received, there will be specified retries before aborting subsequent operations.

Header parameters
tracestringRequired

Global Link Identifier.

Example: {{mockTrace}}
companyIdintegerRequired

Company Id,User's company ID

Example: {{companyId}}
timestampnumberRequired

Request initiation timestamp, accurate to the millisecond, 13 digits.

Example: 0
Body
thirdServerCodestringRequired

Third-party system customer unique identifier

userNamestring · max: 48Required

TradeBoss user identity unique identifier

currencystring · max: 16Required

Account currency code, standard ISO 3-character currency unit.

bizTypeintegerRequired

Business types: 1 - Market order open; 2 - Market order close; 10 - Limit price stop order; 11 - Stop loss stop order; 12 - Limit price open

operationTypestringRequired

The operation types are OPEN_POSITION for opening a position, NORMAL_CLOSE for normal closing, and ABNORMAL_OVERTRADING for abnormal overtrading. When the operation type is NORMAL_CLOSE or OPEN_POSITION, the amount can only be a positive number. When it is ABNORMAL_OVERTRADING, the amount should be negative. The third-party system can decide whether to continue deducting quotas to complete this transaction or ignore this request.

amountstringRequired

Amount, used in conjunction with operationType.

amountDigitsintegerRequired

Amount decimal places.

orderIdinteger · longRequired

Order ID.

requestUniqueNostring · max: 48Required

Request for a unique identifier, multiple requests need to maintain business idempotence.

requestTimeinteger · longRequired

Request initiation timestamp, accurate to the millisecond, 13 digits

ipstringRequired

User IP

metadatastring · max: 200Optional

Remarks information, in JSON format.

Responses
200Success
application/json
post
/external-system-credit-limit-adjustment
POST /api/external-system-credit-limit-adjustment HTTP/1.1
Host: prewppc-3.cmfbl.com
trace: text
companyId: 1
timestamp: 1
Content-Type: application/json
Accept: */*
Content-Length: 102

{
  "tradeType": 81,
  "accountId": 15,
  "sortType": "desc",
  "sortFieldName": "orderTime",
  "accountCurrency": "USDT"
}
200Success
{
  "msgParams": "veniam sit",
  "msg": "anim nisi consectetur sit sed",
  "trace": "laboris",
  "tm": 62,
  "bizCode": "10",
  "data": {},
  "code": "100",
  "fail": false,
  "ok": true
}

Cancel external system credit limit adjustment

post

When "External System Credit Limit Adjustment", if the request times out or the external system returns an error message, TradeBoss platform will send this request to the external system in order to maintain data consistency.

Header parameters
tracestringRequired

Global Link Identifier.

Example: {{mockTrace}}
companyIdintegerRequired

Company Id,User's company ID

Example: {{companyId}}
timestampnumberOptional

Request initiation timestamp, accurate to the millisecond, 13 digits.

Example: 0
Body
thirdServerCodestringRequired

Third-party system customer unique identifier

userNamestring · max: 48Required

TradeBoss user identity unique identifier

currencystring · max: 16Required

Account currency code, standard ISO 3-character currency unit

bizTypeintegerRequired

Business type, 1-market price opening; 2-market price closing; 10-limit price pre-embedded order; 11-stop loss pre-embedded order; 12-limit price opening

amountstringRequired

Amount, can only be positive

amountDigitsintegerRequired

Amount decimal places

orderIdinteger · longOptional

Order ID

requestUniqueNostring · max: 48Required

Request unique number, multiple requests need to maintain business idempotence.

reverseRequestUniqueNostringRequired

This number corresponds to the request_unique_no when the "third-party system transfer" was requested earlier. The third-party system needs to check whether this number has been processed. If it is correctly processed, it needs to return the correct amount to the customer. If a request is received but not processed correctly, return code=US_0000001. If no request with this number is received, return code=US_0000002.

requestTimeinteger · longRequired

Request initiation timestamp accurate up to milliseconds and in a format of 13 digits.

ipstringRequired

User IP address

cancelRemarkstring · max: 200Required

Cancellation reason

metadatastring · max: 200Optional

Remarks information in JSON format

Responses
200Success
application/json
post
/cancel-external-system-credit-limit-adjustment
POST /api/cancel-external-system-credit-limit-adjustment HTTP/1.1
Host: prewppc-3.cmfbl.com
trace: text
companyId: 1
Content-Type: application/json
Accept: */*
Content-Length: 102

{
  "tradeType": 81,
  "accountId": 15,
  "sortType": "desc",
  "sortFieldName": "orderTime",
  "accountCurrency": "USDT"
}
200Success
{
  "msgParams": "veniam sit",
  "msg": "anim nisi consectetur sit sed",
  "trace": "laboris",
  "tm": 62,
  "bizCode": "10",
  "data": {},
  "code": "100",
  "fail": false,
  "ok": true
}

Last updated