Wallets & Billing API
Wallet balances, currency conversion, credits, and checkout
Wallets & Billing API
Manage multi-currency wallet balances, convert between currencies, apply promo credits, and complete Stripe checkout flows.
Wallets
List Wallet Balances
GET /v1/billing/walletsReturns balances for all currencies in the project.
curl https://api.fugoku.com/v1/billing/wallets \
-H "X-Fugoku-API-Key: $FUGOKU_API_TOKEN"Get Wallet Balance
GET /v1/billing/wallets/:currencycurl https://api.fugoku.com/v1/billing/wallets/USD \
-H "X-Fugoku-API-Key: $FUGOKU_API_TOKEN"Credit Wallet
POST /v1/billing/wallets/:currency/creditRequest Body:
| Field | Type | Description |
|---|---|---|
amountCents | integer | Amount to credit in cents (must be positive) |
curl -X POST https://api.fugoku.com/v1/billing/wallets/USD/credit \
-H "X-Fugoku-API-Key: $FUGOKU_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: unique-key-123" \
-d '{ "amountCents": 5000 }'Debit Wallet
POST /v1/billing/wallets/:currency/debitcurl -X POST https://api.fugoku.com/v1/billing/wallets/USD/debit \
-H "X-Fugoku-API-Key: $FUGOKU_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "amountCents": 2500 }'Currency Conversion
Convert Amount
POST /v1/billing/convertRequest Body:
| Field | Type | Description |
|---|---|---|
amountCents | integer | Amount to convert in cents |
fromCurrency | string | Source currency code |
toCurrency | string | Target currency code |
Get Exchange Rate
GET /v1/billing/rates/:from/:tocurl https://api.fugoku.com/v1/billing/rates/USD/NGN \
-H "X-Fugoku-API-Key: $FUGOKU_API_TOKEN"Credits
List Credits
GET /v1/billing/creditsAdd Promo Credit
POST /v1/billing/credits/promoRequest Body:
| Field | Type | Description |
|---|---|---|
amountCents | integer | Credit amount in cents |
currency | string | USD or NGN |
description | string | Optional description |
Billing Overview
Get Billing Overview
GET /v1/billing/overviewReturns a summary of wallets, credits, payments, and invoices.
curl https://api.fugoku.com/v1/billing/overview \
-H "X-Fugoku-API-Key: $FUGOKU_API_TOKEN"Response:
{
"data": {
"type": "billing-overview",
"id": "proj-abc123",
"attributes": {
"totalSpendCents": 186200,
"totalCreditsCents": 1000,
"upcomingChargesCents": 12000,
"currency": "USD",
"balances": [
{ "currency": "USD", "balanceCents": 50000 },
{ "currency": "NGN", "balanceCents": 7500000 }
],
"paymentCount": 5,
"creditCount": 1,
"invoiceCount": 2
}
}
}Checkout
Create Setup Intent
POST /v1/billing/checkout/setup-intentCreates a Stripe Setup Intent for collecting payment method details.
Apply Promo Code
POST /v1/billing/checkout/:checkoutId/promoRequest Body:
| Field | Type | Description |
|---|---|---|
code | string | Promo code to apply |
Complete Checkout
POST /v1/billing/checkout/:checkoutId/completeRequest Body:
| Field | Type | Description |
|---|---|---|
paymentMethodId | string | Stripe payment method ID |
setupIntentId | string | Stripe setup intent ID |
Usage
Get Usage Data
GET /v1/billing/usageReturns usage data for billing calculations.
curl https://api.fugoku.com/v1/billing/usage \
-H "X-Fugoku-API-Key: $FUGOKU_API_TOKEN"