Skip to content

Create an invoice

POST
/invoices
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" }'

Calculates 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.

Idempotency-Key
string
<= 255 characters

Stable key for one logical mutation. Successful responses are replayable for 24 hours; reusing a key with a different request returns 409.

Accept-Language
string
default: en

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
de
object
package_id

Package to purchase. Required for package purchases.

string format: uuid
user_id

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.

string format: uuid
gateway
required
  • 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
string
Allowed values: crypto credit_card wallet manual stripe coinbase cryptomus coingate whitepay wayforpay usegateway binance anymoney coinpayments checkoutcom nowpayments btcpay braintree monobank liqpay iyzico paytr payu tpay przelewy24 gopay comgate monei redsys payplug mollie unzer payone nexi_xpay halyk_epay kaspi_pay vipps_mobilepay paytrail
status

Initial invoice status. Defaults to pending. Only superusers may set paid; other authenticated users receive a 403 response. * pending - pending * paid - paid

string
Allowed values: pending paid
crypto_currency
string
>= 1 characters
payment_currency

ISO 4217 currency charged by a regional fiat provider.

string
>= 1 characters <= 3 characters
coupon_code
string
country_code
string
>= 1 characters <= 2 characters
data

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.

integer
quantity

Number of static proxies to purchase.

integer
amount

Account balance amount to purchase, in the smallest currency unit. Use for a wallet top-up without package_id, not for buying proxy data.

integer
connection_limit
integer
>= -1
expires

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.

integer
company_name
string
>= 1 characters
company_registration_number
string
>= 1 characters
company_vat_number
string
>= 1 characters
Examples

Purchase residential data

{
"package_id": "550e8400-e29b-41d4-a716-446655440002",
"data": 10737418240,
"gateway": "stripe"
}

The resource or action result was created successfully.

Media typeapplication/json
object
id
string
<= 36 characters
package
required
object
id
string
<= 36 characters
name
required

Unique display name for this package shown to customers and in the admin. Residential Starter Business Pro

string
>= 2 characters <= 255 characters
alias
required

Lowercase alphanumeric identifier used internally for package resolution and proxy username routing. Cannot be changed without affecting active connections. residential01 bizpro

string
>= 2 characters <= 255 characters /^[a-z0-9]+$/
is_unlimited_data
Unlimited Data

When enabled, users on this package have no data cap. The proxy will not enforce any bandwidth limit.

boolean
targeting_options
required
object
package
required
string
split_char
required
string
value_char
required
string
continent
required
string
country
required
string
region
required
string
city
required
string
asn
required
string
isp
required
string
username
required
string
pool
required
string
location
required
string
location_format
required
string
session
required
string
session_mode_tag
required
string
session_ttl
required
string
session_ttl_format
required
integer
os
required
string
os_combined
required
boolean
os_split_char
required
string
os_linux
required
string
os_windows
required
string
os_ios
required
string
os_macos
required
string
os_android
required
string
country
required
object
id
string
<= 36 characters
code
required
ISO 3166-1 Alpha-2 Code

Two-letter ISO 3166-1 alpha-2 country code. Must be unique. us de fr

string
<= 10 characters
name
required

English display name of the country used across the admin and API responses.

string
<= 255 characters
original_name

Native-language name of the country as it appears in the source data. Deutschland Français

string
<= 255 characters
isps
required
Array<object>
object
code
required
string
name
required
string
asns
required
Array<object>
object
code
required
string
name
required
string
user_id
required
string format: uuid
coupon
required
object
id
string
<= 36 characters
is_expired
required
boolean
is_redeemed
required
boolean
packages
required
Array<object>
object
key
additional properties
created
required
string format: date-time
value
required

Arbitrary coupon value

integer format: int64
>= -9223372036854776000 <= 9223372036854776000
code
required

Leaving this field empty will generate a random code.

string
is_multi_use
Multi-use

If true, coupon can be used multiple times.

boolean
is_available_to_one_time
Available for One-Time Purchases

If true, coupon can not be used for one-time package tiers.

boolean
type
required
  • free_data - Free Data * monetary - Money * percentage - Percentage
string
Allowed values: free_data monetary percentage
limit

Number of times coupon can be used

integer
>= -2147483648 <= 2147483647
valid_until

Leave empty for coupons that never expire

string format: date-time
nullable
marketer

The marketer who owns this coupon. Required if is_marketer is true.

string format: uuid
nullable
user
required

The user who created this coupon.

string format: uuid
nullable
payment_amount
required
integer
payment_currency
required
string
fx_market_rate
required
string
fx_effective_rate
required
string
fx_markup_percent
required
string
fx_quoted_at
required
string format: date-time
nullable
updated
required
string format: date-time
created
required
string format: date-time
type

The type of invoice, indicating the type of proxy service. Options include: RESIDENTIAL: Residential proxies. STATIC: Static proxies. * static - Static * residential - Residential * balance - Balance

