cURL
curl --request GET \
--url https://api.brightdata.com/billing/pmethods \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.brightdata.com/billing/pmethods"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.brightdata.com/billing/pmethods', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.brightdata.com/billing/pmethods",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.brightdata.com/billing/pmethods"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.brightdata.com/billing/pmethods")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.brightdata.com/billing/pmethods")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"pmethods": [
{
"id": "64f0c2a1e4b0a1b2c3d4e5f6",
"type": "ccard",
"primary": true,
"autorecharge_supported": true,
"card": {
"brand": "visa",
"last4": "4242",
"exp_month": 6,
"exp_year": 2028
},
"paypal": {
"email": "jsmith@example.com"
}
}
]
}User authentication is requiredYour API key lacks the required permissions for this action. You can change your token permissions at https://brightdata.com/cp/setting/users<string>Account & status
Get payment methods
Use GET /billing/pmethods in the Bright Data Account Management API to list active, confirmed payment methods and whether each supports auto-recharge.
GET
/
billing
/
pmethods
cURL
curl --request GET \
--url https://api.brightdata.com/billing/pmethods \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.brightdata.com/billing/pmethods"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.brightdata.com/billing/pmethods', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.brightdata.com/billing/pmethods",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.brightdata.com/billing/pmethods"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.brightdata.com/billing/pmethods")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.brightdata.com/billing/pmethods")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"pmethods": [
{
"id": "64f0c2a1e4b0a1b2c3d4e5f6",
"type": "ccard",
"primary": true,
"autorecharge_supported": true,
"card": {
"brand": "visa",
"last4": "4242",
"exp_month": 6,
"exp_year": 2028
},
"paypal": {
"email": "jsmith@example.com"
}
}
]
}User authentication is requiredYour API key lacks the required permissions for this action. You can change your token permissions at https://brightdata.com/cp/setting/users<string>The
The response contains a
The auto-recharge endpoints reject a payment method that does not support auto-recharge with HTTP 400 and
GET /billing/pmethods endpoint returns the active, confirmed payment methods on your Bright Data account. Use the id of a payment method to turn on auto-recharge with Set regular auto-recharge or Set dataset auto-recharge.
Paste your API key into the authorization field. To get an API key, create an account and learn how to generate an API key.
Which API key permission does this endpoint need?
GET /billing/pmethods requires the billing.read permission. API keys with the Admin or Finance permission level have it. Without it, the endpoint returns HTTP 403 with a plain-text message. Manage API key permissions in Account settings.
How do I list my payment methods?
CallGET /billing/pmethods. The endpoint takes no parameters:
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://api.brightdata.com/billing/pmethods"
pmethods array with one entry per payment method.
How is the response structured?
Each entry in thepmethods array describes one payment method:
| Field | Type | Description |
|---|---|---|
id | string | Payment method ID. Pass this value as pmethod_id to the auto-recharge endpoints |
type | string | Payment method type, for example ccard |
primary | boolean | true for the primary payment method of the account |
autorecharge_supported | boolean | true when the API can turn on auto-recharge with this payment method |
card | object | Card payment methods only: brand, last4, exp_month and exp_year |
paypal | object | PayPal payment methods only: email |
Which payment method can I use for auto-recharge?
Use a payment method whereautorecharge_supported is true. To print only those payment methods, filter the response with jq:
curl -s -H "Authorization: Bearer YOUR_API_KEY" \
"https://api.brightdata.com/billing/pmethods" \
| jq '.pmethods[] | select(.autorecharge_supported)'
error_code pmethod_not_supported.
What are the rate limits for the billing endpoints?
The billing endpoints allow 1,000 requests per minute and 5,000 requests per hour. Over the limit, the endpoint returns HTTP 429 with a plain-text body.Related endpoints
- Get auto-recharge settings. Current regular and dataset auto-recharge settings.
- Set regular auto-recharge. Turn regular auto-recharge on or off, or change its amount.
- Total balance. Account balance, credit, prepayment and pending usage costs.
Authorizations
Use your Bright Data API Key as a Bearer token in the Authorization header.
How to authenticate:
- Obtain your API Key from the Bright Data account settings at https://brightdata.com/cp/setting/users
- Include the API Key in the Authorization header of your requests
- Format:
Authorization: Bearer YOUR_API_KEY
Example:
Authorization: Bearer b5648e1096c6442f60a6c4bbbe73f8d2234d3d8324554bd6a7ec8f3f251f07df
Learn how to get your Bright Data API key: https://docs.brightdata.com/api-reference/authentication
Was this page helpful?