Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.batchrelay.com/llms.txt

Use this file to discover all available pages before exploring further.

Production API usage requires an active billing method on your account. Without it, order creation will be blocked and your integration will receive a 402 error before any fulfillment is attempted. Setting up billing takes only a few moments through the developer dashboard, and you can validate the full billing flow using Stripe’s test mode before you go live.

Adding a Billing Method

Open the developer dashboard and click Add billing. Batch Relay uses Stripe in test mode during development, so no real charges are made until you switch to a live Stripe key. When prompted by the Stripe payment form, use the following test card details:
FieldValue
Card number4242 4242 4242 4242
Expiration dateAny future date
CVCAny 3-digit value
ZIP codeAny value

Billing States

Your account’s billing status is reflected by one of four states. You can view the current state in the developer dashboard at any time:
StateMeaning
not_configuredNo usable billing method is attached to your account.
activeBilling setup is complete and your account can create production orders.
past_dueYour billing method requires attention — production order creation may be restricted.
disabledAPI billing has been administratively disabled for your account.

Testing Billing in the Sandbox

Sandbox order creation is normally free and does not interact with your billing method. If you want to exercise the billing gate — for example, to verify that your integration handles a missing payment method gracefully — include the billing.required flag in your sandbox request body:
{
  "billing": {
    "required": true
  }
}
When your account billing is inactive and this flag is set, the API responds with a 402 Payment Required error:
HTTP/1.1 402 Payment Required
{
  "error": {
    "code": "billing_required",
    "message": "This sandbox request requires active billing for billing-flow testing."
  },
  "request_id": "req..."
}
The 402 response is only returned when billing.required is true and your account billing is inactive. Sandbox requests without this flag succeed regardless of your billing state.

Reported Charges

The developer dashboard reports all captured API charges under your account. During setup-mode testing, saved cards do not generate real charges, so your total remains $0.00 until PaymentIntent-based order charging is enabled for your account.
Do not use a real card number during development. Always use Stripe’s 4242 4242 4242 4242 test card so that no actual funds are moved while you are building and validating your integration.