Entity Credit Transfers
curl --request POST \
--url https://api.nozle.app/api/v1/customers/{customer_id}/entities/{entity_id}/credit-allocations \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.nozle.app/api/v1/customers/{customer_id}/entities/{entity_id}/credit-allocations"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.nozle.app/api/v1/customers/{customer_id}/entities/{entity_id}/credit-allocations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.nozle.app/api/v1/customers/{customer_id}/entities/{entity_id}/credit-allocations"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://api.nozle.app/api/v1/customers/{customer_id}/entities/{entity_id}/credit-allocations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.nozle.app/api/v1/customers/{customer_id}/entities/{entity_id}/credit-allocations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://api.nozle.app/api/v1/customers/{customer_id}/entities/{entity_id}/credit-allocations")
.header("Authorization", "Bearer <token>")
.asString();Product Credits
Entity Credit Transfers
Allocate and return provenance-preserving paid top-up credits
POST
/
customers
/
{customer_id}
/
entities
/
{entity_id}
/
credit-allocations
Entity Credit Transfers
curl --request POST \
--url https://api.nozle.app/api/v1/customers/{customer_id}/entities/{entity_id}/credit-allocations \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.nozle.app/api/v1/customers/{customer_id}/entities/{entity_id}/credit-allocations"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.nozle.app/api/v1/customers/{customer_id}/entities/{entity_id}/credit-allocations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.nozle.app/api/v1/customers/{customer_id}/entities/{entity_id}/credit-allocations"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://api.nozle.app/api/v1/customers/{customer_id}/entities/{entity_id}/credit-allocations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.nozle.app/api/v1/customers/{customer_id}/entities/{entity_id}/credit-allocations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://api.nozle.app/api/v1/customers/{customer_id}/entities/{entity_id}/credit-allocations")
.header("Authorization", "Bearer <token>")
.asString();Auth: secret key with
Return unused allocated value:
Amounts must be positive decimal strings with at most 12 fractional digits. Allocation can draw only from active paid customer top-ups. Deallocation returns unused value to each exact parent source; expiry, priority, payment provenance, and conservation remain enforced by PostgreSQL.
The API is available to authenticated secret-key callers and does not require a deployment allowlist. Tenant isolation, Entity status, Credit System configuration, source eligibility, and available balance are validated for every transfer.
Retry an uncertain response with the same idempotency key and identical payload. Reusing a key with a different customer, Entity, Credit System, direction, or amount returns a conflict.
entity:write when API permissions are enabled. Publishable keys are rejected.
Allocate paid customer top-up value:
POST /customers/workspace_123/entities/user_42/credit-allocations
Authorization: Bearer sk_...
Idempotency-Key: allocate-user-42-100
Content-Type: application/json
{
"credit_system": "ai_credits",
"amount": "100.000000000001"
}
POST /customers/workspace_123/entities/user_42/credit-deallocations
Authorization: Bearer sk_...
Idempotency-Key: deallocate-user-42-25
Content-Type: application/json
{
"credit_system": "ai_credits",
"amount": "25"
}