Payment status with the Portal API
After creation, each request has a payment status, you can view the data of a request which contains the payment status via:
You will receive back an object that looks like this:
To get the payment status of a Request you can use the requestData object to check if the balance is greater than or equal to the expectedAmount.
If the balance >= expectedAmount - this means the request is paid. If the balance > 0 but < expectedAmount - this means the request is partially paid. If the balance == 0 - this means the request is unpaid.
You can use the following snippet to see if the request has been paid.
If the Request is unpaid, it might be useful to use the metadata field called ‘state’ - the state will return the current payment status of the request, either ‘created’, ‘accepted’, ‘pending’ or ‘canceled’.