Create an invoice
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");curl_easy_setopt(hnd, CURLOPT_URL, "https://api.proxyrequest.com/api/v1/invoices");
struct curl_slist *headers = NULL;headers = curl_slist_append(headers, "Accept-Language: de");headers = curl_slist_append(headers, "Authorization: Bearer <token>");headers = curl_slist_append(headers, "Content-Type: application/json");curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{ \"package_id\": \"550e8400-e29b-41d4-a716-446655440002\", \"data\": 10737418240, \"gateway\": \"stripe\" }");
CURLcode ret = curl_easy_perform(hnd);using System.Net.Http.Headers;var client = new HttpClient();var request = new HttpRequestMessage{ Method = HttpMethod.Post, RequestUri = new Uri("https://api.proxyrequest.com/api/v1/invoices"), Headers = { { "Accept-Language", "de" }, { "Authorization", "Bearer <token>" }, }, Content = new StringContent("{ \"package_id\": \"550e8400-e29b-41d4-a716-446655440002\", \"data\": 10737418240, \"gateway\": \"stripe\" }") { Headers = { ContentType = new MediaTypeHeaderValue("application/json") } }};using (var response = await client.SendAsync(request)){ response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);}package main
import ( "fmt" "strings" "net/http" "io")
func main() {
url := "https://api.proxyrequest.com/api/v1/invoices"
payload := strings.NewReader("{ \"package_id\": \"550e8400-e29b-41d4-a716-446655440002\", \"data\": 10737418240, \"gateway\": \"stripe\" }")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Accept-Language", "de") req.Header.Add("Authorization", "Bearer <token>") req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close() body, _ := io.ReadAll(res.Body)
fmt.Println(res) fmt.Println(string(body))
}HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://api.proxyrequest.com/api/v1/invoices")) .header("Accept-Language", "de") .header("Authorization", "Bearer <token>") .header("Content-Type", "application/json") .method("POST", HttpRequest.BodyPublishers.ofString("{ \"package_id\": \"550e8400-e29b-41d4-a716-446655440002\", \"data\": 10737418240, \"gateway\": \"stripe\" }")) .build();HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());System.out.println(response.body());OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");RequestBody body = RequestBody.create(mediaType, "{ \"package_id\": \"550e8400-e29b-41d4-a716-446655440002\", \"data\": 10737418240, \"gateway\": \"stripe\" }");Request request = new Request.Builder() .url("https://api.proxyrequest.com/api/v1/invoices") .post(body) .addHeader("Accept-Language", "de") .addHeader("Authorization", "Bearer <token>") .addHeader("Content-Type", "application/json") .build();
Response response = client.newCall(request).execute();import axios from 'axios';
const options = { method: 'POST', url: 'https://api.proxyrequest.com/api/v1/invoices', headers: { 'Accept-Language': 'de', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, data: { package_id: '550e8400-e29b-41d4-a716-446655440002', data: 10737418240, gateway: 'stripe' }};
try { const { data } = await axios.request(options); console.log(data);} catch (error) { console.error(error);}const url = 'https://api.proxyrequest.com/api/v1/invoices';const options = { method: 'POST', headers: { 'Accept-Language': 'de', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"package_id":"550e8400-e29b-41d4-a716-446655440002","data":10737418240,"gateway":"stripe"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")val body = RequestBody.create(mediaType, "{ \"package_id\": \"550e8400-e29b-41d4-a716-446655440002\", \"data\": 10737418240, \"gateway\": \"stripe\" }")val request = Request.Builder() .url("https://api.proxyrequest.com/api/v1/invoices") .post(body) .addHeader("Accept-Language", "de") .addHeader("Authorization", "Bearer <token>") .addHeader("Content-Type", "application/json") .build()
val response = client.newCall(request).execute()use serde_json::json;use reqwest;
#[tokio::main]pub async fn main() { let url = "https://api.proxyrequest.com/api/v1/invoices";
let payload = json!({ "package_id": "550e8400-e29b-41d4-a716-446655440002", "data": 10737418240, "gateway": "stripe" });
let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Accept-Language", "de".parse().unwrap()); headers.insert("Authorization", "Bearer <token>".parse().unwrap()); headers.insert("Content-Type", "application/json".parse().unwrap());
let client = reqwest::Client::new(); let response = client.post(url) .headers(headers) .json(&payload) .send() .await;
let results = response.unwrap() .json::<serde_json::Value>() .await .unwrap();
dbg!(results);}curl --request POST \ --url https://api.proxyrequest.com/api/v1/invoices \ --header 'Accept-Language: de' \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "package_id": "550e8400-e29b-41d4-a716-446655440002", "data": 10737418240, "gateway": "stripe" }'wget --quiet \ --method POST \ --header 'Accept-Language: de' \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --body-data '{ "package_id": "550e8400-e29b-41d4-a716-446655440002", "data": 10737418240, "gateway": "stripe" }' \ --output-document \ - https://api.proxyrequest.com/api/v1/invoicesCalculates package pricing and initializes the selected payment provider when required. The status defaults to pending. Only superusers may create an already-paid invoice by setting status to paid; other authenticated users receive a 403 response. For wallet payments, omit status: the invoice is created as pending and becomes paid after the balance is debited successfully. For your own billing system, confirm payment on your backend before sending gateway=manual and status=paid with a superuser credential. Sending user_id also requires is_reseller; omit user_id for a purchase by the caller. Sub-users cannot create invoices themselves. A paid package purchase creates or tops up the recipient’s order for that package. Repeated purchases reuse the order. Finite expiring purchases have separate data ledgers; compatible non-expiring purchases and unlimited packages may reuse a ledger. This is different from assigning a child quota with /users/{id}/data/add. An amount-only invoice tops up money, not data. Persist the invoice ID and use Idempotency-Key for retries. Before delivering access, read the paid invoice and the resulting order: fulfillment can be recovered asynchronously. Accounting webhooks do not include invoice.paid.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Stable key for one logical mutation. Successful responses are replayable for 24 hours; reusing a key with a different request returns 409.
Preferred language for human-readable API errors. Supported languages: en, ru, uk, de, it, fr, es, zh-hans, ja. Regional language tags and quality weights are accepted; unsupported or omitted values use English.
Examples
defr-CA, fr;q=0.9, en;q=0.5Request Bodyrequired
Section titled “Request Bodyrequired”object
Package to purchase. Required for package purchases.
Account receiving the purchase. Omit for your own account. Sending user_id requires is_reseller; a reseller can target its own sub-user, while a superuser with is_reseller can target another account. Do not send your own ID.
crypto- crypto *credit_card- credit_card *wallet- wallet *manual- manual *stripe- stripe *coinbase- coinbase *cryptomus- cryptomus *coingate- coingate *whitepay- whitepay *wayforpay- wayforpay *usegateway- usegateway *binance- binance *anymoney- anymoney *coinpayments- coinpayments *checkoutcom- checkoutcom *nowpayments- nowpayments *btcpay- btcpay *braintree- braintree *monobank- monobank *liqpay- liqpay *iyzico- iyzico *paytr- paytr *payu- payu *tpay- tpay *przelewy24- przelewy24 *gopay- gopay *comgate- comgate *monei- monei *redsys- redsys *payplug- payplug *mollie- mollie *unzer- unzer *payone- payone *nexi_xpay- nexi_xpay *halyk_epay- halyk_epay *kaspi_pay- kaspi_pay *vipps_mobilepay- vipps_mobilepay *paytrail- paytrail
Initial invoice status. Defaults to pending. Only superusers may set paid; other authenticated users receive a 403 response. * pending - pending * paid - paid
ISO 4217 currency charged by a regional fiat provider.
Residential proxy data to purchase, in integer bytes (1 GiB = 1073741824). Required with package_id for a residential purchase. A paid purchase funds the recipient’s order; it is not a virtual allocation from a parent pool.
Number of static proxies to purchase.
Account balance amount to purchase, in the smallest currency unit. Use for a wallet top-up without package_id, not for buying proxy data.
Optional future expiration as a Unix timestamp in seconds, not milliseconds. Otherwise a positive package billing cycle determines the purchased data’s expiration from the payment date; a zero cycle has no automatic expiration. A later purchase does not extend earlier finite, expiring ledgers.
Examples
Purchase residential data
{ "package_id": "550e8400-e29b-41d4-a716-446655440002", "data": 10737418240, "gateway": "stripe"}Create an already-paid invoice (superuser only)
{ "user_id": "550e8400-e29b-41d4-a716-446655440001", "package_id": "550e8400-e29b-41d4-a716-446655440002", "data": 10737418240, "gateway": "manual", "status": "paid"}Purchase using an existing wallet balance
{ "package_id": "550e8400-e29b-41d4-a716-446655440002", "data": 10737418240, "gateway": "wallet"}Top up money, not proxy data
{ "amount": 2500, "gateway": "stripe"}object
Package to purchase. Required for package purchases.
Account receiving the purchase. Omit for your own account. Sending user_id requires is_reseller; a reseller can target its own sub-user, while a superuser with is_reseller can target another account. Do not send your own ID.
crypto- crypto *credit_card- credit_card *wallet- wallet *manual- manual *stripe- stripe *coinbase- coinbase *cryptomus- cryptomus *coingate- coingate *whitepay- whitepay *wayforpay- wayforpay *usegateway- usegateway *binance- binance *anymoney- anymoney *coinpayments- coinpayments *checkoutcom- checkoutcom *nowpayments- nowpayments *btcpay- btcpay *braintree- braintree *monobank- monobank *liqpay- liqpay *iyzico- iyzico *paytr- paytr *payu- payu *tpay- tpay *przelewy24- przelewy24 *gopay- gopay *comgate- comgate *monei- monei *redsys- redsys *payplug- payplug *mollie- mollie *unzer- unzer *payone- payone *nexi_xpay- nexi_xpay *halyk_epay- halyk_epay *kaspi_pay- kaspi_pay *vipps_mobilepay- vipps_mobilepay *paytrail- paytrail
Initial invoice status. Defaults to pending. Only superusers may set paid; other authenticated users receive a 403 response. * pending - pending * paid - paid
ISO 4217 currency charged by a regional fiat provider.
Residential proxy data to purchase, in integer bytes (1 GiB = 1073741824). Required with package_id for a residential purchase. A paid purchase funds the recipient’s order; it is not a virtual allocation from a parent pool.
Number of static proxies to purchase.
Account balance amount to purchase, in the smallest currency unit. Use for a wallet top-up without package_id, not for buying proxy data.
Optional future expiration as a Unix timestamp in seconds, not milliseconds. Otherwise a positive package billing cycle determines the purchased data’s expiration from the payment date; a zero cycle has no automatic expiration. A later purchase does not extend earlier finite, expiring ledgers.
Examples
Purchase residential data
package_id=550e8400-e29b-41d4-a716-446655440002&data=10737418240&gateway=stripeCreate an already-paid invoice (superuser only)
user_id=550e8400-e29b-41d4-a716-446655440001&package_id=550e8400-e29b-41d4-a716-446655440002&data=10737418240&gateway=manual&status=paidPurchase using an existing wallet balance
package_id=550e8400-e29b-41d4-a716-446655440002&data=10737418240&gateway=walletTop up money, not proxy data
amount=2500&gateway=stripeobject
Package to purchase. Required for package purchases.
Account receiving the purchase. Omit for your own account. Sending user_id requires is_reseller; a reseller can target its own sub-user, while a superuser with is_reseller can target another account. Do not send your own ID.
crypto- crypto *credit_card- credit_card *wallet- wallet *manual- manual *stripe- stripe *coinbase- coinbase *cryptomus- cryptomus *coingate- coingate *whitepay- whitepay *wayforpay- wayforpay *usegateway- usegateway *binance- binance *anymoney- anymoney *coinpayments- coinpayments *checkoutcom- checkoutcom *nowpayments- nowpayments *btcpay- btcpay *braintree- braintree *monobank- monobank *liqpay- liqpay *iyzico- iyzico *paytr- paytr *payu- payu *tpay- tpay *przelewy24- przelewy24 *gopay- gopay *comgate- comgate *monei- monei *redsys- redsys *payplug- payplug *mollie- mollie *unzer- unzer *payone- payone *nexi_xpay- nexi_xpay *halyk_epay- halyk_epay *kaspi_pay- kaspi_pay *vipps_mobilepay- vipps_mobilepay *paytrail- paytrail
Initial invoice status. Defaults to pending. Only superusers may set paid; other authenticated users receive a 403 response. * pending - pending * paid - paid
ISO 4217 currency charged by a regional fiat provider.
Residential proxy data to purchase, in integer bytes (1 GiB = 1073741824). Required with package_id for a residential purchase. A paid purchase funds the recipient’s order; it is not a virtual allocation from a parent pool.
Number of static proxies to purchase.
Account balance amount to purchase, in the smallest currency unit. Use for a wallet top-up without package_id, not for buying proxy data.
Optional future expiration as a Unix timestamp in seconds, not milliseconds. Otherwise a positive package billing cycle determines the purchased data’s expiration from the payment date; a zero cycle has no automatic expiration. A later purchase does not extend earlier finite, expiring ledgers.
Examples
Purchase residential data
{ "package_id": "550e8400-e29b-41d4-a716-446655440002", "data": 10737418240, "gateway": "stripe"}Create an already-paid invoice (superuser only)
{ "user_id": "550e8400-e29b-41d4-a716-446655440001", "package_id": "550e8400-e29b-41d4-a716-446655440002", "data": 10737418240, "gateway": "manual", "status": "paid"}Purchase using an existing wallet balance
{ "package_id": "550e8400-e29b-41d4-a716-446655440002", "data": 10737418240, "gateway": "wallet"}Top up money, not proxy data
{ "amount": 2500, "gateway": "stripe"}Responses
Section titled “Responses”The resource or action result was created successfully.
object
object
Unique display name for this package shown to customers and in the admin. Residential Starter Business Pro
Lowercase alphanumeric identifier used internally for package resolution and proxy username routing. Cannot be changed without affecting active connections. residential01 bizpro
When enabled, users on this package have no data cap. The proxy will not enforce any bandwidth limit.
object
object
Two-letter ISO 3166-1 alpha-2 country code. Must be unique. us de fr
English display name of the country used across the admin and API responses.
Native-language name of the country as it appears in the source data. Deutschland Français
object
object
object
object
Arbitrary coupon value
Leaving this field empty will generate a random code.
If true, coupon can be used multiple times.
If true, coupon can not be used for one-time package tiers.
free_data- Free Data *monetary- Money *percentage- Percentage
Number of times coupon can be used
Leave empty for coupons that never expire
The marketer who owns this coupon. Required if is_marketer is true.
The user who created this coupon.
The type of invoice, indicating the type of proxy service. Options include: RESIDENTIAL: Residential proxies. STATIC: Static proxies. * static - Static * residential - Residential * balance - Balance
Whether this pricing tier is restricted to a one-time purchase. False does not create a recurring subscription or a renewal schedule.
Indicates whether this invoice is a payout to the marketer. Default is False.
A unique identifier for the invoice, generated automatically.
Payment state. A paid package invoice funds an order; a paid balance invoice credits money. Confirm the resulting order before delivering access, because fulfillment can recover asynchronously. Creating an invoice with status=paid requires a superuser. This read field is not a public status-update or refund endpoint. * pending - Pending * paid - Paid * unpaid - Unpaid * error - Error
A description of the invoice. This field is optional and can be left blank.
The maximum number of concurrent connections allowed for this package.
The number of proxies to assign.
The amount of data in bytes.
The balance to top up for the user. Must be zero or positive.
The total price of the invoice, including any discounts. Must be at least 1 cent.
The payment gateway used for processing the payment. * coinbase - Coinbase * cryptomus - Cryptomus * stripe - Stripe * coingate - Coingate * wallet - Wallet * manual - Manual * whitepay - Whitepay * wayforpay - WayForPay * usegateway - UseGateway * binance - Binance Pay * anymoney - Any.Money * coinpayments - CoinPayments * checkoutcom - Checkout.com * nowpayments - NOWPayments * btcpay - BTCPay Server * braintree - Braintree * monobank - monobank * liqpay - LiqPay * iyzico - iyzico * paytr - PayTR * payu - PayU * tpay - Tpay * przelewy24 - Przelewy24 * gopay - GoPay * comgate - Comgate * monei - MONEI * redsys - Redsys * payplug - PayPlug * mollie - Mollie * unzer - Unzer * payone - PAYONE * nexi_xpay - Nexi XPay * halyk_epay - Halyk ePay * kaspi_pay - Kaspi Pay * vipps_mobilepay - Vipps MobilePay * paytrail - Paytrail
The URL for making the payment. Optional field with a maximum length of 500 characters.
ISO 4217 currency captured when the invoice is created.
Provider-side hosted checkout identifier used for reconciliation.
Provider-side payment or transaction identifier used for reconciliation.
not_required- Not required *initializing- Initializing *ready- Ready *failed- Failed
The VAT percentage applied to the invoice. Must be between 0 and 100.
The date and time when the invoice was paid.
Examples
Pending residential purchase
{ "id": "550e8400-e29b-41d4-a716-446655440004", "user_id": "550e8400-e29b-41d4-a716-446655440001", "package": { "id": "550e8400-e29b-41d4-a716-446655440002", "name": "Residential 10 GiB", "alias": "residential10", "is_unlimited_data": false, "targeting_options": { "package": "package", "split_char": "-", "value_char": "-", "continent": "continent", "country": "country", "region": "region", "city": "city", "asn": "asn", "isp": "isp", "username": "username", "pool": "pool", "location": "location", "location_format": "", "session": "sid", "session_mode_tag": "", "session_ttl": "ttl", "session_ttl_format": 1, "os": "os", "os_combined": false, "os_split_char": "-", "os_linux": "linux", "os_windows": "windows", "os_ios": "ios", "os_macos": "macos", "os_android": "android" } }, "country": null, "coupon": null, "type": "residential", "status": "pending", "paid": null, "is_one_time": false, "is_payout": false, "data": 10737418240, "quantity": 0, "balance": 0, "connection_limit": 100, "price_total": 2500, "currency": "USD", "gateway": "stripe", "payment_amount": 2500, "payment_currency": "USD", "payment_url": "https://checkout.example.com/purchase-42", "provider_checkout_id": "checkout_example_42", "provider_payment_id": "", "checkout_status": "ready", "internal_id": "EXAMPLE-000042", "description": "10 GiB residential data", "vat": 0, "fx_market_rate": "1", "fx_effective_rate": "1", "fx_markup_percent": "0", "fx_quoted_at": null, "created": "2030-01-01T12:00:00Z", "updated": "2030-01-01T12:00:00Z", "company_name": "", "company_address": "", "company_city": "", "company_postal_code": "", "company_registration_number": "", "company_vat_number": ""}Headers
Section titled “Headers”True when the response was replayed from a prior request.
Strong entity tag for optimistic concurrency control.
The request is malformed or violates a business rule.
Validation and API error payload. Field names may be added dynamically; field errors are returned as arrays of human-readable messages.
object
Examples
Validation error
{ "non_field_errors": [ "The request could not be processed." ]}Headers
Section titled “Headers”Language used for human-readable errors.
Authentication credentials are missing, expired, or invalid.
Validation and API error payload. Field names may be added dynamically; field errors are returned as arrays of human-readable messages.
object
Examples
Authentication required
{ "detail": "Authentication credentials were not provided."}Headers
Section titled “Headers”Language used for human-readable errors.
The authenticated account cannot perform this operation.
Validation and API error payload. Field names may be added dynamically; field errors are returned as arrays of human-readable messages.
object
Examples
Permission denied
{ "detail": "You do not have permission to perform this action."}Headers
Section titled “Headers”Language used for human-readable errors.
The idempotency key is in progress or was reused for a different request.
Validation and API error payload. Field names may be added dynamically; field errors are returned as arrays of human-readable messages.
object
Examplegenerated
{ "detail": "example", "non_field_errors": [ "example" ]}Headers
Section titled “Headers”Language used for human-readable errors.
The upstream payment provider could not initialize checkout.
object
Examples
Payment provider unavailable
{ "invoice_id": "550e8400-e29b-41d4-a716-446655440000", "gateway": "whitepay", "retryable": true, "non_field_errors": [ "Payment checkout could not be initialized" ]}Headers
Section titled “Headers”Language used for human-readable errors.