RedScrapeRedScrapeDocs

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/purchase

Rate limit: 10 requests per minute.

Headers

HeaderRequiredDescription
X-API-KeyYesYour API key

Request Body

FieldTypeRequiredDescription
product_slugstringYesProduct to purchase (e.g. "datacenter-proxy")
billing_periodstringYesweekly, monthly, quarterly, yearly, or pay_as_you_go
payment_methodstringYes"wallet" for API purchases
coupon_codestringNoDiscount coupon code
threadsintegerNoCustom thread count (if product supports it)
data_gbintegerNoCustom data amount in GB (if product supports it)
subscription_idintegerNoExisting 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/deposit

Rate limit: 5 requests per minute.

Request Body

FieldTypeRequiredDescription
amountnumberYesAmount to deposit in USD
payment_methodstringYesPayment 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-price

Request 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

ParameterTypeDescription
codestringCoupon code to verify

Query Parameters

ParameterTypeRequiredDescription
product_slugstringNoCheck applicability for a specific product
billing_periodstringNoCheck 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=20

Query Parameters

ParameterTypeDefaultDescription
pageinteger1Page number
per_pageinteger20Items 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

FieldTypeDescription
idintegerInvoice ID
product_namestringProduct name or "Deposit"
amountstringFinal amount in USD
currencystringCurrency code
statusstringpending, paid, failed, refunded
payment_methodstringPayment method used
coupon_codestring | nullApplied coupon code
created_atstringISO 8601 creation timestamp
paid_atstring | nullISO 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"

On this page