Replace an invite's product list
curl --request PATCH \
--url https://vitarelay.com/api/public/partner/v1/invites/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"pricing": {
"products": [
{
"product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"price_cents": 2
}
]
}
}
'import requests
url = "https://vitarelay.com/api/public/partner/v1/invites/{id}"
payload = { "pricing": { "products": [
{
"product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"price_cents": 2
}
] } }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
pricing: {
products: [{product_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a', price_cents: 2}]
}
})
};
fetch('https://vitarelay.com/api/public/partner/v1/invites/{id}', 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/invites/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'pricing' => [
'products' => [
[
'product_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'price_cents' => 2
]
]
]
]),
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/invites/{id}"
payload := strings.NewReader("{\n \"pricing\": {\n \"products\": [\n {\n \"product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"price_cents\": 2\n }\n ]\n }\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://vitarelay.com/api/public/partner/v1/invites/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"pricing\": {\n \"products\": [\n {\n \"product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"price_cents\": 2\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://vitarelay.com/api/public/partner/v1/invites/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"pricing\": {\n \"products\": [\n {\n \"product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"price_cents\": 2\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "clinic",
"status": "pending",
"prefilled": true,
"crm": {},
"invite_code": "<string>",
"invite_url": "<string>",
"email": "<string>",
"phone": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"product_types": [
"<string>"
],
"external_invite_id": "<string>",
"accepted_org_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"accepted_at": "2023-11-07T05:31:56Z",
"account_status": "pending",
"on_behalf_of": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"pricing": {
"mode": "commission",
"category_markup_pct": {},
"product_markups": {}
},
"expires_at": "2023-11-07T05:31:56Z",
"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>"
}
}Invites
Replace an invite's product list
Replaces the invite’s own product list (pricing.products). On a pending invite it changes what the practice gets when it signs up. On an accepted invite it is applied to the practice’s account right away, so it then sees only this list at these prices; this is how a list reaches a practice that already joined. Prices cannot be below VitaRelay’s price. Needs invites:write and “set my own pricing” enabled on your account. 409 invite_expired for an expired invite.
PATCH
/
invites
/
{id}
Replace an invite's product list
curl --request PATCH \
--url https://vitarelay.com/api/public/partner/v1/invites/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"pricing": {
"products": [
{
"product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"price_cents": 2
}
]
}
}
'import requests
url = "https://vitarelay.com/api/public/partner/v1/invites/{id}"
payload = { "pricing": { "products": [
{
"product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"price_cents": 2
}
] } }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
pricing: {
products: [{product_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a', price_cents: 2}]
}
})
};
fetch('https://vitarelay.com/api/public/partner/v1/invites/{id}', 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/invites/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'pricing' => [
'products' => [
[
'product_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'price_cents' => 2
]
]
]
]),
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/invites/{id}"
payload := strings.NewReader("{\n \"pricing\": {\n \"products\": [\n {\n \"product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"price_cents\": 2\n }\n ]\n }\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://vitarelay.com/api/public/partner/v1/invites/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"pricing\": {\n \"products\": [\n {\n \"product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"price_cents\": 2\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://vitarelay.com/api/public/partner/v1/invites/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"pricing\": {\n \"products\": [\n {\n \"product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"price_cents\": 2\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "clinic",
"status": "pending",
"prefilled": true,
"crm": {},
"invite_code": "<string>",
"invite_url": "<string>",
"email": "<string>",
"phone": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"product_types": [
"<string>"
],
"external_invite_id": "<string>",
"accepted_org_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"accepted_at": "2023-11-07T05:31:56Z",
"account_status": "pending",
"on_behalf_of": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"pricing": {
"mode": "commission",
"category_markup_pct": {},
"product_markups": {}
},
"expires_at": "2023-11-07T05:31:56Z",
"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>"
}
}
