curl --request POST \
--url https://api.eddy.engineer/admin/credits/reconcile \
--header 'Content-Type: application/json' \
--header 'x-admin-token: <api-key>' \
--data '
{
"day": "<string>",
"from_unix_ms": 123,
"grace_ms": 1,
"to_unix_ms": 123
}
'import requests
url = "https://api.eddy.engineer/admin/credits/reconcile"
payload = {
"day": "<string>",
"from_unix_ms": 123,
"grace_ms": 1,
"to_unix_ms": 123
}
headers = {
"x-admin-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-admin-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({day: '<string>', from_unix_ms: 123, grace_ms: 1, to_unix_ms: 123})
};
fetch('https://api.eddy.engineer/admin/credits/reconcile', 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.eddy.engineer/admin/credits/reconcile",
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([
'day' => '<string>',
'from_unix_ms' => 123,
'grace_ms' => 1,
'to_unix_ms' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-admin-token: <api-key>"
],
]);
$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.eddy.engineer/admin/credits/reconcile"
payload := strings.NewReader("{\n \"day\": \"<string>\",\n \"from_unix_ms\": 123,\n \"grace_ms\": 1,\n \"to_unix_ms\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-admin-token", "<api-key>")
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.eddy.engineer/admin/credits/reconcile")
.header("x-admin-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"day\": \"<string>\",\n \"from_unix_ms\": 123,\n \"grace_ms\": 1,\n \"to_unix_ms\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eddy.engineer/admin/credits/reconcile")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-admin-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"day\": \"<string>\",\n \"from_unix_ms\": 123,\n \"grace_ms\": 1,\n \"to_unix_ms\": 123\n}"
response = http.request(request)
puts response.read_body{
"accounts": [
{
"account": "<string>",
"captures": 123,
"charged_millicredits": 123,
"debits": 123,
"diff_microcredits": 123,
"entries": 123,
"fold_ok": true,
"notes": [
"<string>"
],
"purchase_grants": 123,
"purchased_millicredits": 123,
"status": "ok",
"tolerance_microcredits": 123,
"usage_microcredits": 123,
"usage_rows": 123
}
],
"billing": "off",
"by": "<string>",
"from_unix_ms": 123,
"grace_ms": 123,
"label": "<string>",
"mismatches": 123,
"ok": true,
"payments": {
"checked": true,
"error": "<string>",
"issues": [
{
"account": "<string>",
"granted_millicredits": 123,
"kind": "missing_grant",
"message": "<string>",
"payment": "<string>",
"provider_credits": 123
}
],
"payments": 123,
"provider": "<string>"
},
"ran_at_unix_ms": 123,
"rows_complete": true,
"rows_scanned": 123,
"schema": "ss.reconcile/1",
"to_unix_ms": 123
}{
"error": {
"code": "INVALID_GEOMETRY",
"message": "<string>"
}
}{
"error": {
"code": "INVALID_GEOMETRY",
"message": "<string>"
}
}Reconcile the credits now (CR7)
Reconciles a UTC day (day, default yesterday) or a window (from_unix_ms < to_unix_ms): each account’s served balance against the fold of its entries; the usage the meter priced against the ledger’s debits and captures (within one millicredit of remainder per account, one per settled run, and the rows within grace_ms of either edge, default 10,000) — more priced than charged is missing_debit, more charged is over_charged; and the payment provider’s settled payments against the purchase grants (missing_grant, grant_amount, refused_payment, unknown_payment). Billing off: not_charged; usage rows older than the store keeps: incomplete. A mismatch alarms (the bootstrap org’s admins get reconcile_mismatch) and is never corrected automatically. An instance admin’s.
curl --request POST \
--url https://api.eddy.engineer/admin/credits/reconcile \
--header 'Content-Type: application/json' \
--header 'x-admin-token: <api-key>' \
--data '
{
"day": "<string>",
"from_unix_ms": 123,
"grace_ms": 1,
"to_unix_ms": 123
}
'import requests
url = "https://api.eddy.engineer/admin/credits/reconcile"
payload = {
"day": "<string>",
"from_unix_ms": 123,
"grace_ms": 1,
"to_unix_ms": 123
}
headers = {
"x-admin-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-admin-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({day: '<string>', from_unix_ms: 123, grace_ms: 1, to_unix_ms: 123})
};
fetch('https://api.eddy.engineer/admin/credits/reconcile', 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.eddy.engineer/admin/credits/reconcile",
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([
'day' => '<string>',
'from_unix_ms' => 123,
'grace_ms' => 1,
'to_unix_ms' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-admin-token: <api-key>"
],
]);
$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.eddy.engineer/admin/credits/reconcile"
payload := strings.NewReader("{\n \"day\": \"<string>\",\n \"from_unix_ms\": 123,\n \"grace_ms\": 1,\n \"to_unix_ms\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-admin-token", "<api-key>")
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.eddy.engineer/admin/credits/reconcile")
.header("x-admin-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"day\": \"<string>\",\n \"from_unix_ms\": 123,\n \"grace_ms\": 1,\n \"to_unix_ms\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eddy.engineer/admin/credits/reconcile")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-admin-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"day\": \"<string>\",\n \"from_unix_ms\": 123,\n \"grace_ms\": 1,\n \"to_unix_ms\": 123\n}"
response = http.request(request)
puts response.read_body{
"accounts": [
{
"account": "<string>",
"captures": 123,
"charged_millicredits": 123,
"debits": 123,
"diff_microcredits": 123,
"entries": 123,
"fold_ok": true,
"notes": [
"<string>"
],
"purchase_grants": 123,
"purchased_millicredits": 123,
"status": "ok",
"tolerance_microcredits": 123,
"usage_microcredits": 123,
"usage_rows": 123
}
],
"billing": "off",
"by": "<string>",
"from_unix_ms": 123,
"grace_ms": 123,
"label": "<string>",
"mismatches": 123,
"ok": true,
"payments": {
"checked": true,
"error": "<string>",
"issues": [
{
"account": "<string>",
"granted_millicredits": 123,
"kind": "missing_grant",
"message": "<string>",
"payment": "<string>",
"provider_credits": 123
}
],
"payments": 123,
"provider": "<string>"
},
"ran_at_unix_ms": 123,
"rows_complete": true,
"rows_scanned": 123,
"schema": "ss.reconcile/1",
"to_unix_ms": 123
}{
"error": {
"code": "INVALID_GEOMETRY",
"message": "<string>"
}
}{
"error": {
"code": "INVALID_GEOMETRY",
"message": "<string>"
}
}Body
Response
The report
ss.reconcile/1: the window, the billing mode, one check per account (the fold, the usage priced against the ledger's charges, the purchases) and the payment provider's settled payments against the purchase grants.