> Documentation index: https://docs.bannerandbooth.com/llms.txt · MCP: https://mcp.bannerandbooth.com/mcp · Search: https://docs.bannerandbooth.com/search?q=

# Test mode

Source: https://docs.bannerandbooth.com/guides/test-mode

Add `"test": true` when you create an order and you get a test order. Test orders work on every order endpoint, but nothing real happens. Use them to build an agent, write integration tests and demo the flow.

## What's different

| | Test order | Live order |
|---|---|---|
| Created with | `"test": true` | `"test": false` or omitted |
| `mode` | `"test"` | `"live"` |
| Order id | `bbo_test_...` | `bbo_...` |
| Order key | `bbk_test_<32 hex>` | `bbk_live_<32 hex>` |
| `email` | optional | required |
| Shopify | nothing created | a real draft order and invoice |
| `pay_url` | `https://api.bannerandbooth.com/t/pay/<id>`; opening it records a test payment | real Shopify checkout |
| Two-step upload URL | accepts and discards the bytes | stores the file |
| Printing, shipping | never | yes |
| Banner & Booth staff notified | never | yes |
| Webhooks to `notify_url` | yes, signed | yes, signed |
| `POST /v1/orders/{id}/simulate` | yes | `409 conflict` |
| Create rate limit | 100 per hour per IP | 10 per hour per IP |

Everything else is the same: validation, prices, discounts, shipping amounts, deadlines, order edits (`PATCH`), artwork uploads and preflight, logos and design briefs, automatic previews, proof approval, reorders (a reorder of a test order is also a test order), events and errors. A request that fails on a live order fails the same way on a test order.

## Create a test order

```bash curl
curl -s https://api.bannerandbooth.com/v1/orders \
  -H "Content-Type: application/json" \
  -d '{"items":[{"sku":"BB-TT-6FIT","quantity":2},{"sku":"BB-ACC-WT4","quantity":1}],"test":true}' \
  | jq '{id, mode, status, total, artwork, next: [.next_actions[] | {action, sku}]}'
```

```json Response
{
  "id": "bbo_test_2k7xquzbii",
  "mode": "test",
  "status": "awaiting_payment",
  "total": 340.97,
  "artwork": { "status": "needed", "needed_for": ["BB-TT-6FIT"], "files": [] },
  "next": [
    { "action": "pay", "sku": null },
    { "action": "upload_artwork", "sku": "BB-TT-6FIT" }
  ]
}
```

`BB-ACC-WT4` (canopy weights) is blank hardware, so only the throws need artwork.

## Simulate events

`POST /v1/orders/{id}/simulate` with an `event` moves a test order as if that happened in the real world. It returns the updated order object.

| `event` | Simulates | Order afterward | Webhook |
|---|---|---|---|
| `paid` | The buyer paying | `payment.status: "paid"`, `order_number` like `#TE82T`, `pay_url: null` | `order.paid` |
| `proof_ready` | Prepress sending a proof | One `kind: "human"` proof per SKU that needs artwork, `status: "pending"`, note "Simulated prepress proof (test mode)." Pending previews for those SKUs become `superseded`. Works even before artwork is uploaded. | `proof.ready` |
| `in_production` | Printing starting | `status: "in_production"` | `order.in_production` |
| `shipped` | Handing to the carrier | `status: "shipped"`, tracking `UPS 1ZTEST0000000000` | `order.shipped` |
| `delivered` | Delivery | `status: "delivered"` | `order.delivered` |

Events aren't checked for order: you can simulate `shipped` on an unpaid order. Send them in lifecycle order (artwork, `proof_ready`, approve, `paid`, `in_production`, `shipped`, `delivered`) so your agent sees realistic states. Opening the test `pay_url` in a browser does the same as `paid`.

```bash curl
curl -s -X POST "https://api.bannerandbooth.com/v1/orders/$BB_ORDER_ID/simulate" \
  -H "Authorization: Bearer $BB_ORDER_KEY" -H "Content-Type: application/json" \
  -d '{"event":"paid"}' | jq '{status, payment: .payment.status, order_number}'
```

```python Python
import os, requests

API = "https://api.bannerandbooth.com"
auth = {"Authorization": f"Bearer {os.environ['BB_ORDER_KEY']}"}

def simulate(event):
    r = requests.post(f"{API}/v1/orders/{os.environ['BB_ORDER_ID']}/simulate",
                      headers=auth, json={"event": event}, timeout=30)
    r.raise_for_status()
    return r.json()

print(simulate("paid")["status"])
```

```javascript Node
const API = "https://api.bannerandbooth.com";
const { BB_ORDER_ID, BB_ORDER_KEY } = process.env;

async function simulate(event) {
  const r = await fetch(`${API}/v1/orders/${BB_ORDER_ID}/simulate`, {
    method: "POST",
    headers: { Authorization: `Bearer ${BB_ORDER_KEY}`, "Content-Type": "application/json" },
    body: JSON.stringify({ event }),
  });
  if (!r.ok) throw new Error(JSON.stringify(await r.json()));
  return r.json();
}

console.log((await simulate("paid")).status);
```

