curl --request POST \
--url https://vitarelay.com/api/public/partner/v1/wholesale/orders \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quantity": 500,
"price_cents": 123
}
],
"ship_to": {
"first_name": "<string>",
"last_name": "<string>",
"phone": "<string>",
"line1": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"email": "<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/wholesale/orders"
payload = {
"items": [
{
"product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quantity": 500,
"price_cents": 123
}
],
"ship_to": {
"first_name": "<string>",
"last_name": "<string>",
"phone": "<string>",
"line1": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"email": "<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: 500,
price_cents: 123
}
],
ship_to: {
first_name: '<string>',
last_name: '<string>',
phone: '<string>',
line1: '<string>',
city: '<string>',
state: '<string>',
postal_code: '<string>',
email: '<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/wholesale/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/wholesale/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' => 500,
'price_cents' => 123
]
],
'ship_to' => [
'first_name' => '<string>',
'last_name' => '<string>',
'phone' => '<string>',
'line1' => '<string>',
'city' => '<string>',
'state' => '<string>',
'postal_code' => '<string>',
'email' => '<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/wholesale/orders"
payload := strings.NewReader("{\n \"items\": [\n {\n \"product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 500,\n \"price_cents\": 123\n }\n ],\n \"ship_to\": {\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"phone\": \"<string>\",\n \"line1\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"email\": \"<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/wholesale/orders")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 500,\n \"price_cents\": 123\n }\n ],\n \"ship_to\": {\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"phone\": \"<string>\",\n \"line1\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"email\": \"<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/wholesale/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\": 500,\n \"price_cents\": 123\n }\n ],\n \"ship_to\": {\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"phone\": \"<string>\",\n \"line1\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"email\": \"<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,
"ship_to": {
"first_name": "<string>",
"last_name": "<string>",
"email": "<string>",
"phone": "<string>",
"address": {}
},
"items": [
{
"product_id": "<string>",
"name": "<string>",
"quantity": 123,
"unit_price_cents": 123
}
],
"tracking": {
"number": "<string>",
"carrier": "<string>",
"url": "<string>",
"status": "<string>",
"shipped_at": "<string>",
"delivered_at": "<string>"
},
"created_at": "2023-11-07T05:31:56Z"
},
"payment": {
"status": "paid",
"message": "<string>"
},
"checkout": {}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Order for your customer, charged to your card
Place an order that ships to your customer’s address.
Wholesale (no price_cents): VitaRelay charges your default card on file, or the Accept.js card you
send, at the wholesale price (always read from our catalog) and fulfills and ships it.
Your own prices: set price_cents on any line above wholesale. The customer pays your prices through
Accept.js (send opaque_data and billing now, or pay later with POST /wholesale/orders/{id}/pay), and the
difference is yours (your_markup_cents). Your card on file is never charged for these orders.
No patient, customer record or invite is created. You collect from your customer yourself. The buyer must
confirm they are 21+, will use the products for research only, and accept the terms (attestation, all three
true). Send your own external_order_id to make retries safe. A declined card returns the order with
payment.status: failed; nothing ships until it is paid. Needs orders:write.
curl --request POST \
--url https://vitarelay.com/api/public/partner/v1/wholesale/orders \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quantity": 500,
"price_cents": 123
}
],
"ship_to": {
"first_name": "<string>",
"last_name": "<string>",
"phone": "<string>",
"line1": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"email": "<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/wholesale/orders"
payload = {
"items": [
{
"product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quantity": 500,
"price_cents": 123
}
],
"ship_to": {
"first_name": "<string>",
"last_name": "<string>",
"phone": "<string>",
"line1": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"email": "<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: 500,
price_cents: 123
}
],
ship_to: {
first_name: '<string>',
last_name: '<string>',
phone: '<string>',
line1: '<string>',
city: '<string>',
state: '<string>',
postal_code: '<string>',
email: '<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/wholesale/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/wholesale/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' => 500,
'price_cents' => 123
]
],
'ship_to' => [
'first_name' => '<string>',
'last_name' => '<string>',
'phone' => '<string>',
'line1' => '<string>',
'city' => '<string>',
'state' => '<string>',
'postal_code' => '<string>',
'email' => '<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/wholesale/orders"
payload := strings.NewReader("{\n \"items\": [\n {\n \"product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 500,\n \"price_cents\": 123\n }\n ],\n \"ship_to\": {\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"phone\": \"<string>\",\n \"line1\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"email\": \"<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/wholesale/orders")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 500,\n \"price_cents\": 123\n }\n ],\n \"ship_to\": {\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"phone\": \"<string>\",\n \"line1\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"email\": \"<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/wholesale/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\": 500,\n \"price_cents\": 123\n }\n ],\n \"ship_to\": {\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"phone\": \"<string>\",\n \"line1\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"email\": \"<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,
"ship_to": {
"first_name": "<string>",
"last_name": "<string>",
"email": "<string>",
"phone": "<string>",
"address": {}
},
"items": [
{
"product_id": "<string>",
"name": "<string>",
"quantity": 123,
"unit_price_cents": 123
}
],
"tracking": {
"number": "<string>",
"carrier": "<string>",
"url": "<string>",
"status": "<string>",
"shipped_at": "<string>",
"delivered_at": "<string>"
},
"created_at": "2023-11-07T05:31:56Z"
},
"payment": {
"status": "paid",
"message": "<string>"
},
"checkout": {}
}{
"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
ground_rnd, overnight Your own id for the order. Makes the call safe to retry.
128Optional Accept.js token. Send with billing to charge that card instead of your card on file.
Show child attributes
Show child attributes
The card's billing details. Required with opaque_data.
Show child attributes
Show child attributes
Response
A retry of an order already created with this external_order_id.

