Pull the next renewal forward
curl --request POST \
--url https://api.hi-doctor.ai/v1/users/subscriptions/early-order/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"category": "<string>",
"reason": "",
"treatment_id": "<string>",
"dosage": "<string>",
"changed": false,
"answers": [
{}
],
"change_note": ""
}
'import requests
url = "https://api.hi-doctor.ai/v1/users/subscriptions/early-order/"
payload = {
"category": "<string>",
"reason": "",
"treatment_id": "<string>",
"dosage": "<string>",
"changed": False,
"answers": [{}],
"change_note": ""
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
category: '<string>',
reason: '',
treatment_id: '<string>',
dosage: '<string>',
changed: false,
answers: [{}],
change_note: ''
})
};
fetch('https://api.hi-doctor.ai/v1/users/subscriptions/early-order/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hi-doctor.ai/v1/users/subscriptions/early-order/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'category' => '<string>',
'reason' => '',
'treatment_id' => '<string>',
'dosage' => '<string>',
'changed' => false,
'answers' => [
[
]
],
'change_note' => ''
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.hi-doctor.ai/v1/users/subscriptions/early-order/"
payload := strings.NewReader("{\n \"category\": \"<string>\",\n \"reason\": \"\",\n \"treatment_id\": \"<string>\",\n \"dosage\": \"<string>\",\n \"changed\": false,\n \"answers\": [\n {}\n ],\n \"change_note\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.hi-doctor.ai/v1/users/subscriptions/early-order/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"category\": \"<string>\",\n \"reason\": \"\",\n \"treatment_id\": \"<string>\",\n \"dosage\": \"<string>\",\n \"changed\": false,\n \"answers\": [\n {}\n ],\n \"change_note\": \"\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hi-doctor.ai/v1/users/subscriptions/early-order/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"category\": \"<string>\",\n \"reason\": \"\",\n \"treatment_id\": \"<string>\",\n \"dosage\": \"<string>\",\n \"changed\": false,\n \"answers\": [\n {}\n ],\n \"change_note\": \"\"\n}"
response = http.request(request)
puts response.read_body{
"consultation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"subscription": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"price_cents": 123,
"currency": "<string>",
"payment_method_brand": "<string>",
"payment_method_last4": "<string>",
"early_order_locked": true,
"status": "incomplete",
"started_at": "2023-11-07T05:31:56Z",
"current_period_start": "2023-11-07T05:31:56Z",
"current_period_end": "2023-11-07T05:31:56Z",
"cancel_at_period_end": true,
"canceled_at": "2023-11-07T05:31:56Z",
"treatment_id": "<string>",
"category": "<string>",
"interval": "<string>",
"interval_count": 123,
"cycle_days": 123,
"early_order_locked_until": "2023-11-07T05:31:56Z"
},
"patient_choice_status": "<string>",
"dose_change": {},
"treatment_change": {}
}{
"detail": "Given token not valid for any token type",
"code": "token_not_valid",
"messages": [
{
"token_class": "AccessToken",
"token_type": "access",
"message": "Token is invalid"
}
]
}Billing
Pull the next renewal forward
Creates the renewal consultation now instead of at the period end.
Irreversible, and allowed only once per paid period — it consumes the period’s single early order and sets a lock window.
POST
/
v1
/
users
/
subscriptions
/
early-order
/
Pull the next renewal forward
curl --request POST \
--url https://api.hi-doctor.ai/v1/users/subscriptions/early-order/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"category": "<string>",
"reason": "",
"treatment_id": "<string>",
"dosage": "<string>",
"changed": false,
"answers": [
{}
],
"change_note": ""
}
'import requests
url = "https://api.hi-doctor.ai/v1/users/subscriptions/early-order/"
payload = {
"category": "<string>",
"reason": "",
"treatment_id": "<string>",
"dosage": "<string>",
"changed": False,
"answers": [{}],
"change_note": ""
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
category: '<string>',
reason: '',
treatment_id: '<string>',
dosage: '<string>',
changed: false,
answers: [{}],
change_note: ''
})
};
fetch('https://api.hi-doctor.ai/v1/users/subscriptions/early-order/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hi-doctor.ai/v1/users/subscriptions/early-order/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'category' => '<string>',
'reason' => '',
'treatment_id' => '<string>',
'dosage' => '<string>',
'changed' => false,
'answers' => [
[
]
],
'change_note' => ''
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.hi-doctor.ai/v1/users/subscriptions/early-order/"
payload := strings.NewReader("{\n \"category\": \"<string>\",\n \"reason\": \"\",\n \"treatment_id\": \"<string>\",\n \"dosage\": \"<string>\",\n \"changed\": false,\n \"answers\": [\n {}\n ],\n \"change_note\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.hi-doctor.ai/v1/users/subscriptions/early-order/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"category\": \"<string>\",\n \"reason\": \"\",\n \"treatment_id\": \"<string>\",\n \"dosage\": \"<string>\",\n \"changed\": false,\n \"answers\": [\n {}\n ],\n \"change_note\": \"\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hi-doctor.ai/v1/users/subscriptions/early-order/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"category\": \"<string>\",\n \"reason\": \"\",\n \"treatment_id\": \"<string>\",\n \"dosage\": \"<string>\",\n \"changed\": false,\n \"answers\": [\n {}\n ],\n \"change_note\": \"\"\n}"
response = http.request(request)
puts response.read_body{
"consultation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"subscription": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"price_cents": 123,
"currency": "<string>",
"payment_method_brand": "<string>",
"payment_method_last4": "<string>",
"early_order_locked": true,
"status": "incomplete",
"started_at": "2023-11-07T05:31:56Z",
"current_period_start": "2023-11-07T05:31:56Z",
"current_period_end": "2023-11-07T05:31:56Z",
"cancel_at_period_end": true,
"canceled_at": "2023-11-07T05:31:56Z",
"treatment_id": "<string>",
"category": "<string>",
"interval": "<string>",
"interval_count": 123,
"cycle_days": 123,
"early_order_locked_until": "2023-11-07T05:31:56Z"
},
"patient_choice_status": "<string>",
"dose_change": {},
"treatment_change": {}
}{
"detail": "Given token not valid for any token type",
"code": "token_not_valid",
"messages": [
{
"token_class": "AccessToken",
"token_type": "access",
"message": "Token is invalid"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/jsonapplication/x-www-form-urlencodedmultipart/form-data
Maximum string length:
50Maximum string length:
500Maximum string length:
255Maximum string length:
255Show child attributes
Show child attributes
Maximum string length:
1000