Documentation
Log In
Documentation

Get cashflow prediction

Endpoint

   /3p/api/v1/cashflow/prediction/{user_uuid}

 

Request Payload

{
    "prediction_date": "2023-05-22",
    "amount": 50000
}
FieldsTypeIs RequiredDescription
prediction_datedateDate in Y-m-d format
amountintegerTransaction amount in cents

Response Object

{
    "status": true,
    "message": "",
    "data": {
        "prediction": "true|false",
        "predictive_balance": 125488
    },
    "errors": null,
    "error_code": null
}
{
    "status": false,
    "message": "The linked account has expired",
    "data": null,
    "errors": null,
    "error_code": {
        "type": "client_error",
        "subtype": "expired_linked_account"
    }
}
{
    "status": false,
    "message": "Only a bank account connected through GrailPay's bank link widget can provide access to the account balance",
    "data": null,
    "errors": null,
    "error_code": {
        "type": "client_error",
        "subtype": null
    }
}
{
    "status": false,
    "message": "The User was not found",
    "data": null,
    "errors": null,
    "error_code": {
        "type": "client_error",
        "subtype": "uuid_not_found"
    }
}
{
    "status": false,
    "message": "Something went wrong, please try again later",
    "data": null,
    "errors": null,
    "error_code": {
        "type": "system_error",
        "subtype": "unhandled_error"
    }
}

Errors & Warnings

HTTP Status CodeError CodeSub Error CodeMessage
400client_errormissing_accept_headerInvalid value provided for Accept header.
400client_errormissing_path_parameterYour request could not be processed due to invalid or missing parameters
401client_errorinvalid_token_formatInvalid token format. The token should be in the following format: ID|TOKEN_VALUE. Example: 12345|abcdefg
401client_errorinvalid_token_formatInvalid token format. The ID in the token must be an integer. Example: 12345|abcdefg
401client_errorunauthorizedInvalid token
403client_errorOnly a bank account connected through GrailPay's bank link widget can provide access to the account balance
403client_errorexpired_linked_accountThe linked account has expired
404client_erroruuid_not_foundThe User was not found
4221) The prediction date does not match the format Y-m-d.
2) The amount must be at least 10.
3) The amount must be an integer.
500system_errorunhandled_errorSomething went wrong, please try again later