Cashflow Prediction
The processor has the ability to get the cashflow prediction of all users under its associated vendors.
Authentication Route
This route is secured with processor token authentication.
Endpoint
/processor/api/v1/cashflow/prediction/{user_uuid}
Request Payload
{
"prediction_date": "2023-05-22",
"amount": 50000
}
Fields | Type | Is Required | Description |
---|---|---|---|
prediction_date | date | Date in Y-m-d format | |
amount | integer | Transaction 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 Code | Error Code | Sub Error Code | Message |
---|---|---|---|
400 | client_error | missing_accept_header | Invalid value provided for Accept header. |
400 | client_error | missing_path_parameter | Your request could not be processed due to invalid or missing parameters |
401 | client_error | invalid_token_format | Invalid token format. The token should be in the following format: ID|TOKEN_VALUE. Example: 12345|abcdefg |
401 | client_error | invalid_token_format | Invalid token format. The ID in the token must be an integer. Example: 12345|abcdefg |
401 | client_error | unauthorized | Invalid token |
403 | client_error | Only a bank account connected through GrailPay's bank link widget can provide access to the account balance | |
403 | client_error | expired_linked_account | The linked account has expired |
404 | client_error | uuid_not_found | The User was not found |
422 | 1) 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. | ||
500 | system_error | unhandled_error | Something went wrong, please try again later |
Updated 5 months ago