curl --request POST \
--url https://api.sellauth.com/v1/customer-dashboard/instant-balance/quote \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"cart": [
[]
],
"currency": "USD",
"affiliate": null,
"attribution": null
}
'import requests
url = "https://api.sellauth.com/v1/customer-dashboard/instant-balance/quote"
payload = {
"cart": [[]],
"currency": "USD",
"affiliate": None,
"attribution": None
}
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({cart: [[]], currency: 'USD', affiliate: null, attribution: null})
};
fetch('https://api.sellauth.com/v1/customer-dashboard/instant-balance/quote', 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.sellauth.com/v1/customer-dashboard/instant-balance/quote",
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([
'cart' => [
[
]
],
'currency' => 'USD',
'affiliate' => null,
'attribution' => null
]),
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://api.sellauth.com/v1/customer-dashboard/instant-balance/quote"
payload := strings.NewReader("{\n \"cart\": [\n []\n ],\n \"currency\": \"USD\",\n \"affiliate\": null,\n \"attribution\": null\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://api.sellauth.com/v1/customer-dashboard/instant-balance/quote")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"cart\": [\n []\n ],\n \"currency\": \"USD\",\n \"affiliate\": null,\n \"attribution\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sellauth.com/v1/customer-dashboard/instant-balance/quote")
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 \"cart\": [\n []\n ],\n \"currency\": \"USD\",\n \"affiliate\": null,\n \"attribution\": null\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"unique_id": "9f2b3c4d5e6f7",
"checkout_url": "https://pay.sellauth.com/invoice/9f2b3c4d5e6f7",
"currency": "USD",
"price": 14.99,
"price_usd": 14.99,
"has_tax_or_fees": false,
"collects_fields_after": false,
"items": [
{
"name": "License Keys - Standard",
"quantity": 1,
"total_price": 14.99
}
],
"balance": 25,
"balance_after": 10.01,
"can_pay": true
}{
"message": "Shop is not available."
}Quote Balance Purchase
Prices a cart against the customer’s store credit and creates the invoice that Pay will charge. Nothing is deducted here. Use can_pay to decide whether to offer the one-click purchase, and pass price_usd back as quoted_total_usd when paying.
curl --request POST \
--url https://api.sellauth.com/v1/customer-dashboard/instant-balance/quote \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"cart": [
[]
],
"currency": "USD",
"affiliate": null,
"attribution": null
}
'import requests
url = "https://api.sellauth.com/v1/customer-dashboard/instant-balance/quote"
payload = {
"cart": [[]],
"currency": "USD",
"affiliate": None,
"attribution": None
}
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({cart: [[]], currency: 'USD', affiliate: null, attribution: null})
};
fetch('https://api.sellauth.com/v1/customer-dashboard/instant-balance/quote', 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.sellauth.com/v1/customer-dashboard/instant-balance/quote",
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([
'cart' => [
[
]
],
'currency' => 'USD',
'affiliate' => null,
'attribution' => null
]),
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://api.sellauth.com/v1/customer-dashboard/instant-balance/quote"
payload := strings.NewReader("{\n \"cart\": [\n []\n ],\n \"currency\": \"USD\",\n \"affiliate\": null,\n \"attribution\": null\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://api.sellauth.com/v1/customer-dashboard/instant-balance/quote")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"cart\": [\n []\n ],\n \"currency\": \"USD\",\n \"affiliate\": null,\n \"attribution\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sellauth.com/v1/customer-dashboard/instant-balance/quote")
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 \"cart\": [\n []\n ],\n \"currency\": \"USD\",\n \"affiliate\": null,\n \"attribution\": null\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"unique_id": "9f2b3c4d5e6f7",
"checkout_url": "https://pay.sellauth.com/invoice/9f2b3c4d5e6f7",
"currency": "USD",
"price": 14.99,
"price_usd": 14.99,
"has_tax_or_fees": false,
"collects_fields_after": false,
"items": [
{
"name": "License Keys - Standard",
"quantity": 1,
"total_price": 14.99
}
],
"balance": 25,
"balance_after": 10.01,
"can_pay": true
}{
"message": "Shop is not available."
}Authorizations
Authenticate with a customer token, minted server-to-server with POST /v1/shops/{shopId}/customers/{customerId}/token and sent as a Bearer token. Reseller API keys are rejected with a 403 here.
Body
The items to price. At least one.
Show child attributes
Show child attributes
[[]]
Three-letter currency code to price in. Defaults to the shop's currency.
"USD"
Affiliate code to credit for the order.
null
Campaign attribution stored on the invoice: utm_source, utm_medium, utm_campaign, utm_term, utm_content, referrer_host (host only), each max 100 characters.
Show child attributes
Show child attributes
null
Response
true
"9f2b3c4d5e6f7"
"https://pay.sellauth.com/invoice/9f2b3c4d5e6f7"
"USD"
14.99
14.99
false
false
Show child attributes
Show child attributes
[
{
"name": "License Keys - Standard",
"quantity": 1,
"total_price": 14.99
}
]
25
10.01
true