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

# Pay for a lead scraper

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

## Request

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

Charges for a lead scraper request for the authenticated client, or returns a checkout URL.

## Behavior
- Preview first with `POST /api/v1/lead-scrapers/payment-preview`
- An active subscription with a card on file is charged once, at 50% off. `charged_immediately` is true
- No active subscription pays the full price. Open `checkout_url` to pay
- An active subscription that is not billed automatically still receives 50% off and a checkout URL
- The lead scrape starts after payment is confirmed

## Response
- **checkout_url**: pay page when the saved card is not charged
- **charged_immediately**: true when the saved card was charged

## 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)
