POST
https://api.cryptohopper.com/v1/market/giftcards/activate
Redeems a gift card code for your account: a credits gift card adds credits to your balance, a subscription gift card activates the subscription it holds.
Only available to Cryptohopper's own apps; other apps get a 403 error. The code must be exactly 64 characters. Code checks are throttled per user: one attempt per 10 seconds, and further checks fail for an hour after 11 attempts. In the current code the credits path calls an object that is never created in this endpoint, so redeeming a credits gift card ends in a server error.
Example request
curl -X POST "https://api.cryptohopper.com/v1/market/giftcards/activate" \
-H "access-token: YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"giftcard_code":"Xk3P9qLm2Vr7Tz8Nw4Hs6Jd1Fb5Gc0Ya9Qe2Ru7Io4Pl3Mk8Nj6Bh1Vg5Cf0Dx7S"}'
const response = await fetch('https://api.cryptohopper.com/v1/market/giftcards/activate', {
method: 'POST',
headers: {
"access-token": "YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"giftcard_code": "Xk3P9qLm2Vr7Tz8Nw4Hs6Jd1Fb5Gc0Ya9Qe2Ru7Io4Pl3Mk8Nj6Bh1Vg5Cf0Dx7S"
})
});
const data = await response.json();
import requests
response = requests.post(
"https://api.cryptohopper.com/v1/market/giftcards/activate",
headers={
"access-token": "YOUR_ACCESS_TOKEN"
},
json={
"giftcard_code": "Xk3P9qLm2Vr7Tz8Nw4Hs6Jd1Fb5Gc0Ya9Qe2Ru7Io4Pl3Mk8Nj6Bh1Vg5Cf0Dx7S"
},
)
data = response.json()
$ch = curl_init('https://api.cryptohopper.com/v1/market/giftcards/activate');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'access-token: YOUR_ACCESS_TOKEN',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'giftcard_code' => 'Xk3P9qLm2Vr7Tz8Nw4Hs6Jd1Fb5Gc0Ya9Qe2Ru7Io4Pl3Mk8Nj6Bh1Vg5Cf0Dx7S',
]),
]);
$data = json_decode(curl_exec($ch), true);
Parameters
Headers
| Name | Type | Required | Description |
|---|---|---|---|
access-token |
string | Required | The OAuth access token of the user. |
Response
{
"data": "Your subscription has been activated and added to your account."
}