Quickstart
1. Create an API account
Section titled “1. Create an API account”Open the developer dashboard and create an individual API account:
https://app.batchrelay.com/developersFor local development:
http://localhost:3000/developers2. Create an API key
Section titled “2. Create an API key”Create a key with:
print_orders:writeprint_orders:read
Copy the key immediately. Batch Relay stores only a hash, prefix, and masked display value.
3. Create a sandbox order
Section titled “3. Create a sandbox order”curl -i -X POST "http://localhost:3000/v1/print-orders" \ -H "Authorization: Bearer br_your_key" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: test-order-001" \ -d '{ "environment": "sandbox", "externalOrderId": "test-order-001", "items": [ { "product": "photo-print-5x7", "quantity": 1, "image": { "url": "https://images.batchrelay.com/team-5x7.jpg" } } ], "shipTo": { "name": "Test Customer", "addr1": "1337 Williams Street", "city": "Spokane", "state": "WA", "zip": "99201", "country": "US" } }'Successful responses use a stable envelope:
{ "data": { "environment": "sandbox", "id": "mn7...", "status": "created" }, "environment": "sandbox", "request_id": "req..."}4. Test billing in sandbox
Section titled “4. Test billing in sandbox”To exercise the billing gate without touching production fulfillment:
{ "environment": "sandbox", "billing": { "required": true }}If billing is inactive, the API returns 402 billing_required.