Clients
Bill a client
Email your client a payment link. They pay you monthly, and need no Orgo account.
POST
/
v1
/
accounts
/
{id}
/
billing
Bill a client
curl --request POST \
--url https://www.orgo.ai/api/v1/accounts/{id}/billing \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "billing@acme.com",
"price_usd": 250,
"ai_usd": 40,
"setup_fee_usd": 2500
}
'import requests
url = "https://www.orgo.ai/api/v1/accounts/{id}/billing"
payload = {
"email": "billing@acme.com",
"price_usd": 250,
"ai_usd": 40,
"setup_fee_usd": 2500
}
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({email: 'billing@acme.com', price_usd: 250, ai_usd: 40, setup_fee_usd: 2500})
};
fetch('https://www.orgo.ai/api/v1/accounts/{id}/billing', 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://www.orgo.ai/api/v1/accounts/{id}/billing",
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([
'email' => 'billing@acme.com',
'price_usd' => 250,
'ai_usd' => 40,
'setup_fee_usd' => 2500
]),
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://www.orgo.ai/api/v1/accounts/{id}/billing"
payload := strings.NewReader("{\n \"email\": \"billing@acme.com\",\n \"price_usd\": 250,\n \"ai_usd\": 40,\n \"setup_fee_usd\": 2500\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://www.orgo.ai/api/v1/accounts/{id}/billing")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"billing@acme.com\",\n \"price_usd\": 250,\n \"ai_usd\": 40,\n \"setup_fee_usd\": 2500\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.orgo.ai/api/v1/accounts/{id}/billing")
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 \"email\": \"billing@acme.com\",\n \"price_usd\": 250,\n \"ai_usd\": 40,\n \"setup_fee_usd\": 2500\n}"
response = http.request(request)
puts response.read_body{
"billing": {
"status": "sent",
"email": "billing@acme.com",
"price_usd": 250,
"setup_fee_usd": 2500,
"ai_usd": 40,
"payment_link_url": "https://buy.stripe.com/…",
"current_period_end": null,
"ends_at_period_end": false
}
}
The email comes from your business, and checkout carries your business name, logo, and color. Set up payouts once in Settings → Invoicing first.
Orgo keeps the client’s computer cost and any AI amount, and Stripe takes its card fee (2.9% + 30¢). The rest is paid out to you. While they pay, their computers don’t count against your plan, and each paid month adds
ai_usd to your credits and caps their AI at it.
Use your account-wide API key. A client’s own key gets 403 here. See Invoicing.
Path parameters
string
required
The client’s
id.Body
string
required
Where to send the link.
number
required
What they pay each month. At least their computers’ cost.
number
A monthly amount of AI they pay for at cost, as its own line.
number
Charged once, with the first month.
Response
object
As Get billing, with
status sent and the payment_link_url.Example
curl -X POST https://www.orgo.ai/api/v1/accounts/$CLIENT_ID/billing \
-H "Authorization: Bearer $ORGO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"email": "billing@acme.com", "price_usd": 250, "ai_usd": 40, "setup_fee_usd": 2500}'
import os
import requests
client_id = os.environ["CLIENT_ID"]
res = requests.post(
f"https://www.orgo.ai/api/v1/accounts/{client_id}/billing",
headers={"Authorization": f"Bearer {os.environ['ORGO_API_KEY']}"},
json={"email": "billing@acme.com", "price_usd": 250, "ai_usd": 40, "setup_fee_usd": 2500},
)
print(res.json())
const clientId = process.env.CLIENT_ID;
const res = await fetch(`https://www.orgo.ai/api/v1/accounts/${clientId}/billing`, {
method: 'POST',
headers: { Authorization: `Bearer ${process.env.ORGO_API_KEY}`, 'Content-Type': 'application/json' },
body: JSON.stringify({"email": "billing@acme.com", "price_usd": 250, "ai_usd": 40, "setup_fee_usd": 2500}),
});
console.log(await res.json());
Response
{
"billing": {
"status": "sent",
"email": "billing@acme.com",
"price_usd": 250,
"setup_fee_usd": 2500,
"ai_usd": 40,
"payment_link_url": "https://buy.stripe.com/…",
"current_period_end": null,
"ends_at_period_end": false
}
}
Errors
| Status | Body | Meaning |
|---|---|---|
401 | { "error": "Invalid API key" } | No key, or not one of yours. |
403 | { "error": "Use your account-wide API key to manage accounts. Workspace keys can’t." } | A client’s own key, or any key scoped to one workspace. |
403 | { "error": "Invoicing is on every paid plan. Upgrade to use it." } | You’re on the Free plan. code is UPGRADE_REQUIRED. |
400 | { "error": "price_usd is required: what they pay each month." } | Missing price. |
400 | { "error": "Set a price of at least $50, your cost." } | The price doesn’t cover their computers. |
409 | { "error": "Set up payouts first." } | Payouts aren’t set up. |
409 | { "error": "Your client is already paying for this workspace." } | Change the price instead. |
404 | { "error": "Account not found." } | No client with this id is yours. |
409 | { "error": "This account is closed." } | The client is closed. code is ACCOUNT_CLOSED. |
409 | { "error": "This account was transferred to your client." } | The client accepted a transfer and owns it now. code is ACCOUNT_TRANSFERRED. |
Authorizations
API key authentication. Get your key at orgo.ai/workspaces
Path Parameters
The client’s id.
Body
application/json
Response
Created
Show child attributes
Show child attributes
⌘I
Bill a client
curl --request POST \
--url https://www.orgo.ai/api/v1/accounts/{id}/billing \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "billing@acme.com",
"price_usd": 250,
"ai_usd": 40,
"setup_fee_usd": 2500
}
'import requests
url = "https://www.orgo.ai/api/v1/accounts/{id}/billing"
payload = {
"email": "billing@acme.com",
"price_usd": 250,
"ai_usd": 40,
"setup_fee_usd": 2500
}
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({email: 'billing@acme.com', price_usd: 250, ai_usd: 40, setup_fee_usd: 2500})
};
fetch('https://www.orgo.ai/api/v1/accounts/{id}/billing', 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://www.orgo.ai/api/v1/accounts/{id}/billing",
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([
'email' => 'billing@acme.com',
'price_usd' => 250,
'ai_usd' => 40,
'setup_fee_usd' => 2500
]),
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://www.orgo.ai/api/v1/accounts/{id}/billing"
payload := strings.NewReader("{\n \"email\": \"billing@acme.com\",\n \"price_usd\": 250,\n \"ai_usd\": 40,\n \"setup_fee_usd\": 2500\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://www.orgo.ai/api/v1/accounts/{id}/billing")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"billing@acme.com\",\n \"price_usd\": 250,\n \"ai_usd\": 40,\n \"setup_fee_usd\": 2500\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.orgo.ai/api/v1/accounts/{id}/billing")
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 \"email\": \"billing@acme.com\",\n \"price_usd\": 250,\n \"ai_usd\": 40,\n \"setup_fee_usd\": 2500\n}"
response = http.request(request)
puts response.read_body{
"billing": {
"status": "sent",
"email": "billing@acme.com",
"price_usd": 250,
"setup_fee_usd": 2500,
"ai_usd": 40,
"payment_link_url": "https://buy.stripe.com/…",
"current_period_end": null,
"ends_at_period_end": false
}
}