PATCH
https://api.cryptohopper.com/v1/subscription/{subscription_id}
Turns off auto-renewal of a subscription and cancels the recurring payment at the payment provider. The subscription stays active until its end date.
OAuth scope:
read manage About scopes
Takes no request body. If cancelling at the payment provider fails, the endpoint returns HTTP 200 with the message "There was an error trying to cancel the subscription, please try again."
Example request
curl -X PATCH "https://api.cryptohopper.com/v1/subscription/SUBSCRIPTION_ID" \
-H "access-token: YOUR_ACCESS_TOKEN"
const response = await fetch('https://api.cryptohopper.com/v1/subscription/SUBSCRIPTION_ID', {
method: 'PATCH',
headers: {
"access-token": "YOUR_ACCESS_TOKEN"
}
});
const data = await response.json();
import requests
response = requests.patch(
"https://api.cryptohopper.com/v1/subscription/SUBSCRIPTION_ID",
headers={
"access-token": "YOUR_ACCESS_TOKEN"
},
)
data = response.json()
$ch = curl_init('https://api.cryptohopper.com/v1/subscription/SUBSCRIPTION_ID');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'access-token: YOUR_ACCESS_TOKEN',
],
]);
$data = json_decode(curl_exec($ch), true);
Parameters
Headers
| Name | Type | Required | Description |
|---|---|---|---|
access-token |
string | Required | The OAuth access token of the user. |
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
subscription_id |
string | Required | ID of the subscription. |
Response
{
"data": "Subscription has been stopped, and will be deactivated after the end of the subscription."
}