Payments
Purchase proxy plans, deposit funds, verify coupons, and view invoices.
Purchase Proxy Plan
Create a new proxy subscription or renew an existing one. Uses your wallet balance for payment.
POST /payments/purchaseRate limit: 10 requests per minute.
Headers
| Header | Required | Description |
|---|---|---|
X-API-Key | Yes | Your API key |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
product_slug | string | Yes | Product to purchase (e.g. "datacenter-proxy") |
billing_period | string | Yes | weekly, monthly, quarterly, yearly, or pay_as_you_go |
payment_method | string | Yes | "wallet" for API purchases |
coupon_code | string | No | Discount coupon code |
threads | integer | No | Custom thread count (if product supports it) |
data_gb | integer | No | Custom data amount in GB (if product supports it) |
subscription_id | integer | No | Existing subscription ID for renewal/top-up |
Request Example
{
"product_slug": "datacenter-proxy",
"billing_period": "monthly",
"payment_method": "wallet",
"threads": 200,
"data_gb": 100,
"coupon_code": "SAVE20"
}Response
{
"id": 1001,
"user_id": 5,
"product_slug": "datacenter-proxy",
"billing_period": "monthly",
"final_amount_usd": "45.99",
"currency": "USD",
"status": "paid",
"payment_method": "wallet",
"coupon_code": "SAVE20",
"created_at": "2025-01-15T12:00:00Z",
"paid_at": "2025-01-15T12:00:00Z"
}Create Deposit
Create a wallet deposit invoice to add funds to your account.
POST /payments/depositRate limit: 5 requests per minute.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
amount | number | Yes | Amount to deposit in USD |
payment_method | string | Yes | Payment gateway (e.g. "stripe", "crypto") |
Response
Returns an invoice object. For external payment methods, the response includes a payment_url to redirect the user.
Calculate Price
Preview the cost of a proxy plan before purchasing. No authentication required.
POST /payments/calculate-priceRequest Body
Same fields as Purchase product_slug, billing_period, threads, data_gb, coupon_code.
Response
{
"base_price": "59.99",
"thread_cost": "10.00",
"data_cost": "19.50",
"discount": "17.90",
"coupon_discount": "17.90",
"final_price": "71.59",
"currency": "USD"
}Verify Coupon
Check if a coupon code is valid and see the discount it provides. No authentication required.
GET /payments/verify-coupon/{code}Rate limit: 10 requests per minute (per IP).
Path Parameters
| Parameter | Type | Description |
|---|---|---|
code | string | Coupon code to verify |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
product_slug | string | No | Check applicability for a specific product |
billing_period | string | No | Check applicability for a billing period |
Response
{
"valid": true,
"code": "SAVE20",
"discount_percent": 20,
"discount_fixed_usd": null,
"applicable_products": ["datacenter-proxy", "residential-proxy"],
"expires_at": "2025-06-01T00:00:00Z"
}List Invoices
Retrieve a paginated list of your invoices.
GET /payments/invoices?page=1&per_page=20Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
page | integer | 1 | Page number |
per_page | integer | 20 | Items per page |
Response
{
"items": [
{
"id": 1001,
"product_name": "Datacenter Proxy",
"amount": "45.99",
"currency": "USD",
"status": "paid",
"payment_method": "wallet",
"coupon_code": "SAVE20",
"created_at": "2025-01-15T12:00:00Z",
"paid_at": "2025-01-15T12:00:00Z"
}
],
"meta": {
"total": 47,
"pages": 3,
"page": 1,
"per_page": 20
}
}Invoice Object
| Field | Type | Description |
|---|---|---|
id | integer | Invoice ID |
product_name | string | Product name or "Deposit" |
amount | string | Final amount in USD |
currency | string | Currency code |
status | string | pending, paid, failed, refunded |
payment_method | string | Payment method used |
coupon_code | string | null | Applied coupon code |
created_at | string | ISO 8601 creation timestamp |
paid_at | string | null | ISO 8601 payment timestamp |
Examples
# Purchase a monthly datacenter proxy
curl -X POST -H "X-API-Key: your_api_key" \
-H "Content-Type: application/json" \
-d '{
"product_slug": "datacenter-proxy",
"billing_period": "monthly",
"payment_method": "wallet",
"threads": 100,
"data_gb": 50
}' \
https://api.redscrape.com/api/public/payments/purchase
# Calculate price before buying
curl -X POST -H "Content-Type: application/json" \
-d '{
"product_slug": "datacenter-proxy",
"billing_period": "quarterly",
"threads": 200,
"data_gb": 500,
"coupon_code": "SAVE20"
}' \
https://api.redscrape.com/api/public/payments/calculate-price
# Verify a coupon
curl "https://api.redscrape.com/api/public/payments/verify-coupon/SAVE20?product_slug=datacenter-proxy"
# Deposit $100 via Stripe
curl -X POST -H "X-API-Key: your_api_key" \
-H "Content-Type: application/json" \
-d '{"amount": 100, "payment_method": "stripe"}' \
https://api.redscrape.com/api/public/payments/deposit
# List invoices (page 2)
curl -H "X-API-Key: your_api_key" \
"https://api.redscrape.com/api/public/payments/invoices?page=2&per_page=10"