Place a wholesale order directly (self-serve checkout)
Places a wholesale order for an approved buyer directly, without the request-for-quote round-trip — the self-serve path for routine reorders at the buyer’s own agreed prices.
Send only the items and quantities; Galactic Core prices every line itself against the buyer’s wholesale price list (per-buyer, group, or default), enforces each item’s minimum order quantity, and computes the authoritative totals. Any price sent by the client is ignored. An item with no wholesale price for this buyer, or a quantity below its minimum order quantity, is rejected with a clear reason.
The currency comes from the price list the buyer is on and cannot be chosen per order, so a buyer on a list priced in one currency is always billed in it.
How the order settles depends on the supplier’s policy for this buyer:
- On terms — the order is confirmed and a terms invoice is issued (subject to the buyer’s credit limit). The response carries the invoice and its due date.
- Pay now — the order is created awaiting payment. The response carries an
order_idandamount; complete the payment through the standard payment flow (/v1/payments/initializethen/v1/payments/verify) with thatorder_id, exactly as for a normal online order.
Requires the buyer’s session token (x-auth-token or x-external-auth), an Idempotency-Key, and a request signature (X-Timestamp + X-Signature over the body with the store’s signing secret) — the same signing a standard order requires.
curl --request POST \
--url https://api.tybritelabs.com/v1/b2b/orders \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'X-Signature: <x-signature>' \
--header 'X-Timestamp: <x-timestamp>' \
--data '
{
"items": [
{
"variant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quantity": 2
}
],
"note": "<string>",
"shipping_address": "<string>",
"shipping_address_parts": {
"line1": "<string>",
"city": "<string>",
"region": "<string>",
"country": "<string>",
"postal_code": "<string>"
}
}
'import requests
url = "https://api.tybritelabs.com/v1/b2b/orders"
payload = {
"items": [
{
"variant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quantity": 2
}
],
"note": "<string>",
"shipping_address": "<string>",
"shipping_address_parts": {
"line1": "<string>",
"city": "<string>",
"region": "<string>",
"country": "<string>",
"postal_code": "<string>"
}
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"X-Timestamp": "<x-timestamp>",
"X-Signature": "<x-signature>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
'X-Timestamp': '<x-timestamp>',
'X-Signature': '<x-signature>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
items: [{variant_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a', quantity: 2}],
note: '<string>',
shipping_address: '<string>',
shipping_address_parts: {
line1: '<string>',
city: '<string>',
region: '<string>',
country: '<string>',
postal_code: '<string>'
}
})
};
fetch('https://api.tybritelabs.com/v1/b2b/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://api.tybritelabs.com/v1/b2b/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' => [
[
'variant_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'quantity' => 2
]
],
'note' => '<string>',
'shipping_address' => '<string>',
'shipping_address_parts' => [
'line1' => '<string>',
'city' => '<string>',
'region' => '<string>',
'country' => '<string>',
'postal_code' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>",
"X-Signature: <x-signature>",
"X-Timestamp: <x-timestamp>"
],
]);
$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://api.tybritelabs.com/v1/b2b/orders"
payload := strings.NewReader("{\n \"items\": [\n {\n \"variant_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 2\n }\n ],\n \"note\": \"<string>\",\n \"shipping_address\": \"<string>\",\n \"shipping_address_parts\": {\n \"line1\": \"<string>\",\n \"city\": \"<string>\",\n \"region\": \"<string>\",\n \"country\": \"<string>\",\n \"postal_code\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("X-Timestamp", "<x-timestamp>")
req.Header.Add("X-Signature", "<x-signature>")
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://api.tybritelabs.com/v1/b2b/orders")
.header("Idempotency-Key", "<idempotency-key>")
.header("X-Timestamp", "<x-timestamp>")
.header("X-Signature", "<x-signature>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"variant_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 2\n }\n ],\n \"note\": \"<string>\",\n \"shipping_address\": \"<string>\",\n \"shipping_address_parts\": {\n \"line1\": \"<string>\",\n \"city\": \"<string>\",\n \"region\": \"<string>\",\n \"country\": \"<string>\",\n \"postal_code\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tybritelabs.com/v1/b2b/orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["X-Timestamp"] = '<x-timestamp>'
request["X-Signature"] = '<x-signature>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"items\": [\n {\n \"variant_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 2\n }\n ],\n \"note\": \"<string>\",\n \"shipping_address\": \"<string>\",\n \"shipping_address_parts\": {\n \"line1\": \"<string>\",\n \"city\": \"<string>\",\n \"region\": \"<string>\",\n \"country\": \"<string>\",\n \"postal_code\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"settlement": "terms",
"purchase_order_id": "5a566f3d-1798-461a-926f-4c38602965ce",
"po_number": "PO-20260711-ce9be3",
"invoice_id": "f5199e4a-2f22-4970-a536-bb40068c4518",
"invoice_number": "INV-20260711-29fad5",
"due_date": "2026-08-10",
"total": 100,
"tax_amount": 0,
"currency": "USD"
}
}Authorizations
API Key Authentication
Use your API key in the Authorization header:
Authorization: Bearer tybrite_sk_live_YOUR_KEY
Key Types:
Secret Keys (Server-Side Only):
- Format:
tybrite_sk_live_*(production) ortybrite_sk_test_*(sandbox) - Full read/write access to all endpoints
- ⚠️ NEVER expose in client-side code or public repositories
- Required for: every write a shopper does not make for themselves, authentication, payment verification, AI recommendations
Publishable Keys (Client-Safe):
- Format:
tybrite_pk_live_*(production) ortybrite_pk_test_*(sandbox) - Catalogue reads, plus the actions a shopper takes for themselves
- ✅ Safe for client-side JavaScript, mobile apps, and public code
- Allowed for: browsing products, search, CMS content, pricing queries, cart and wishlist, reviews, storefront events, and the Agent API's quotes, cart drafts and checkout intents
Endpoint-Specific Requirements:
- Authentication endpoints (
/v1/auth/*): Secret key required - Payment verification (
POST /v1/payments/verify): Secret key required - AI Recommendations (
POST /v1/recommendations): Secret key required - Semantic Search (
POST /v1/search): Both key types allowed (read-only operation) - Shopper actions (cart, wishlist, reviews, storefront events, Agent API quotes, cart drafts and checkout intents): Both key types allowed
- All other write operations: Secret key required
- All read operations: Both key types allowed
Using a publishable key for restricted operations returns 403 Forbidden.
Headers
Buyer session token (GC-native). Provide this or x-external-auth.
Bring-your-own-auth assertion identifying the buyer. Provide this or x-auth-token.
A raw token from the store's own identity provider (e.g. a Firebase ID token). Galactic Core forwards it to the store's configured Auth verifier, which validates it and returns the identity.
Verification is fail-closed: if the verifier rejects the token or is unreachable, the request is unauthenticated (401). Requires an Auth verifier to be configured for the store. Provide exactly one of x-auth-token, x-external-auth, or x-idp-token.
A unique key so a retried order is not duplicated.
Unix timestamp (milliseconds) used in the request signature. Required — a direct order must be signed, like a standard order. Must be within 5 minutes of the server time.
Base64 HMAC-SHA256 of {X-Timestamp}.{raw JSON body} using the store's signing secret. Required — a direct order must be signed, like a standard order.
Body
The items to order. Prices are resolved by Galactic Core; do not send prices.
Show child attributes
Show child attributes
An optional note on the order.
An optional free-text shipping address for this order.
An optional structured shipping address. When provided, tax is calculated accurately for the destination; otherwise the store's configured rate applies.
Show child attributes
Show child attributes
Response
Order placed. The settlement field is terms (an invoice was issued) or pay_now
(an order awaiting payment). Fields present depend on which. tax_amount is always
resolved server-side; total/amount are tax-inclusive.
The response body for a direct wholesale order. The order itself is under data.
The result of a direct wholesale order. settlement is terms (a terms invoice was issued — invoice_id, invoice_number, and due_date are present) or pay_now (the order awaits payment — order_id, order_number, and amount are present; complete payment through the standard payment flow using order_id). purchase_order_id, po_number, and currency are always present.
Show child attributes
Show child attributes
curl --request POST \
--url https://api.tybritelabs.com/v1/b2b/orders \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'X-Signature: <x-signature>' \
--header 'X-Timestamp: <x-timestamp>' \
--data '
{
"items": [
{
"variant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quantity": 2
}
],
"note": "<string>",
"shipping_address": "<string>",
"shipping_address_parts": {
"line1": "<string>",
"city": "<string>",
"region": "<string>",
"country": "<string>",
"postal_code": "<string>"
}
}
'import requests
url = "https://api.tybritelabs.com/v1/b2b/orders"
payload = {
"items": [
{
"variant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quantity": 2
}
],
"note": "<string>",
"shipping_address": "<string>",
"shipping_address_parts": {
"line1": "<string>",
"city": "<string>",
"region": "<string>",
"country": "<string>",
"postal_code": "<string>"
}
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"X-Timestamp": "<x-timestamp>",
"X-Signature": "<x-signature>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
'X-Timestamp': '<x-timestamp>',
'X-Signature': '<x-signature>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
items: [{variant_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a', quantity: 2}],
note: '<string>',
shipping_address: '<string>',
shipping_address_parts: {
line1: '<string>',
city: '<string>',
region: '<string>',
country: '<string>',
postal_code: '<string>'
}
})
};
fetch('https://api.tybritelabs.com/v1/b2b/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://api.tybritelabs.com/v1/b2b/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' => [
[
'variant_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'quantity' => 2
]
],
'note' => '<string>',
'shipping_address' => '<string>',
'shipping_address_parts' => [
'line1' => '<string>',
'city' => '<string>',
'region' => '<string>',
'country' => '<string>',
'postal_code' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>",
"X-Signature: <x-signature>",
"X-Timestamp: <x-timestamp>"
],
]);
$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://api.tybritelabs.com/v1/b2b/orders"
payload := strings.NewReader("{\n \"items\": [\n {\n \"variant_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 2\n }\n ],\n \"note\": \"<string>\",\n \"shipping_address\": \"<string>\",\n \"shipping_address_parts\": {\n \"line1\": \"<string>\",\n \"city\": \"<string>\",\n \"region\": \"<string>\",\n \"country\": \"<string>\",\n \"postal_code\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("X-Timestamp", "<x-timestamp>")
req.Header.Add("X-Signature", "<x-signature>")
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://api.tybritelabs.com/v1/b2b/orders")
.header("Idempotency-Key", "<idempotency-key>")
.header("X-Timestamp", "<x-timestamp>")
.header("X-Signature", "<x-signature>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"variant_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 2\n }\n ],\n \"note\": \"<string>\",\n \"shipping_address\": \"<string>\",\n \"shipping_address_parts\": {\n \"line1\": \"<string>\",\n \"city\": \"<string>\",\n \"region\": \"<string>\",\n \"country\": \"<string>\",\n \"postal_code\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tybritelabs.com/v1/b2b/orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["X-Timestamp"] = '<x-timestamp>'
request["X-Signature"] = '<x-signature>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"items\": [\n {\n \"variant_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 2\n }\n ],\n \"note\": \"<string>\",\n \"shipping_address\": \"<string>\",\n \"shipping_address_parts\": {\n \"line1\": \"<string>\",\n \"city\": \"<string>\",\n \"region\": \"<string>\",\n \"country\": \"<string>\",\n \"postal_code\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"settlement": "terms",
"purchase_order_id": "5a566f3d-1798-461a-926f-4c38602965ce",
"po_number": "PO-20260711-ce9be3",
"invoice_id": "f5199e4a-2f22-4970-a536-bb40068c4518",
"invoice_number": "INV-20260711-29fad5",
"due_date": "2026-08-10",
"total": 100,
"tax_amount": 0,
"currency": "USD"
}
}
