跳到主要内容

getPaymentUrl

StringWrapper getPaymentUrl(PaymentUrlRequestDto)

PUT /api/2.0/portal/payment/url

Get the payment page URL

Starts the purchase of a monthly paid plan for this portal by handing back the hosted checkout page the buyer has to open; nothing is bought until that page is completed. The portal must have no paid plan yet - a portal whose plan is already paid gets an empty result and changes its subscription through PUT api/2.0/portal/payment/update instead - and the product name in quantity must be one of the monthly, non-wallet plans listed by GET api/2.0/portal/payment/quotas. Only a DocSpace administrator may call it. The call itself changes nothing on the portal and may be repeated: the money is taken by the payment provider on the checkout page, and the plan becomes active once the provider confirms it. The returned URL is absolute and single-purpose - it carries the caller's e-mail, the language of the request and the currency of the request region, and it redirects to successUrl or backUrl when the buyer finishes or cancels. Exactly one product per call is accepted and its quantity has to be greater than zero; yearly and wallet products are refused, and wallet services are bought with PUT api/2.0/portal/payment/updatewallet instead.

Parameters​

NameInTypeDescriptionNotes
PaymentUrlRequestDtobodyPaymentUrlRequestDto[optional]

Responses​

Status codeDescriptionTypeResponse headers
200The absolute URL of the checkout page to open, or an empty result when the portal already has a paid planStringWrapperX-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
400The request body cannot be read or has no backUrl, successUrl or quantity, backUrl or successUrl does not start with http://, https:// or ftp:// or is longer than 255 characters, or quantity does not hold exactly one product, holds a quantity that is not greater than zero, or a product that is not a monthly plan--
402The portal already has more administrators, users, rooms or AI agents, or stores more data, than the plan in the requested quantity allows--
403The caller is not a DocSpace administrator, or the portal has no billing service configured--
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​

StringWrapper

Authorization​

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

HTTP request headers​

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