Pay for an Order from an Account Balance
This method allows to pay for an Order using an Account Balance.
- If an Account Balance is more or equal to the order amount, the order's status is changed from Waiting for payment to Provisioning and the required amount of money is written off from the Account Balance.
- If an Account Balance is less than order amount, the method returns the message about a failure to conduct payment.
PUT /api/v2/vendor/payments/:id/pay_from_balance.json?api_token={api_token}
Arguments
Name | Parameter Type | Data type | Required/Optional | Description |
---|---|---|---|---|
id | path | string | Required | A payment ID. |
api_token | query | string | Required | API token of the manager who perform the operation (see API Token Authentication). |
Request example
PUT http://billing.activeplatform.com:80/api/v2/vendor/payments/2007066/pay_from_balance.json?api_token=654321
Response example
If an Account Balance is more or equal to the order amount, the method returns:
{ "message": "Order has been paid successfully" }
If an Account Balance is less than order amount, the method returns:
{ "error": "This payment cannot be completed by balance" }
If you make a repeated request, the method returns:
{ "error": "This payment cannot be completed by balance" }