Read one settled payment by its id
Reads one settled payment out of the caller's org ledger.
GET /v1/commerce/payments/{id}
| Address | https://api.hanzo.ai/v1/commerce/payments/{id} |
| Method | GET |
| Operation | getPayment |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Reads one settled payment out of the caller's org ledger.
The org scopes the read by construction — the ledger is namespaced to it — so an id belonging to another tenant is simply not found rather than found and then filtered. A ledger row that is not a payment is likewise not found, so this cannot be used to walk the org's usage debits.
A named handler, not a closure, so zipdoc can lift this prose into the registry.
Request
1 field.
| Field | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes | ID is the ledger transaction id a payment returned. |
Response
| Status | Body | Meaning |
|---|---|---|
200 | PaymentRecord | ok |
200 body — 8 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
amountCents | body | integer | — | AmountCents is the credited amount in whole cents. |
createdAt | body | string | — | CreatedAt is when the credit was written, RFC3339. |
currency | body | string | — | Currency is the ISO 4217 code. |
id | body | string | — | ID is the ledger transaction id. |
notes | body | string | — | Notes is the ledger memo, carrying the processor and its reference. |
status | body | string | — | Status is the payment's state. |
subject | body | string | — | Subject is the billing key this payment credited. |
test | body | boolean | — | Test reports whether this was a sandbox charge (test balance) or live money. |
Failure carries the platform error shape — see Errors.
Examples
hanzo has no subcommand for this operation — the CLI serves only what cloud's live route table confirms. Use HTTP or an SDK.
import { Configuration, CommerceApi } from 'hanzoai';
const api = new CommerceApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getPayment({ id: 'id' });from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import CommerceApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = CommerceApi(client).get_payment(id='id')cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.CommerceAPI.GetPayment(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::apis::{configuration::Configuration, commerce_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = commerce_api::get_payment(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.CommerceApi;
ApiClient client = new ApiClient();
client.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + System.getenv("HANZO_API_KEY")));
var result = new CommerceApi(client).getPayment();curl https://api.hanzo.ai/v1/commerce/payments/<id> \
-H "Authorization: Bearer $HANZO_API_KEY"Tool commerce, op getPayment — POST the JSON-RPC envelope to https://api.hanzo.ai/v1/mcp.
curl -X POST https://api.hanzo.ai/v1/mcp \
-H "Authorization: Bearer $HANZO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "commerce",
"arguments": {
"op": "getPayment",
"input": {
"id": "<id>"
}
}
}
}'How is this guide?