跳到主要内容

topUpDeposit

BooleanWrapper topUpDeposit(TopUpDepositRequestDto)

POST /api/2.0/portal/payment/deposit

Top up the wallet

Charges the payment method on file and adds the amount to the portal's wallet, the balance every wallet service is paid from. The portal needs a billing customer with a payment method set - attach one with GET api/2.0/portal/payment/checkoutsetupurl - currency has to be one of the accounting currencies this installation supports, and amount is a whole number of currency units between 1 and 999999. Only the payer may call it. The call takes money and is not idempotent in any way: two identical requests charge twice, so a client must not retry it blindly after a timeout, and it is limited to ten requests a minute per user by default. A successful top-up pushes the new balance to the portal clients over their socket connection and re-arms the low-balance notification. The result is true when the payment provider accepted the charge; read the resulting balance back from GET api/2.0/portal/payment/customer/balance.

Parameters​

NameInTypeDescriptionNotes
TopUpDepositRequestDtobodyTopUpDepositRequestDto[optional]

Responses​

Status codeDescriptionTypeResponse headers
200true when the payment provider accepted the charge and the wallet was creditedBooleanWrapperX-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
400currency is not one of the supported accounting currencies, or amount is outside 1 to 999999--
403The caller is not the payer of this portal, the portal has no billing service configured, or the customer has no payment method set--
404This portal has no billing customer yet--
401UnauthorizedErrorApiResponse-
429Too Many Requests.ErrorApiResponseRetry-After
500Internal Server Error.ErrorApiResponse-
502Bad Gateway. Returned by the reverse proxy, response body may be HTML and not JSON.--
503Service Unavailable. Returned by the reverse proxy, response body may be HTML and not JSON.--

Return type​

BooleanWrapper

Authorization​

Basic, OAuth2 (scopes: read, write), ApiKeyBearer, asc_auth_key, Bearer, OpenId

HTTP request headers​

  • Content-Type: application/json
  • Accept: application/json