string
Allowed values: static residential balance
is_one_time
One-Time Purchase

Whether this pricing tier is restricted to a one-time purchase. False does not create a recurring subscription or a renewal schedule.

boolean
is_payout
Payout

Indicates whether this invoice is a payout to the marketer. Default is False.

boolean
internal_id

A unique identifier for the invoice, generated automatically.

string
<= 25 characters
status

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

string
Allowed values: pending paid unpaid error
description

A description of the invoice. This field is optional and can be left blank.

string
connection_limit

The maximum number of concurrent connections allowed for this package.

integer
>= -1 <= 2147483647
quantity

The number of proxies to assign.

integer
<= 2147483647
data
Data (bytes)

The amount of data in bytes.

integer format: int64
<= 1000000000000000
balance
Balance Top Up (cents)

The balance to top up for the user. Must be zero or positive.

integer format: int64
<= 10000000000
price_total
Price (cents)

The total price of the invoice, including any discounts. Must be at least 1 cent.

integer format: int64
>= 1 <= 10000000000
gateway
Payment Gateway

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

string
Allowed values: coinbase cryptomus stripe coingate wallet manual whitepay wayforpay usegateway binance anymoney coinpayments checkoutcom nowpayments btcpay braintree monobank liqpay iyzico paytr payu tpay przelewy24 gopay comgate monei redsys payplug mollie unzer payone nexi_xpay halyk_epay kaspi_pay vipps_mobilepay paytrail
payment_url

The URL for making the payment. Optional field with a maximum length of 500 characters.

string format: uri
<= 500 characters
currency
Billing Currency

ISO 4217 currency captured when the invoice is created.

string
<= 3 characters
provider_checkout_id

Provider-side hosted checkout identifier used for reconciliation.

string
<= 255 characters
provider_payment_id

Provider-side payment or transaction identifier used for reconciliation.

string
<= 255 characters
checkout_status
  • not_required - Not required * initializing - Initializing * ready - Ready * failed - Failed
string
Allowed values: not_required initializing ready failed
vat
VAT (%)

The VAT percentage applied to the invoice. Must be between 0 and 100.

number format: double
<= 100
company_name
string
<= 255 characters
company_address
string
<= 255 characters
company_city
string
<= 255 characters
company_postal_code
string
<= 255 characters
company_registration_number
string
<= 255 characters
company_vat_number
string
<= 255 characters
paid

The date and time when the invoice was paid.

string format: date-time
nullable
Examples
ExamplePendingResidentialPurchase

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": ""
}
Idempotency-Replayed
string
Allowed values: true

True when the response was replayed from a prior request.

ETag
string

Strong entity tag for optimistic concurrency control.

The request is malformed or violates a business rule.

Media typeapplication/json

Validation and API error payload. Field names may be added dynamically; field errors are returned as arrays of human-readable messages.

object
detail
string
non_field_errors
Array<string>
key
additional properties
One of:
string
Examples
ExampleValidationError

Validation error

{
"non_field_errors": [
"The request could not be processed."
]
}
Content-Language
string

Language used for human-readable errors.

Authentication credentials are missing, expired, or invalid.

Media typeapplication/json

Validation and API error payload. Field names may be added dynamically; field errors are returned as arrays of human-readable messages.

object
detail
string
non_field_errors
Array<string>
key
additional properties
One of:
string
Examples
ExampleAuthenticationRequired

Authentication required

{
"detail": "Authentication credentials were not provided."
}
Content-Language
string

Language used for human-readable errors.

The authenticated account cannot perform this operation.

Media typeapplication/json

Validation and API error payload. Field names may be added dynamically; field errors are returned as arrays of human-readable messages.

object
detail
string
non_field_errors
Array<string>
key
additional properties
One of:
string
Examples
ExamplePermissionDenied

Permission denied

{
"detail": "You do not have permission to perform this action."
}
Content-Language
string

Language used for human-readable errors.

The idempotency key is in progress or was reused for a different request.

Media typeapplication/json

Validation and API error payload. Field names may be added dynamically; field errors are returned as arrays of human-readable messages.

object
detail
string
non_field_errors
Array<string>
key
additional properties
One of:
string
Examplegenerated
{
"detail": "example",
"non_field_errors": [
"example"
]
}
Content-Language
string

Language used for human-readable errors.

The upstream payment provider could not initialize checkout.

Media typeapplication/json
object
invoice_id
required
string format: uuid
gateway
required
string
retryable
required
boolean
non_field_errors
required
Array<string>
Examples
ExamplePaymentProviderUnavailable

Payment provider unavailable

{
"invoice_id": "550e8400-e29b-41d4-a716-446655440000",
"gateway": "whitepay",
"retryable": true,
"non_field_errors": [
"Payment checkout could not be initialized"
]
}
Content-Language
string

Language used for human-readable errors.