1 USD ≈ 27,000 credits · display only
Reference rate may change over time.
1 USD ≈ 27,000 credits · display only
Reference rate may change over time.
Coming to Gommo platform
This recipe calls /billing/* on a self-hosted Gommo Developer instance (localhost:3001) — not the public Gommo API.
::: warningLegacy path. New integrations should use Gommo credit top-up (POST /billing/payment/create). This recipe requires PayOS keys and merchant GOMMO_ACCESS_TOKEN on the server. :::
Billing lives under /billing/* — separate from generation APIs (jobs, chat, upload).
Requires server env: PayOS keys + GOMMO_ACCESS_TOKEN. Check readiness first.
Invoke-RestMethod "http://localhost:3001/billing/status"Expect payosConfigured: true and merchantReady: true before creating orders.
$packages = Invoke-RestMethod "http://localhost:3001/billing/packages"
$packages.data | Format-Table id, name, amountVnd, credits, bonusPercentPackage ids include basic-member, vip-member, ultra-member, …
/ai/me username in the create body must match the Bearer token owner.
$domain = $env:GOMMO_API_DOMAIN; if (-not $domain) { throw 'Set GOMMO_API_DOMAIN to the user registration domain (dealer)' }
$meBody = "access_token=$env:TOKEN&domain=$domain"
$me = Invoke-RestMethod -Method POST `
-Uri "https://api.gommo.net/ai/me" `
-ContentType "application/x-www-form-urlencoded" `
-Body $meBody
$username = $me.username ?? $me.data.username
Write-Host "username=$username"$h = @{ Authorization = "Bearer $env:TOKEN"; 'Content-Type' = 'application/json' }
$body = @{
username = $username
packageId = 'basic-member'
} | ConvertTo-Json
$order = Invoke-RestMethod -Method POST `
-Uri "http://localhost:3001/billing/topup/create" `
-Headers $h -Body $body
$checkoutUrl = $order.data.url
$orderCode = $order.data.orderCode
Write-Host "Pay: $checkoutUrl"
Write-Host "orderCode=$orderCode"Open url in a browser (PayOS checkout / QR). User completes payment on PayOS.
Webhook PAID → gateway sends Gommo credits automatically. Poll if webhook is not reachable in dev:
Invoke-RestMethod "http://localhost:3001/billing/topup/orders/$orderCode"Statuses: pending → paid → credited (or failed).
Register on my.payos.vn:
POST https://api.yourdomain.com/billing/webhook/payosSet PAYOS_WEBHOOK_URL in server env. See Billing reference.