Wallet
GET/v1/wallet
需要 API Key成功 200
参数
| 名称 | 类型 | 说明 |
|---|---|---|
X-Project-IDheader | string | 要操作的项目;省略时使用默认项目; 可为 null |
返回 200 application/json
| 名称 | 类型 | 说明 |
|---|---|---|
balance_cents必填 | integer | |
held_cents必填 | integer | Reserved for videos in production; released or charged when each one ends |
available_cents必填 | integer | |
low_balance_cents必填 | integer | 可为 null |
currency必填 | string | Always HKD: every amount is in Hong Kong dollar cents |
organization_id必填 | string | |
mock_left_cents | integer | Demo payments only: how much more demo credit this organization can top up in total; absent when payments are real; 可为 null |
示例
curl "https://axiomlab.online/v1/wallet" \ -H "Authorization: Bearer $AZIMO_API_KEY"
Wallet Entries
GET/v1/wallet/entries
需要 API Key成功 200
参数
| 名称 | 类型 | 说明 |
|---|---|---|
afterquery | string | 长度 ≤ 64; 可为 null |
limitquery | integer | 默认 50; 范围 1–200 |
X-Project-IDheader | string | 要操作的项目;省略时使用默认项目; 可为 null |
返回 200 application/json
| 名称 | 类型 | 说明 |
|---|---|---|
data必填 | array<object> | |
data[].id必填 | string | |
data[].organization_id必填 | string | |
data[].kind必填 | string | |
data[].amount_cents必填 | integer | |
data[].hold_cents必填 | integer | |
data[].job_id必填 | string | 可为 null |
data[].note必填 | string | 可为 null |
data[].actor必填 | string | 可为 null |
data[].created_at必填 | number | |
data[].currency必填 | string | Unit of amount_cents and hold_cents: HKD, or USD for entries written before the wallet switched to HKD (the switch itself is an adjust entry whose note states the conversion rate) |
next_cursor | string | Opaque; pass as cursor (or the after alias) for the next page; 可为 null |
has_more | boolean | 默认 false |
示例
curl "https://axiomlab.online/v1/wallet/entries" \ -H "Authorization: Bearer $AZIMO_API_KEY"
Checkout
POST/v1/wallet/checkout
需要 API Key成功 201
参数
| 名称 | 类型 | 说明 |
|---|---|---|
Idempotency-Key必填header | string | 调用方生成并保存的唯一值;超时重试时复用它,同一请求不会被执行两次; 长度 1–128 |
X-Project-IDheader | string | 要操作的项目;省略时使用默认项目; 可为 null |
请求体 application/json
| 名称 | 类型 | 说明 |
|---|---|---|
amount_cents必填 | integer | HKD cents, HK$20–HK$100,000; 范围 2000–10000000 |
返回 201 application/json
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | string | |
url必填 | string | |
amount_cents必填 | integer | HKD cents credited to the wallet once paid |
currency | string | 默认 HKD |
charge_currency | string | Currency Stripe charges: HKD, the wallet's own currency; 默认 HKD |
charge_amount | integer | Amount Stripe charges, in charge_currency cents (equal to amount_cents); 默认 0 |
示例
curl -X POST "https://axiomlab.online/v1/wallet/checkout" \
-H "Authorization: Bearer $AZIMO_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"amount_cents": 2000}'Usage
GET/v1/usage
需要 API Key成功 200
The amount billed to this project's wallet in [from, to) (default: the last 30 days) and its paid calls and job counts,
grouped on request. group_by=job pages by job id with after.
参数
| 名称 | 类型 | 说明 |
|---|---|---|
fromquery | number | 范围 ≥ 0; 可为 null |
toquery | number | 范围 ≥ 0; 可为 null |
group_byquery | string | 默认 none |
limitquery | integer | 默认 50; 范围 1–200 |
afterquery | string | 长度 ≤ 32; 可为 null |
X-Project-IDheader | string | 要操作的项目;省略时使用默认项目; 可为 null |
返回 200 application/json
| 名称 | 类型 | 说明 |
|---|---|---|
project_id必填 | string | |
range必填 | map<string, number> | |
jobs必填 | map<string, integer> | |
billed_cents必填 | integer | Amount charged to the wallet in the range, in cents of currency |
currency必填 | string | Always HKD |
group_by必填 | string | |
groups必填 | array<object> | 可为 null |
next_cursor必填 | string | 可为 null |
示例
curl "https://axiomlab.online/v1/usage" \ -H "Authorization: Bearer $AZIMO_API_KEY"