List invoices, create checkout sessions, poll payment status, and discover the payment methods and cryptocurrencies available to an account. These endpoints are browser/checkout-oriented: creating a payment returns an identifier you poll (and, for card and SBP gates, a hosted checkout URL to redirect the customer to). All responses are flat, bespoke JSON — they do NOT use the standard {success, payload, meta, errors, description} resource envelope.
A payment moves through statuses (created → completed, or expires). Card and SBP gates redirect the customer to a hosted checkout page; crypto gates return an on-chain address the customer sends funds to. Use Check Payment to poll for completion — it doubles as a webhook fallback and returns the updated traffic balance once the payment lands.
List Payments
GET/v1/paymentsRequires Auth
List Payments
List Payments
Retrieve the authenticated user's invoice history, newest first. Each row includes the invoice identifier, a formatted total price string, the current status, and a link to download the invoice document.
req, _ := http.NewRequest("GET", "https://api.proxyhat.com/v1/payments", nil)
req.Header.Set("Authorization", "Bearer __API_KEY__")
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
var result struct {
Success bool `json:"success"`
Data []map[string]interface{} `json:"data"`
}
json.NewDecoder(resp.Body).Decode(&result)
for _, p := range result.Data {
fmt.Println(p["invoice_id"], p["total_price"], p["status"])
}
payment_type is "Recurring" for subscription plans and "One-time" otherwise. purchase_category is "Subscription" or "Pay-As-You-Go" correspondingly. total_price is a pre-formatted string (e.g. "$50.00"), not a number, and amount_traffic is the plan's GB snapshot (may be null). download_url points at the invoice document endpoint. On an internal error the endpoint returns 500 with {"success": false, "message": ...}.
Create Payment
POST/v1/paymentsRequires Auth
Create Payment
Create Payment
Create a checkout session for a plan. Returns a payment_id you can poll, plus a checkout_url for the card and SBP gates. Subscriptions are card-only. ISP plans require ISP proxy access on the account.
Example request:typeplan_idgatecryptocurrency_code
Request Body
Name
Type
Required
Description
type
string
Required
Plan family. One of "regular" (pay-as-you-go), "subscription", or "isp".
plan_id
string
Required
The id of the plan to purchase (matches the type: RegularPlan, SubscriptionPlan, or IspPlan).
gate
string
Required
Payment method. One of "card", "crypto", "crypto_setype", or "sbp". Subscriptions require "card". Only gates enabled in config are accepted (see Available Methods).
cryptocurrency_code
string
Optional
Required when gate = "crypto". For crypto gates the code must be supported for that gate (see List Cryptocurrencies). Ignored for card/SBP.
coupon_code
string
Optional
Optional discount/bonus coupon code applied to the order.
quantity
integer
Optional
ISP only. Number of proxies to buy, 1-10 (also server-capped by the configured max buy quantity). Defaults to 1; forced to 1 for non-ISP types.
auto_renew
boolean
Optional
ISP only, and only with gate = "card" (auto-charge). Enables automatic renewal of the ISP proxy.
attribution
object
Optional
Optional Google Ads click identifiers, persisted for offline-conversion upload.
checkout_url is present only for the card and sbp gates — redirect the customer there to complete payment. Crypto gates omit it; instead call Get Payment to read the pay address / hosted checkout. A scheduled subscription downgrade does not charge and returns a different success body: {"success": true, "downgrade_scheduled": true, "applies_at": "..."}.
Rate limits & errors. An account may hold at most 5 pending payments and create at most 3 per hour. Errors return success: false with a message (and often an extra field):
422 too many pending payments — message, pending_payment_id, pending_count.
422code: "SUBSCRIPTION_REQUIRES_CARD" — a subscription was attempted with a non-card gate.
422code: "NO_RECURRING_SUBSCRIPTION" / "PLAN_NOT_SYNCED" — downgrade could not be scheduled.
500code: "DOWNGRADE_SCHEDULE_FAILED" — the downgrade schedule call failed.
422 auto-renew requested with a non-card gate, plan not found / under construction, payment-limit reached, coupon invalid, or gate unavailable.
403 ISP plan requested without ISP proxy access on the account.
Available Methods
GET/v1/payments/geoRequires Auth
Available Payment Methods
Available Payment Methods
Return the payment methods available to the caller, based on detected country (CloudFlare geo header, falling back to IP lookup) and which gateways are configured. Use this to decide which gate values are valid before creating a payment.
methods always includes "card"; "crypto", "crypto_setype", and "sbp" appear only when their respective gateways are configured. country_code may be an empty string if geo detection fails.
List Cryptocurrencies
GET/v1/payments/cryptocurrenciesRequires Auth
List Cryptocurrencies
List Cryptocurrencies
List the cryptocurrencies accepted for payment. Pass a gate to filter to the coins supported by that specific crypto gateway. Use a returned code as cryptocurrency_code when creating a crypto payment.
No input needed —runs live with your key
Query Parameters
Name
Type
Required
Description
gate
string
Optional
Restrict the list to coins supported by a gate (e.g. "crypto" or "crypto_setype"). Omit to return all.
req, _ := http.NewRequest("GET", "https://api.proxyhat.com/v1/payments/cryptocurrencies?gate=crypto", nil)
req.Header.Set("Authorization", "Bearer __API_KEY__")
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
var result struct {
Success bool `json:"success"`
Data []map[string]interface{} `json:"data"`
}
json.NewDecoder(resp.Body).Decode(&result)
for _, c := range result.Data {
fmt.Println(c["code"], c["label"], c["network"])
}
Get Payment
GET/v1/payments/{payment}Requires Auth
Get Payment
Get Payment
Retrieve the payment details needed to complete checkout. The data object is gate-dependent: crypto gates return the on-chain pay address and coin info; card and SBP gates return a hosted checkout_url. Only the owner may fetch a payment.
The data shape depends on gate. product_type is one of "regular", "subscription", or "isp". All gates return gate, product_type, amount_usd, status, expires_at, completed_at, and is_first_paid. In addition:
card — checkout_url (redirect the customer here).
sbp — amount_rub and checkout_url.
crypto / crypto_setype — pay_address, crypto_amount, checkout_url (hosted-checkout URL, may be null), hosted_checkout (bool), crypto (coin descriptor), and tx_hash.
An invalid uuid or a payment not owned by the caller returns 404 with {"success": false, "message": ...}.
Check Payment
GET/v1/payments/{payment}/checkRequires Auth
Check Payment Status
Check Payment Status
Poll a payment for completion. Acts as a webhook fallback — it queries the underlying gateway when the local status is not yet completed. Once completed, the response also carries the account's updated traffic balance. Only the owner may check a payment.
While the payment is still pending, data contains only gate, product_type, status, and tx_hash. The is_first_paid flag and the traffic object are added only once status is "completed". A payment not owned by the caller returns 403.
Invoice Document
Not a JSON endpoint.GET /v1/payments/{payment}/invoice returns a rendered document, not JSON — an HTML invoice by default, or a streamed PDF when ?format= is set to anything other than html. This is the target of each list row's download_url and is intended for browser display / download. Only the payment owner may access it (403 otherwise).
GET/v1/payments/{payment}/invoiceRequires Auth
Download Invoice
Download Invoice
Render the invoice for a payment. Returns HTML by default, or a streamed PDF when format is not "html". This endpoint returns a document, not JSON — open it in a browser or save the stream to a file.
We filled these in for you:payment
Tweak any value if you like — or just press Try.
Query Parameters
Name
Type
Required
Description
format
string
Optional
Output format. "html" (default) returns an HTML page; any other value (e.g. "pdf") streams a PDF document.