> ## Documentation Index
> Fetch the complete documentation index at: https://payperfax.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Prepare your first fax with one request, open the preview, and follow the status.

One request prepares the fax. The person opens the link, checks the preview with the price, and pays. Then you follow the status until the fax is finished. No account and no API key are needed.

See [payperfax.com/pay-per-fax-api/](https://payperfax.com/pay-per-fax-api/) for what you can build with it.

**1. Prepare the fax**

Send the fax number, the person's email address, and the letter as Markdown:

```bash theme={null}
curl https://fax.payperfax.com/api/fax \
  -H "Content-Type: application/json" \
  -d '{
    "to": "+14155550101",
    "email": "person@example.com",
    "language": "en",
    "markdown": "# Request for records\n\nPlease send me a copy of my records.\n\nJane Doe"
  }'
```

The response is `201`:

```json theme={null}
{
  "id": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
  "url": "https://fax.payperfax.com/fax/9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d/continue",
  "status_url": "https://fax.payperfax.com/api/fax/9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d/status"
}
```

Nothing is sent and nothing is charged yet.

You can also attach files (PDF, Word, images) and add a cover page. See [A complete fax](https://payperfax.mintlify.site/api/send-a-fax.md#a-complete-fax) and [Add a cover page](https://payperfax.mintlify.site/api/send-a-fax.md#add-a-cover-page).

**2. Open the link**

Give `url` to the person, or open it yourself. It shows the preview as the receiving machine will get it, with the final price. The draft is kept for 4 hours.

You can stop here: a fax that nobody pays for is never sent and never charged.

**3. The person pays**

The person pays on the preview page, and PayPerFax sends the fax. To test without a charge, send to a [test number](https://payperfax.mintlify.site/api/send-a-fax.md#test-numbers). A fax that fails is not charged.

**4. Follow the status**

After payment, read `status_url` every 15 seconds:

```bash theme={null}
curl https://fax.payperfax.com/api/fax/9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d/status
```

Stop when `is_terminal` is `true`. The status is then `delivered`, `failed`, or `expired`. The person also gets the result and the receipt by email.

> [!NOTE]
>
> Do not poll while the stage is `awaiting_payment`: a person must pay first. [Check the status](https://payperfax.mintlify.site/api/check-status.md) has the polling rules for each stage.

## Next

> **[Send a fax](https://payperfax.mintlify.site/api/send-a-fax.md)**
>
> Every field, files, the cover page, the form link, rate limits, and errors

> **[Check the status](https://payperfax.mintlify.site/api/check-status.md)**
>
> Status values, stages, and polling rules


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.