OpenAPI Documentation
OpenAPI Documentation

Get dynamic traffic balance

Get the current caller's cumulative purchased, consumed, and available dynamic traffic.

API information

Item Value
Method GET
Path /open-api/v1/dynamic/traffic/balance
Authentication X-API-Key
Processing Synchronous

Request parameters

This API accepts no query parameters or request body.

Request example

curl --request GET \
  --url 'https://api-test.puraroute.com/gin/open-api/v1/dynamic/traffic/balance' \
  --header 'Accept: application/json' \
  --header 'X-API-Key: <YOUR_API_KEY>'

Response fields

Field Type Nullable Description
purchased_traffic_gb string No Cumulative purchased traffic
consumed_traffic_gb string No Cumulative consumed traffic
expired_traffic_gb string No Cumulative expired traffic
adjusted_traffic_gb string No Cumulative traffic adjustment; may be negative
available_traffic_gb string No Current available traffic
balance_state string No POSITIVE if available traffic is greater than 0; NON_POSITIVE if it is less than or equal to 0
last_calc_time string Yes Most recent calculation time in GMT+8 ISO-8601
update_time string Yes Most recent update time in GMT+8 ISO-8601

Successful response example

{
  "code": 0,
  "msg": "success",
  "data": {
    "purchased_traffic_gb": "100.000000",
    "consumed_traffic_gb": "12.500000",
    "expired_traffic_gb": "5.000000",
    "adjusted_traffic_gb": "0.000000",
    "available_traffic_gb": "82.500000",
    "balance_state": "POSITIVE",
    "last_calc_time": "2026-08-24T15:30:00.000+08:00",
    "update_time": "2026-08-24T15:30:00.000+08:00"
  },
  "next": null
}

Use balance_state for a quick positive-balance check. Read available_traffic_gb when displaying the actual balance.

Possible error codes

code Description
400001 Authentication failed
400009 The request contains unsupported parameters
500000 System processing failed; the request did not complete

On this page

Get dynamic traffic balance