Request

A request represents a transaction initiated from tenant system.

Requests are initiated from a tenant system through the API. Currently transfer and withdrawal requests can be actively triggered - deposits are passive and will appear automatically as transactions in a wallet.

To issue a request, the tenant system must sign the request message with their API secret key to authenticate that the request is coming from an approved system.

Once a withdrawal request is triggered, it enters an approval flow requiring authorization from multiple approvers as defined in the user and group policies. Not all requests may be approved - some may fail due to issues like insufficient funds or insufficient daily quota.

Approved withdrawal requests are then handed over to the ON1ON Custody blockchain processing module to execute the actual transactions and asset transfers.

From now on, all active requests will have 3 IDs:

  • RequestId: The requestId is generated once your request is received by ON1ON Custody.

  • TransactionId: The transactionId is generated when a transaction is initiated or has already occurred.

  • ReferenceId: It's important to generate a unique referenceId in your system, as this will allow you to retrieve the potential issued transaction or request later on even if communication between your system and ON1ON Custody fails at some point.

All these three IDs can be used to retrieve transaction. The available time for these IDs are as follows:

RequestType
ReferenceId
RequestId
TransactionId

Withdraw

Should be provided

Request is made

Request is made

Transfer

Should be provided

Request is made

Request is made

Deposit

Never. It is not a request.

Never. It is not a request.

On-chain tx is received by ON1ON Custody.

From now on internal transfers are supported.

Internal transfers do not require approval.

A typical request content is as follows when being retrieved:

{
    "RequestId": "REQ425594709557253",
    "Type": "WITHDRAW",
    "ReferenceId": "bot_withdraw_1686041360357",
    "Wallet": {
        "id": "WLT402923816747013",
        "user": {
            "id": "OCUR402923816726533",
            "email": "[email protected]",
            "reference_id": "UXX-001"
        }
    },
    "Asset": {
        "chain": "CHAIN_APEX",
        "contract": null,
        "contract_standard": "NATIVE",
        "name": "ETH Ryan",
        "symbol": "RETH",
        "icon": "https://s3.ap-east-1.amazonaws.com/file.on1on-custody.com/public/icon/eth.png",
        "asset_id": 30,
        "properties": {}
    },
    "Amount": "4.987511",
    "AmountUsd": "615.708263",
    "FromAddress": "",
    "ToAddress": "0x0939E0cfd75d2EdB5BE9bdC7b3619b41B04b5Bb5",
    "Note": "do by test bot",
    "Time": 1686041360,
    "ApprovalsNeeded": 1,
    "ApprovalReceived": 0,
    "ApprovedStatus": "APPROVED",
    "FinalizedAt": 1686108916,
    "Source": "CLIENT",
    "Transaction": {
        "id": "55909",
        "chain_tx_id": "10734",
        "tx_type": "TX_TYPE_WITHDRAW",
        "bill_type": "BILL_TYPE_VALUE_TRANSFER",
        "direction": "TX_DIRECTION_OUTGOING",
        "name": "Alan Testing",
        "status": "TX_STATUS_SUCCEEDED",
        "asset": {
            "chain": "CHAIN_APEX",
            "contract": null,
            "contract_standard": "NATIVE",
            "name": "ETH Ryan",
            "symbol": "RETH",
            "icon": "https://s3.ap-east-1.amazonaws.com/file.on1on-custody.com/public/icon/eth.png",
            "asset_id": 30,
            "properties": {}
        },
        "from_user_id": "OCUR402923816726533",
        "from_wallet_id": "WLT402923816747013",
        "from_wallet_address": "0x7d74ddb2898654170ae08a85cac39f00a34b0eef",
        "to_user_id": null,
        "to_wallet_id": null,
        "to_wallet_address": "0x0939E0cfd75d2EdB5BE9bdC7b3619b41B04b5Bb5",
        "amount": "4.987511",
        "fee": "0.000021",
        "remark": "do by test bot",
        "approve_remark": "",
        "score": {
            "kya_score": 50,
            "aml_score": 99,
            "aml_grading": 9
        },
        "chain_status": "CHAIN_STATUS_SUCCEEDED",
        "tx_time": 1686108918,
        "chain": "CHAIN_APEX",
        "tx_hash": "0xd7a9d3989cc0f7e27a575b950b6a7e1387837cb62cb0ec3c8d513f9fcef05e4d",
        "tx_bill_time": 1686109066
    }
}

Last updated