---
title: "Preview a lead scraper payment"
method: POST
path: "/api/v1/lead-scrapers/payment-preview"
tags: ["Lead Scrapers"]
---

# Preview a lead scraper payment

`POST /api/v1/lead-scrapers/payment-preview`

## Request

- Base URL: `https://api.aerosend.io`
- URL: `https://api.aerosend.io/api/v1/lead-scrapers/payment-preview`
- Auth: API key in header `X-API-Key`

Returns the amount due for a lead scraper request for the authenticated client. Does not charge.

## Behavior
- Validates `params` the same way as `POST /api/v1/lead-scrapers/submissions`
- An active Aerosend subscription receives a 50% discount
- An account with no active subscription pays the full price
- A result count is required even when submit allows it to be omitted
- When `requires_checkout` is false, confirming with `POST /api/v1/lead-scrapers/payment` charges the saved card
- When `requires_checkout` is true, that pay call returns `checkout_url`

## Response
- **list_amount**: price before the subscription discount
- **amount_due**: price after the discount
- **discount_percent**: `50` or `0`

## Request body

- LeadScraperSubmissionRequest: Lead scraper id and the input values to validate
  - `scraperId` string: Scraper id from GET /api/v1/lead-scrapers
  - `params` JsonNode
    - `empty` boolean
    - `array` boolean
    - `null` boolean
    - `object` boolean
    - `float` boolean
    - `string` boolean
    - `container` boolean
    - `missingNode` boolean
    - `valueNode` boolean
    - `nodeType` 'ARRAY' | 'BINARY' | 'BOOLEAN' | 'MISSING' | 'NULL' | 'NUMBER' | 'OBJECT' | 'POJO' | 'STRING'
    - `pojo` boolean
    - `number` boolean
    - `integralNumber` boolean
    - `floatingPointNumber` boolean
    - `short` boolean
    - `int` boolean
    - `long` boolean
    - `double` boolean
    - `bigDecimal` boolean
    - `bigInteger` boolean
    - `textual` boolean
    - `boolean` boolean
    - `binary` boolean
    - `embeddedValue` boolean

## Response `200`

OK

- ApiResponse: Standard API response wrapper
  - `success` boolean: Success flag
  - `data` LeadScraperPayment: Price and payment result for one lead scraper request
    - `scraperId` string: Scraper id
    - `currencyCode` string: Currency code
    - `discountPercent` integer: 0 or 50. 50 when the account has an active Aerosend subscription
    - `listAmount` number, double: Price before the subscription discount
    - `amountDue` number, double: Amount due for this scrape
    - `quantity` integer: Billed blocks of 1,000 units
    - `unitCount` integer: Lead or result count used to price the request
    - `requiresCheckout` boolean: True when preview or pay needs a checkout page
    - `chargedImmediately` boolean: True when the saved card was charged
    - `checkoutUrl` string: Pay page. Set when pay does not charge the saved card
    - `message` string: What to do next
  - `timestamp` string: Response timestamp

## Other responses

- `401`: Unauthorized - Invalid or expired API key
- `429`: Rate limit exceeded

---

[API](https://skmtc.dev/aerosend/apis/aerosend-developer-api.md) · [All operations](https://skmtc.dev/aerosend/apis/aerosend-developer-api/llms.txt) · [OpenAPI document](https://skmtc.dev/aerosend/apis/aerosend-developer-api/revisions/9828eeb89b1f?raw)
