Create a patient subscription
curl --request POST \
--url https://vitarelay.com/api/public/v1/subscriptions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"patient_id": "3a2b1c0d-9e8f-4a7b-8c6d-5e4f3a2b1c0d",
"item_kind": "product",
"item_id": "153cfbff-3d44-4501-9e45-7e7bf1ab130e",
"quantity": 1,
"cadence": "monthly",
"payment_method_id": "9e8f7a6b-5c4d-3e2f-1a0b-9c8d7e6f5a4b"
}
'import requests
url = "https://vitarelay.com/api/public/v1/subscriptions"
payload = {
"patient_id": "3a2b1c0d-9e8f-4a7b-8c6d-5e4f3a2b1c0d",
"item_kind": "product",
"item_id": "153cfbff-3d44-4501-9e45-7e7bf1ab130e",
"quantity": 1,
"cadence": "monthly",
"payment_method_id": "9e8f7a6b-5c4d-3e2f-1a0b-9c8d7e6f5a4b"
}
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({
patient_id: '3a2b1c0d-9e8f-4a7b-8c6d-5e4f3a2b1c0d',
item_kind: 'product',
item_id: '153cfbff-3d44-4501-9e45-7e7bf1ab130e',
quantity: 1,
cadence: 'monthly',
payment_method_id: '9e8f7a6b-5c4d-3e2f-1a0b-9c8d7e6f5a4b'
})
};
fetch('https://vitarelay.com/api/public/v1/subscriptions', 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://vitarelay.com/api/public/v1/subscriptions",
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([
'patient_id' => '3a2b1c0d-9e8f-4a7b-8c6d-5e4f3a2b1c0d',
'item_kind' => 'product',
'item_id' => '153cfbff-3d44-4501-9e45-7e7bf1ab130e',
'quantity' => 1,
'cadence' => 'monthly',
'payment_method_id' => '9e8f7a6b-5c4d-3e2f-1a0b-9c8d7e6f5a4b'
]),
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://vitarelay.com/api/public/v1/subscriptions"
payload := strings.NewReader("{\n \"patient_id\": \"3a2b1c0d-9e8f-4a7b-8c6d-5e4f3a2b1c0d\",\n \"item_kind\": \"product\",\n \"item_id\": \"153cfbff-3d44-4501-9e45-7e7bf1ab130e\",\n \"quantity\": 1,\n \"cadence\": \"monthly\",\n \"payment_method_id\": \"9e8f7a6b-5c4d-3e2f-1a0b-9c8d7e6f5a4b\"\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://vitarelay.com/api/public/v1/subscriptions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"patient_id\": \"3a2b1c0d-9e8f-4a7b-8c6d-5e4f3a2b1c0d\",\n \"item_kind\": \"product\",\n \"item_id\": \"153cfbff-3d44-4501-9e45-7e7bf1ab130e\",\n \"quantity\": 1,\n \"cadence\": \"monthly\",\n \"payment_method_id\": \"9e8f7a6b-5c4d-3e2f-1a0b-9c8d7e6f5a4b\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://vitarelay.com/api/public/v1/subscriptions")
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 \"patient_id\": \"3a2b1c0d-9e8f-4a7b-8c6d-5e4f3a2b1c0d\",\n \"item_kind\": \"product\",\n \"item_id\": \"153cfbff-3d44-4501-9e45-7e7bf1ab130e\",\n \"quantity\": 1,\n \"cadence\": \"monthly\",\n \"payment_method_id\": \"9e8f7a6b-5c4d-3e2f-1a0b-9c8d7e6f5a4b\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"subscription_id": "0f1f2c9e-2f30-4a1b-8b1c-6f4e9a0c1d22",
"order_id": null,
"status": "active",
"next_charge_at": "2026-10-25T04:06:14Z"
}
}{
"error": {
"code": "validation_failed",
"message": "One or more fields are invalid"
}
}{
"error": {
"code": "validation_failed",
"message": "One or more fields are invalid"
}
}{
"error": {
"code": "validation_failed",
"message": "One or more fields are invalid"
}
}Subscriptions
Create a patient subscription
Uses the same storefront eligibility, purchase-mode, live-price, shipping, saved-card and Rx rules as patient checkout. Services do not require shipping or pharmacy dispatch.
POST
/
subscriptions
Create a patient subscription
curl --request POST \
--url https://vitarelay.com/api/public/v1/subscriptions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"patient_id": "3a2b1c0d-9e8f-4a7b-8c6d-5e4f3a2b1c0d",
"item_kind": "product",
"item_id": "153cfbff-3d44-4501-9e45-7e7bf1ab130e",
"quantity": 1,
"cadence": "monthly",
"payment_method_id": "9e8f7a6b-5c4d-3e2f-1a0b-9c8d7e6f5a4b"
}
'import requests
url = "https://vitarelay.com/api/public/v1/subscriptions"
payload = {
"patient_id": "3a2b1c0d-9e8f-4a7b-8c6d-5e4f3a2b1c0d",
"item_kind": "product",
"item_id": "153cfbff-3d44-4501-9e45-7e7bf1ab130e",
"quantity": 1,
"cadence": "monthly",
"payment_method_id": "9e8f7a6b-5c4d-3e2f-1a0b-9c8d7e6f5a4b"
}
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({
patient_id: '3a2b1c0d-9e8f-4a7b-8c6d-5e4f3a2b1c0d',
item_kind: 'product',
item_id: '153cfbff-3d44-4501-9e45-7e7bf1ab130e',
quantity: 1,
cadence: 'monthly',
payment_method_id: '9e8f7a6b-5c4d-3e2f-1a0b-9c8d7e6f5a4b'
})
};
fetch('https://vitarelay.com/api/public/v1/subscriptions', 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://vitarelay.com/api/public/v1/subscriptions",
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([
'patient_id' => '3a2b1c0d-9e8f-4a7b-8c6d-5e4f3a2b1c0d',
'item_kind' => 'product',
'item_id' => '153cfbff-3d44-4501-9e45-7e7bf1ab130e',
'quantity' => 1,
'cadence' => 'monthly',
'payment_method_id' => '9e8f7a6b-5c4d-3e2f-1a0b-9c8d7e6f5a4b'
]),
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://vitarelay.com/api/public/v1/subscriptions"
payload := strings.NewReader("{\n \"patient_id\": \"3a2b1c0d-9e8f-4a7b-8c6d-5e4f3a2b1c0d\",\n \"item_kind\": \"product\",\n \"item_id\": \"153cfbff-3d44-4501-9e45-7e7bf1ab130e\",\n \"quantity\": 1,\n \"cadence\": \"monthly\",\n \"payment_method_id\": \"9e8f7a6b-5c4d-3e2f-1a0b-9c8d7e6f5a4b\"\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://vitarelay.com/api/public/v1/subscriptions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"patient_id\": \"3a2b1c0d-9e8f-4a7b-8c6d-5e4f3a2b1c0d\",\n \"item_kind\": \"product\",\n \"item_id\": \"153cfbff-3d44-4501-9e45-7e7bf1ab130e\",\n \"quantity\": 1,\n \"cadence\": \"monthly\",\n \"payment_method_id\": \"9e8f7a6b-5c4d-3e2f-1a0b-9c8d7e6f5a4b\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://vitarelay.com/api/public/v1/subscriptions")
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 \"patient_id\": \"3a2b1c0d-9e8f-4a7b-8c6d-5e4f3a2b1c0d\",\n \"item_kind\": \"product\",\n \"item_id\": \"153cfbff-3d44-4501-9e45-7e7bf1ab130e\",\n \"quantity\": 1,\n \"cadence\": \"monthly\",\n \"payment_method_id\": \"9e8f7a6b-5c4d-3e2f-1a0b-9c8d7e6f5a4b\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"subscription_id": "0f1f2c9e-2f30-4a1b-8b1c-6f4e9a0c1d22",
"order_id": null,
"status": "active",
"next_charge_at": "2026-10-25T04:06:14Z"
}
}{
"error": {
"code": "validation_failed",
"message": "One or more fields are invalid"
}
}{
"error": {
"code": "validation_failed",
"message": "One or more fields are invalid"
}
}{
"error": {
"code": "validation_failed",
"message": "One or more fields are invalid"
}
}Authorizations
API key issued by VitaRelay. Send as Authorization: Bearer vr_live_…
(production) or Authorization: Bearer vr_test_… (sandbox).
Body
application/json
Available options:
product, custom, bundle Available options:
weekly, monthly, quarterly Required range:
1 <= x <= 99Response
Subscription created.

