Contract Transfers & Reconciliation
Contract Transfers & Reconciliation: Agent Java SDK v0.3.0 integration, examples, parameters and response semantics.
This guide targets Agent Java SDK v0.3.0, Java 8+, and the tagged public contract. Examples run in a partner backend after initializing client in Quick Start.
Example prerequisites
The Java snippets share these imports. Initialize client using Quick Start and obtain platformUserId from the saved binding. Example user/order IDs must be replaced with your own persisted values.
Fixed Amount Transfer
Use transfer for fixed amount transfers. Direction.IN means transferring
from the partner platform into 6MM. Direction.OUT means transferring from 6MM
back to the partner platform.
Use strings or BigDecimal for amounts. Do not use double or float.
Transfer By agentUserId
Transfer By platformUserId
Provide Both IDs
If both IDs are provided, the service validates that they point to the same bound user.
Request fields:
Response fields:
Order Confirmation And Idempotency
After transfer is called, the Agent service synchronously calls the trading
core on the main path. In most cases, the API response already contains the
synchronous trading-core result.
Idempotency requirements:
- Use one
agentOrderNofor one business transaction. - If HTTP times out or the network fails, query the same
agentOrderNofirst. - Webhooks may be retried. Deduplicate them by idempotency key.
Transfer All Out
transferAllOut moves the user’s withdrawable 6MM-side balance back to the
partner platform.
By platformUserId:
amount in the response is the actual transferred amount.
Reverse Order
Reverse is used to compensate a successful transfer order when the backend supports the reverse flow. Typical cases include partner local order exceptions or manual reconciliation rollback.
Fields:
Notes:
- Reverse is not a normal cancel operation.
- Reverse orders must also be idempotent by order number.
- After an original order is reversed, webhook may push the original order’s
REVERSEDfinal state.
Query Order
Supported orderType values:
TRANSFER_INTRANSFER_OUT
Common response fields:
List Orders
Pagination recommendations:
pagestarts from 1.- Keep
pageSizeat or below 100. - For reconciliation jobs, page by time window and deduplicate by
orderNo.
Source and related guides
Funds event callbacks
transfer.completed may carry SUCCESS, FAILED, or an original order update of REVERSED; reverse.completed is a reversal order terminal event. transfer.dead means the final state remains unconfirmed after retries and needs manual reconciliation, not a confirmed failure. The event name alone does not prove funds were credited.
Successful acknowledgement is distinct from successful funds movement: after recording a valid targetStatus=FAILED notification, return HTTP 2xx as well. Persist funds-event deduplication by orderType:orderId:targetStatus within the merchant and environment scope.
Event fields and JSON examples · Signature verification, responses, and retries