Skip to content
Documentation
EN
English简体中文繁體中文
Workspace
GuidesAPI referenceAPI v1
Guide

Traffic and billing

Buy traffic, read balances, and follow wallet activity.

Select an endpoint to edit a request and view its response.

Understand the two balances

Standard traffic is needed for dynamic proxy requests. Optimization traffic is the additional allowance used by optimized dynamic connections. An optimized request consumes both balances.

Read GET/dynamic/account for the current balance snapshots. Standard total_bytes, used_bytes and remaining_bytes come from the same report. A null value marks an unavailable reading. Reports can update at different times.

GET/dynamic/usage reports activity for a selected time range. Use it to analyze usage trends. Read remaining_bytes from GET/dynamic/account for the remaining allowance.

Buy a traffic pack

Read GET/dynamic/config and choose an available pack. Use its ID as pack_id in POST/dynamic/quotes. Check the quote's price before confirming.

Call POST/dynamic/purchases with QUOTE_ID set to the returned quote ID and save one request key:

PURCHASE_REQUEST_KEY=$(uuidgen)

curl --fail-with-body "$MIGO_API_BASE/dynamic/purchases" \
  -H "Authorization: Bearer $MIGO_API_KEY" \
  -H 'Content-Type: application/json' \
  -H "Idempotency-Key: $PURCHASE_REQUEST_KEY" \
  -d "{\"quote_id\":\"$QUOTE_ID\"}"

This action needs write access, dynamic:write and wallet:spend. Follow the purchase with GET/dynamic/purchases/{id}. Traffic becomes available after activation completes.

If the response reports a failed or uncertain activation, keep the purchase ID and contact support. Support will resolve the original purchase using its ID. See errors and retries.

Add money to your wallet

The simplest route is Wallet in your workspace. For an integration, read GET/recharges/config and use the recharge endpoints to create and follow a payment.

Credit appears after payment is confirmed. Payment methods and limits depend on your workspace's configuration.

Review activity

Use GET/wallet/summary for totals and GET/wallet/ledger for posted movements. GET/order-history brings purchase history together. Most lists accept page and page_size; check the endpoint's limits in the reference.