---
title: Enforce a paywall using an origin API
summary: Use a custom Paywall header to trigger preflight requests to authenticate every article view with a backend paywall service.
url: https://www.fastly.com/documentation/solutions/examples/preflighting-for-paywall
---

Use a custom Paywall header to trigger preflight requests to authenticate every article view with a backend paywall service.

## VCL

[Try it in Fastly Fiddle](https://fiddle.fastly.dev/0f3e933e)

## Compute

### Rust

[Try it in Fastly Fiddle](https://fiddle.fastly.dev/eccda2a8)

### Javascript

[Try it in Fastly Fiddle](https://fiddle.fastly.dev/682bf021)

### Go

[Try it in Fastly Fiddle](https://fiddle.fastly.dev/94fa3fbe)

