PUT account-upgrade-paypal

PUT Completes a PayPal account upgrade transaction.

After the user has completed the payment at PayPal, this endpoint is used to verify the payment, and upgrade the account to a Premium account. The paypal cookie received from the POST call must be submitted.

Resource URL

https://www.drillster.com/api/2/account-upgrade-paypal

Parameters

None, but a cookie named paypal must be presented, containing the PayPal transaction state as returned by the preceding POST request.

If a PUT request has no body (i.e. the body is empty), it is still mandatory to include a Content-Length header (i.e. Content-Length: 0). Not all HTTP clients do this automatically. For more information, please see RFC 2616.

Response

A 2.0 User object, with evidence of the upgrade.

Error responses

The following error situations are possible:

ID Response code Description
missing_paypal_cookie400 (Bad request)No paypal cookie was provided
invalid_paypal_cookie400 (Bad request)An invalid paypal cookie was provided
missing_plan400 (Bad request)No plan was specified
unknown_plan400 (Bad request)Given plan ID is unknown
paypal_error400 (Bad request)The communication with PayPal failed
already_premium 400 (Bad request) The account is already a premium account
organization_user 400 (Bad request) The account is part of an organization
unable_to_upgrade 500 (Internal error) Unable to upgrade the account to a premium account