Create or update a bundle
curl --request PUT \
--url https://vitarelay.com/api/public/v1/shop/bundles \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"items": [
{
"platform_product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"qty": 1
}
],
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"image_url": "<string>",
"flat_price_cents": 123,
"package_markup_value": 1,
"is_listed": true,
"is_subscribable": true,
"first_order_immediate": true
}
'import requests
url = "https://vitarelay.com/api/public/v1/shop/bundles"
payload = {
"name": "<string>",
"items": [
{
"platform_product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"qty": 1
}
],
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"image_url": "<string>",
"flat_price_cents": 123,
"package_markup_value": 1,
"is_listed": True,
"is_subscribable": True,
"first_order_immediate": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
items: [{platform_product_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a', qty: 1}],
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
description: '<string>',
image_url: '<string>',
flat_price_cents: 123,
package_markup_value: 1,
is_listed: true,
is_subscribable: true,
first_order_immediate: true
})
};
fetch('https://vitarelay.com/api/public/v1/shop/bundles', 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/shop/bundles",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'items' => [
[
'platform_product_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'qty' => 1
]
],
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'description' => '<string>',
'image_url' => '<string>',
'flat_price_cents' => 123,
'package_markup_value' => 1,
'is_listed' => true,
'is_subscribable' => true,
'first_order_immediate' => true
]),
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/shop/bundles"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"items\": [\n {\n \"platform_product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"qty\": 1\n }\n ],\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"description\": \"<string>\",\n \"image_url\": \"<string>\",\n \"flat_price_cents\": 123,\n \"package_markup_value\": 1,\n \"is_listed\": true,\n \"is_subscribable\": true,\n \"first_order_immediate\": true\n}")
req, _ := http.NewRequest("PUT", 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.put("https://vitarelay.com/api/public/v1/shop/bundles")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"items\": [\n {\n \"platform_product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"qty\": 1\n }\n ],\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"description\": \"<string>\",\n \"image_url\": \"<string>\",\n \"flat_price_cents\": 123,\n \"package_markup_value\": 1,\n \"is_listed\": true,\n \"is_subscribable\": true,\n \"first_order_immediate\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://vitarelay.com/api/public/v1/shop/bundles")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"items\": [\n {\n \"platform_product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"qty\": 1\n }\n ],\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"description\": \"<string>\",\n \"image_url\": \"<string>\",\n \"flat_price_cents\": 123,\n \"package_markup_value\": 1,\n \"is_listed\": true,\n \"is_subscribable\": true,\n \"first_order_immediate\": true\n}"
response = http.request(request)
puts response.read_body{
"bundle": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"image_url": "<string>",
"pricing_mode": "sum",
"flat_price_cents": 123,
"package_markup_type": "percent",
"package_markup_value": 123,
"is_listed": true,
"is_subscribable": true,
"purchase_mode": "one_time",
"default_cadence": "weekly",
"first_order_immediate": true,
"items": [
{
"platform_product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"qty": 1,
"name": "<string>",
"product_type": "<string>"
}
],
"item_kind": "bundle",
"patient_price_cents": 123,
"available_cadences": [
"<string>"
],
"requires_prescription": true,
"requires_shipping": true,
"rx_mode": "<string>",
"eligible": true
}
}{
"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"
}
}{
"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"
}
}{
"error": {
"code": "validation_failed",
"message": "One or more fields are invalid"
}
}Storefront
Create or update a bundle
Creates a bundle when id is omitted, updates it when supplied. Every bundle member must already be a listed product in your storefront. Requires shop:write.
PUT
/
shop
/
bundles
Create or update a bundle
curl --request PUT \
--url https://vitarelay.com/api/public/v1/shop/bundles \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"items": [
{
"platform_product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"qty": 1
}
],
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"image_url": "<string>",
"flat_price_cents": 123,
"package_markup_value": 1,
"is_listed": true,
"is_subscribable": true,
"first_order_immediate": true
}
'import requests
url = "https://vitarelay.com/api/public/v1/shop/bundles"
payload = {
"name": "<string>",
"items": [
{
"platform_product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"qty": 1
}
],
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"image_url": "<string>",
"flat_price_cents": 123,
"package_markup_value": 1,
"is_listed": True,
"is_subscribable": True,
"first_order_immediate": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
items: [{platform_product_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a', qty: 1}],
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
description: '<string>',
image_url: '<string>',
flat_price_cents: 123,
package_markup_value: 1,
is_listed: true,
is_subscribable: true,
first_order_immediate: true
})
};
fetch('https://vitarelay.com/api/public/v1/shop/bundles', 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/shop/bundles",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'items' => [
[
'platform_product_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'qty' => 1
]
],
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'description' => '<string>',
'image_url' => '<string>',
'flat_price_cents' => 123,
'package_markup_value' => 1,
'is_listed' => true,
'is_subscribable' => true,
'first_order_immediate' => true
]),
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/shop/bundles"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"items\": [\n {\n \"platform_product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"qty\": 1\n }\n ],\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"description\": \"<string>\",\n \"image_url\": \"<string>\",\n \"flat_price_cents\": 123,\n \"package_markup_value\": 1,\n \"is_listed\": true,\n \"is_subscribable\": true,\n \"first_order_immediate\": true\n}")
req, _ := http.NewRequest("PUT", 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.put("https://vitarelay.com/api/public/v1/shop/bundles")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"items\": [\n {\n \"platform_product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"qty\": 1\n }\n ],\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"description\": \"<string>\",\n \"image_url\": \"<string>\",\n \"flat_price_cents\": 123,\n \"package_markup_value\": 1,\n \"is_listed\": true,\n \"is_subscribable\": true,\n \"first_order_immediate\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://vitarelay.com/api/public/v1/shop/bundles")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"items\": [\n {\n \"platform_product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"qty\": 1\n }\n ],\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"description\": \"<string>\",\n \"image_url\": \"<string>\",\n \"flat_price_cents\": 123,\n \"package_markup_value\": 1,\n \"is_listed\": true,\n \"is_subscribable\": true,\n \"first_order_immediate\": true\n}"
response = http.request(request)
puts response.read_body{
"bundle": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"image_url": "<string>",
"pricing_mode": "sum",
"flat_price_cents": 123,
"package_markup_type": "percent",
"package_markup_value": 123,
"is_listed": true,
"is_subscribable": true,
"purchase_mode": "one_time",
"default_cadence": "weekly",
"first_order_immediate": true,
"items": [
{
"platform_product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"qty": 1,
"name": "<string>",
"product_type": "<string>"
}
],
"item_kind": "bundle",
"patient_price_cents": 123,
"available_cadences": [
"<string>"
],
"requires_prescription": true,
"requires_shipping": true,
"rx_mode": "<string>",
"eligible": true
}
}{
"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"
}
}{
"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"
}
}{
"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:
sum, flat, package_markup Minimum array length:
1Show child attributes
Show child attributes
Required and must be above zero when pricing_mode is flat.
Available options:
percent, flat, null Required range:
x >= 0Legacy alias. Prefer purchase_mode.
Controls whether checkout permits one-time purchases, subscriptions, or both.
Available options:
one_time, subscription, both Required when is_subscribable is true.
Available options:
weekly, monthly, quarterly, null Response
The created or updated bundle.
A multi-product package, optionally subscribable.
Show child attributes
Show child attributes

