# Example: block PO box addresses

> Stop checkout when the shipping address is a PO Box, and tell the shopper to use a street address.

Source: https://backtrackhq.com/docs/rules/example-block-po-boxes/

This example blocks checkout when the shipping address is a PO Box.
The shopper sees your message and can change the address. It uses
the **Block PO Box addresses** use case.

## How it works

The rule is a [Checkout validation](https://backtrackhq.com/docs/rules/checkout-validation/)
rule with:

- **Condition:** **Has P.O. box address** (rule set one).
- **Action:** **Block customer from completing checkout**.
- **Error message:** at **Top of the checkout page**: "PO Box
  addresses are not supported for shipping. Please use a street
  address."

## Set it up

1. **Open Rules and click Create rule.**

   (Screenshot: The Rules page with the Create rule button)

2. **Under Validation, find Checkout validation, click Select, then
   click Start from a use case and pick Block PO Box addresses.**

   (Screenshot: The Choose a use case window with Block PO Box addresses)

3. **Check the error message, its position and the timing.**

   Change the text if you like. To show it next to the address too,
   click **Add error message configuration** and pick **Address line
   one**. Use **Translate** for other languages. Leave both
   **Validation timing** options on. Then the shopper sees the error
   while typing the address, and again if they try to pay.

   (Screenshot: The PO Box rule with its error message and Validation timing)

4. **Save it as a draft, test it, then activate it.**

   In the **Status** card, choose **Draft** and save. At checkout,
   enter the [test email](https://backtrackhq.com/docs/get-started/test-before-going-live/) from the rule's **Status** card and a PO Box address, for
   example "PO Box 123". Checkout should show your message and stop. A
   street address should pass.

   (Screenshot: Checkout showing the PO Box error message)

   When it works, choose **Activate** in the **Status** card and save.

## Variations

- **Block military addresses (APO/DPO/FPO):** prevents orders to US
  military addresses.
- **Block shipping to selected states:** blocks provinces or states
  you don't ship to.
- **Hide only one shipping method for PO Boxes:** **Has P.O. box
  address** is only in checkout validation rules. In a
  [Hide shipping methods](https://backtrackhq.com/docs/rules/hide-shipping-methods/) rule,
  use **Address line 1 and 2** **contains** `PO Box, P.O. Box` in rule
  set two instead. Shoppers can still check out with another method.

## What counts as a PO Box

The check reads address line 1 and address line 2. It ignores upper
and lower case, dots and spaces. A line counts as a PO Box when it
says one of these, followed by a number:

- "PO Box", for example "PO Box 123", "P.O. Box 456" or "P O Box 789"
- "Post Office Box"
- "Postbox"
- "GPO Box"
- "POB"

Street names don't match, for example "Pond Road" or "Post Office
Road". The check only knows English spellings.

## Limits

- Validation rules also run on draft orders. See
  [Limits](https://backtrackhq.com/docs/rules/limits/#draft-orders).
- An address that hides a PO Box in an unusual way may not match.

See [Limits](https://backtrackhq.com/docs/rules/limits/).
