Order a subscription

POST https://api.cryptohopper.com/v1/subscription/order

Buys a subscription plan with the user's credits. Call it once without confirm to get a confirmation code, then call it again with that code in confirm to place and pay the order.

The first call returns data with message and confirm (the code to send back). Only plan_id 1, 2, 3 and 89 can be ordered; payment_term is year or month, anything else means month. discount_code is optional. The user profile must be complete and the credit balance must cover the total including tax. hopper_id is read but the new subscription is not assigned to that bot; use Assign subscription afterwards.

Example request

curl -X POST "https://api.cryptohopper.com/v1/subscription/order" \
  -H "access-token: YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"plan_id":2,"payment_term":"month","confirm":"9e107d9d372bb6826bd81d3542a419d6"}'

Parameters

Headers

NameTypeRequiredDescription
access-token string Required The OAuth access token of the user.

Request body

JSON, model OrderSubModel

FieldTypeRequiredDescription
payment_termstringOptionalOne of: year, month.
plan_idintegerRequired
confirmstringOptional
discount_codestringOptional
hopper_idintegerOptional

Response

Example response (illustrative values)

{
    "data": {
        "message": "Your subscription has been ordered and paid.",
        "subscription_id": 466001,
        "plan_id": 2,
        "payment_id": 501234
    }
}

Status codes: 200. Errors return JSON with status, error and message. See How the API works for response codes and rate limits.