Skip to main content

calculateWalletPayment

PaymentCalculationWrapper calculateWalletPayment(WalletQuantityRequestDto)

PUT /api/2.0/portal/payment/calculatewallet

Calculate the wallet payment amount

Prices a wallet-service purchase without making it: it returns what buying the requested number of units would cost right now, so a client can show the amount before asking for a confirmation. Only productQuantityType Add (1) is accepted, the quantity must be greater than zero, and the portal needs a billing customer whose wallet has a sub-account in the accounting currency. The caller has to be a DocSpace administrator. Nothing is bought, charged or written down - the call is read-only and may be repeated - and the purchase itself is PUT api/2.0/portal/payment/updatewallet. The answer carries the amount with its currency, the quantity it was computed for and the identifier of the calculation. It is the price of this moment and is not held: it can differ by the time the purchase is made.

Parameters​

NameInTypeDescriptionNotes
WalletQuantityRequestDtobodyWalletQuantityRequestDto[optional]

Responses​

Status codeDescriptionTypeResponse headers
200The amount the purchase would cost, its currency and the quantity it was calculated forPaymentCalculationWrapperX-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
400The request body cannot be read or has no quantity, quantity does not hold exactly one product, the quantity type is not Add, the quantity is not greater than zero, or the product is not a wallet service--
403The caller is not a DocSpace administrator, or the portal has no billing service configured--
404This portal has no billing customer, or its wallet has no balance or no sub-account in the accounting currency--
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​

PaymentCalculationWrapper

Authorization​

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

HTTP request headers​

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