Approvals API
Contains all endpoints regarding approval requests. Approval requests allow child users without direct withdrawal access to create a request to be reviewed.
This feature enables users who do not have direct withdrawal permission to initiate a withdrawal request that can then be reviewed by a user with approval permission.
Approvers have the option to approve or reject a request, while users who initiate a request have the ability to only cancel their own request.
Fetch approval requests
GET https://api.aquanow.io/accounts/v1/approval
Fetches the approval(s) given by the query parameter. 
NOTE: One of startTime or approvalId must be given as a query parameter. Query parameters can not be combined.
Query Parameters
startTime
string
Pagination token that can be used to query more data NOTE: startTime must be within a 90 day range
approvalId
string
yyyy-mm-ddThh:mm:ss.sssZ
UTC time stamp when approval request was created
Returns an ApprovalsObject.
{
    "payload": {
        "transactionType": "WITHDRAW",
        "symbol": "ETH",
        "address": "0xf6aCc5f01BCE41860B425bcaDfD7ce5ABcc19ECq",
        "quantity": 0.4
    },
    "action": "WITHDRAW",
    "requestedBy": "childUser",
    "approvalId": "d0a83d6f-d63b-4c11-a673-3ab0a4191eb5",
    "status": "APPROVED",
    "created": "2023-05-17T17:21:04.238Z",
    "username": "rootUser",
    "reviewRecords": [
        {
            "reviewedAt": "2023-06-05T18:35:52.531Z",
            "comment": "request approved",
            "reviewedBy": "rootUser",
            "status": "APPROVED"
        }
    ],
    "entity": "Approval",
    "resource": "BALANCE"
    }Returns an array of ApprovalsObject.
[
    {
        "payload": {
            "transactionType": "WITHDRAW",
            "symbol": "ETH",
            "address": "0xf6aCc8f06PCE41860B425bcaDfD7c75ABcc19ECa",
            "quantity": 1
        },
        "action": "WITHDRAW",
        "requestedBy": "childUser",
        "approvalId": "d0783d6f-d63b-4c11-a673-3ab0a4191eb2",
        "status": "APPROVED",
        "created": "2023-05-17T17:21:04.238Z",
        "username": "rootUser",
        "reviewRecords": [
            {
                "reviewedAt": "2023-06-05T18:35:52.531Z",
                "comment": "request approved",
                "reviewedBy": "rootUser",
                "status": "APPROVED"
            }
        ],
        "entity": "Approval",
        "resource": "BALANCE"
    },
    {
        "payload": {
            "transactionType": "WITHDRAW",
            "symbol": "USDT",
            "address": "0x6EFD3522f88130e7A788327fe6F73911902088c0",
            "quantity": 300
        },
        "action": "WITHDRAW",
        "requestedBy": "childUser",
        "approvalId": "16d615a8-fc59-47a8-ad8b-48387db3fbf2",
        "status": "PENDING",
        "created": "2023-05-17T17:48:01.346Z",
        "username": "rootUser",
        "reviewRecords": [],
        "entity": "Approval",
        "resource": "BALANCE"
    }
]{
    "message": "Query time range must be within 90 days"
}{
    "message": "Query endTime must be later than startTime"
}{
    "message": "Invalid KeyConditionExpression: The BETWEEN operator requires upper bound to be greater than or equal to lower bound; lower bound operand: AttributeValue: {S:2023-11-T08:00:00.000Z}, upper bound operand: AttributeValue: {S:2023-06-13T21:20:48.821Z}"
}{
    "message": "Invalid query parameters"
}{
    "message": "Record not found"
}{
    "message": "Invalid query parameters"
}Create an approval request
POST https://api.aquanow.io/accounts/v1/approval
Please specify either grossQuantity or quantity inside the payload.
Request Body
Returns an ApprovalsObject.
{
    "approvalId": "9q2f0fd8-1714-4pdc-b1a5-c8ue388704We",
    "resource": "BALANCE",
    "action": "WITHDRAW",
    "payload": {
        "address": "0xf6aCc8f06BCEw5760B425bcaDfQ7ce5ABcd19ECa",
        "symbol": "ETH",
        "quantity": 0.4,
        "transactionType": "WITHDRAW",
        "networkFee": 0.01
    },
    "username": "rootUser",
    "requestedBy": "childUser",
    "reviewRecords": [],
    "status": "PENDING"
}{
    "message": "Invalid request body"
}{
    "message": "Invalid request body"
}Cancel an approval request
DELETE https://api.aquanow.io/accounts/v1/approval
NOTE: Users can only cancel their own approval requests while the request status is PENDING.
Request Body
approvalId*
string
approvalId of approval request
Returns an ApprovalsObject.
{
    "approvalId": "58d5081e-82dc-4tcw-a820-8440e4dfo9c0",
    "status": "CANCELLED"
}{
    "message": "Approval request is invalid to cancel"
}{
    "message": "Invalid request body"
}Review an approval request
POST https://api.aquanow.io/accounts/v1/approval/review
User with approver permissions can approve or reject an approval request while the status is PENDING.
Request Body
action*
string
APPROVE | REJECT
approvalId*
string
approvalId of approval request
comment
string
Comment set by reviewer
Returns an ApprovalsObject.
{
    "approvalId": "58w5081e-82dc-49cw-a820-844oe4dfq9t4",
    "status": "APPROVED"
}{
    "message": "Invalid request body"
}{
    "message": "Approval is invalid for review"
}Last updated