curl --request POST \
--url https://vitarelay.com/api/public/partner/v1/store/orders \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quantity": 50
}
],
"customer": {
"email": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"phone": "<string>"
},
"shipping_address": {
"line1": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"line2": "<string>",
"country": "US"
},
"attestation": {
"age_confirmed": true,
"research_use_only": true,
"terms_accepted": true
},
"shipping_method": "ground_rnd",
"external_order_id": "<string>"
}
'import requests
url = "https://vitarelay.com/api/public/partner/v1/store/orders"
payload = {
"items": [
{
"product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quantity": 50
}
],
"customer": {
"email": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"phone": "<string>"
},
"shipping_address": {
"line1": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"line2": "<string>",
"country": "US"
},
"attestation": {
"age_confirmed": True,
"research_use_only": True,
"terms_accepted": True
},
"shipping_method": "ground_rnd",
"external_order_id": "<string>"
}
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({
items: [{product_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a', quantity: 50}],
customer: {
email: '<string>',
first_name: '<string>',
last_name: '<string>',
phone: '<string>'
},
shipping_address: {
line1: '<string>',
city: '<string>',
state: '<string>',
postal_code: '<string>',
line2: '<string>',
country: 'US'
},
attestation: {age_confirmed: true, research_use_only: true, terms_accepted: true},
shipping_method: 'ground_rnd',
external_order_id: '<string>'
})
};
fetch('https://vitarelay.com/api/public/partner/v1/store/orders', 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/partner/v1/store/orders",
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([
'items' => [
[
'product_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'quantity' => 50
]
],
'customer' => [
'email' => '<string>',
'first_name' => '<string>',
'last_name' => '<string>',
'phone' => '<string>'
],
'shipping_address' => [
'line1' => '<string>',
'city' => '<string>',
'state' => '<string>',
'postal_code' => '<string>',
'line2' => '<string>',
'country' => 'US'
],
'attestation' => [
'age_confirmed' => true,
'research_use_only' => true,
'terms_accepted' => true
],
'shipping_method' => 'ground_rnd',
'external_order_id' => '<string>'
]),
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/partner/v1/store/orders"
payload := strings.NewReader("{\n \"items\": [\n {\n \"product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 50\n }\n ],\n \"customer\": {\n \"email\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"phone\": \"<string>\"\n },\n \"shipping_address\": {\n \"line1\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"line2\": \"<string>\",\n \"country\": \"US\"\n },\n \"attestation\": {\n \"age_confirmed\": true,\n \"research_use_only\": true,\n \"terms_accepted\": true\n },\n \"shipping_method\": \"ground_rnd\",\n \"external_order_id\": \"<string>\"\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/partner/v1/store/orders")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 50\n }\n ],\n \"customer\": {\n \"email\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"phone\": \"<string>\"\n },\n \"shipping_address\": {\n \"line1\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"line2\": \"<string>\",\n \"country\": \"US\"\n },\n \"attestation\": {\n \"age_confirmed\": true,\n \"research_use_only\": true,\n \"terms_accepted\": true\n },\n \"shipping_method\": \"ground_rnd\",\n \"external_order_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://vitarelay.com/api/public/partner/v1/store/orders")
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 \"items\": [\n {\n \"product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 50\n }\n ],\n \"customer\": {\n \"email\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"phone\": \"<string>\"\n },\n \"shipping_address\": {\n \"line1\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"line2\": \"<string>\",\n \"country\": \"US\"\n },\n \"attestation\": {\n \"age_confirmed\": true,\n \"research_use_only\": true,\n \"terms_accepted\": true\n },\n \"shipping_method\": \"ground_rnd\",\n \"external_order_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"order_number": "<string>",
"status": "<string>",
"payment_status": "<string>",
"external_order_id": "<string>",
"subtotal_cents": 123,
"shipping_cents": 123,
"tax_cents": 123,
"total_cents": 123,
"currency": "<string>",
"your_markup_cents": 123,
"customer": {
"email": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"phone": "<string>"
},
"ship_to": {},
"items": [
{
"product_id": "<string>",
"name": "<string>",
"quantity": 123,
"unit_price_cents": 123
}
],
"checkout": {
"public_client_key": "<string>",
"api_login_id": "<string>",
"accept_js_url": "<string>",
"environment": "<string>",
"amount_cents": 123
},
"created_at": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Place an order for a customer
Create an order for one of your customers: no patient, intake or prescription is created.
Prices are always read from your store, never from the request. The order is unpaid until you call
POST /store/orders/{id}/pay; the response includes the Accept.js keys (checkout). Send your own
external_order_id to make retries safe. The buyer must confirm they are 21+, will use the
products for research only, and accept the terms (attestation, all three true). Needs store:write.
curl --request POST \
--url https://vitarelay.com/api/public/partner/v1/store/orders \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quantity": 50
}
],
"customer": {
"email": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"phone": "<string>"
},
"shipping_address": {
"line1": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"line2": "<string>",
"country": "US"
},
"attestation": {
"age_confirmed": true,
"research_use_only": true,
"terms_accepted": true
},
"shipping_method": "ground_rnd",
"external_order_id": "<string>"
}
'import requests
url = "https://vitarelay.com/api/public/partner/v1/store/orders"
payload = {
"items": [
{
"product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quantity": 50
}
],
"customer": {
"email": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"phone": "<string>"
},
"shipping_address": {
"line1": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"line2": "<string>",
"country": "US"
},
"attestation": {
"age_confirmed": True,
"research_use_only": True,
"terms_accepted": True
},
"shipping_method": "ground_rnd",
"external_order_id": "<string>"
}
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({
items: [{product_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a', quantity: 50}],
customer: {
email: '<string>',
first_name: '<string>',
last_name: '<string>',
phone: '<string>'
},
shipping_address: {
line1: '<string>',
city: '<string>',
state: '<string>',
postal_code: '<string>',
line2: '<string>',
country: 'US'
},
attestation: {age_confirmed: true, research_use_only: true, terms_accepted: true},
shipping_method: 'ground_rnd',
external_order_id: '<string>'
})
};
fetch('https://vitarelay.com/api/public/partner/v1/store/orders', 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/partner/v1/store/orders",
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([
'items' => [
[
'product_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'quantity' => 50
]
],
'customer' => [
'email' => '<string>',
'first_name' => '<string>',
'last_name' => '<string>',
'phone' => '<string>'
],
'shipping_address' => [
'line1' => '<string>',
'city' => '<string>',
'state' => '<string>',
'postal_code' => '<string>',
'line2' => '<string>',
'country' => 'US'
],
'attestation' => [
'age_confirmed' => true,
'research_use_only' => true,
'terms_accepted' => true
],
'shipping_method' => 'ground_rnd',
'external_order_id' => '<string>'
]),
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/partner/v1/store/orders"
payload := strings.NewReader("{\n \"items\": [\n {\n \"product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 50\n }\n ],\n \"customer\": {\n \"email\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"phone\": \"<string>\"\n },\n \"shipping_address\": {\n \"line1\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"line2\": \"<string>\",\n \"country\": \"US\"\n },\n \"attestation\": {\n \"age_confirmed\": true,\n \"research_use_only\": true,\n \"terms_accepted\": true\n },\n \"shipping_method\": \"ground_rnd\",\n \"external_order_id\": \"<string>\"\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/partner/v1/store/orders")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 50\n }\n ],\n \"customer\": {\n \"email\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"phone\": \"<string>\"\n },\n \"shipping_address\": {\n \"line1\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"line2\": \"<string>\",\n \"country\": \"US\"\n },\n \"attestation\": {\n \"age_confirmed\": true,\n \"research_use_only\": true,\n \"terms_accepted\": true\n },\n \"shipping_method\": \"ground_rnd\",\n \"external_order_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://vitarelay.com/api/public/partner/v1/store/orders")
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 \"items\": [\n {\n \"product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 50\n }\n ],\n \"customer\": {\n \"email\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"phone\": \"<string>\"\n },\n \"shipping_address\": {\n \"line1\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"line2\": \"<string>\",\n \"country\": \"US\"\n },\n \"attestation\": {\n \"age_confirmed\": true,\n \"research_use_only\": true,\n \"terms_accepted\": true\n },\n \"shipping_method\": \"ground_rnd\",\n \"external_order_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"order_number": "<string>",
"status": "<string>",
"payment_status": "<string>",
"external_order_id": "<string>",
"subtotal_cents": 123,
"shipping_cents": 123,
"tax_cents": 123,
"total_cents": 123,
"currency": "<string>",
"your_markup_cents": 123,
"customer": {
"email": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"phone": "<string>"
},
"ship_to": {},
"items": [
{
"product_id": "<string>",
"name": "<string>",
"quantity": 123,
"unit_price_cents": 123
}
],
"checkout": {
"public_client_key": "<string>",
"api_login_id": "<string>",
"accept_js_url": "<string>",
"environment": "<string>",
"amount_cents": 123
},
"created_at": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Authorizations
VitaRelay API key (vr_live_... or vr_test_...) with the invites:* scopes.
Body
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
ground_rnd, overnight Your own id for the order. Makes the call safe to retry.
128Response
A retry of an order already created with this external_order_id.