CLI:

```bash
npx -y bannerbooth@latest order simulate bbo_test_2k7xquzbii paid
```

MCP: the `simulate_order_event` tool with `order_id`, `order_key` and `event`.

## A full test run

This script exercises every step an agent will hit in production. Save it as `test_order.sh` and run `bash test_order.sh`. It needs `curl` and `jq`.

```bash
#!/usr/bin/env bash
set -euo pipefail
API=https://api.bannerandbooth.com

order=$(curl -sf "$API/v1/orders" -H "Content-Type: application/json" \
  -H "Idempotency-Key: test-run-$(date +%s)" \
  -d '{"items":[{"sku":"BB-RB-33STD","quantity":1}],"show":{"name":"Test Expo","date":"2027-03-10","venue":"Javits"},"test":true}')
ID=$(echo "$order" | jq -r .id); KEY=$(echo "$order" | jq -r .order_key)
auth=(-H "Authorization: Bearer $KEY")
echo "created $ID: $(echo "$order" | jq -r .status), deadline $(echo "$order" | jq -r .deadline.status)"

printf '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 335 860"><rect width="335" height="860" fill="#c2411f"/></svg>' > banner.svg
curl -sf -T banner.svg "${auth[@]}" "$API/v1/orders/$ID/artwork?sku=BB-RB-33STD&filename=banner.svg" \
  | jq -r '"artwork: " + .order.artwork.status + ", proof: " + .order.proof.status'

sim() { curl -sf -X POST "$API/v1/orders/$ID/simulate" "${auth[@]}" -H "Content-Type: application/json" -d "{\"event\":\"$1\"}"; }

sim proof_ready | jq -r '"after proof_ready: " + .proof.status'
curl -sf -X POST "$API/v1/orders/$ID/proofs/latest/approve" "${auth[@]}" -H "Content-Type: application/json" \
  -d '{"approved_by":"Test Runner"}' | jq -r '"after approve: " + .proof.status'

for e in paid in_production shipped delivered; do
  sim "$e" | jq -r --arg e "$e" '"after \($e): " + .status'
done

curl -sf "$API/v1/orders/$ID/events" "${auth[@]}" | jq -r '.events[] | "\(.at)  \(.type)"'
```

Output:

```text
created bbo_test_cndrcmpigk: awaiting_payment, deadline GREEN
artwork: received, proof: preview_ready
after proof_ready: proof_ready
after approve: approved
after paid: approved
after in_production: in_production
after shipped: shipped
after delivered: delivered
2026-12-01T03:59:02Z  order.created
2026-12-01T03:59:03Z  artwork.received
2026-12-01T03:59:03Z  proof.ready
2026-12-01T03:59:04Z  proof.approved
2026-12-01T03:59:04Z  order.paid
2026-12-01T03:59:04Z  order.in_production
2026-12-01T03:59:04Z  order.shipped
2026-12-01T03:59:05Z  order.delivered
```

## Testing webhooks

Set `notify_url` on a test order to an `https` URL you control. Uploads, proofs, approvals and simulated events send real, signed webhooks, so you can test your receiver end to end. For local development, expose your receiver with an HTTPS tunnel. See [Webhooks](https://docs.bannerandbooth.com/guides/webhooks).

## Testing failures

Test orders return the same errors as live ones. Cases worth covering:

| Send | Expect |
|---|---|
| `"items": [{"sku": "BB-NOPE", "quantity": 1}]` | `422 unknown_sku` |
| `"shipping_address": {..., "province": "HI"}` | `422 unsupported_destination` |
| `"zip": "787"` in the address | `400 invalid_request` |
| No `Authorization` header on `GET /v1/orders/{id}` | `401 unauthorized` |
| Same `Idempotency-Key`, different body | `409 conflict` |
| Upload with `sku` not on the order | `422 unknown_sku` |
| Upload `note.txt` | `400 invalid_request` (unsupported file type) |
| `approve` on `latest` with no pending proof | `404 not_found` |
| `simulate` with `"event": "teleport"` | `400 invalid_request` |
| `cancel` after `simulate paid` | `409 conflict` |
| `PATCH` after `simulate paid` | `409 conflict` |
| `PATCH` with `{}` | `400 invalid_request` ("Nothing to change.") |
| Upload after `simulate in_production` | `409 conflict` |
| Design brief with only a `sku` | `400 invalid_request` |

## Going live

Remove `"test": true`, add the buyer's `email` and a shipping address, and confirm the order with the buyer first. See [Quickstart: switch to live](https://docs.bannerandbooth.com/quickstart#switch-to-live).
