Obtain a developer key (devKey) from the BILL developer portal and note the organization ID for the target account.
Authenticate by sending POST /v3/login to gateway.stage.bill.com (sandbox) or the production equivalent, with a JSON body containing devKey, username, password, and organizationId.
Extract the sessionId from the login response and include it as a header (sessionId: YOUR_SESSION_ID) on all subsequent requests.
Create an AR customer record if one does not exist by calling POST /v3/customers with the customer's name and contact details.
Create the AR invoice by calling POST /v3/invoices with the customerId, invoice line items, due date, and amount.
Confirm the invoice was created by inspecting the id and status fields in the response.
Known gotchas
BILL v3 authentication uses POST /v3/login, not POST /v3/auth/token; the login endpoint returns a sessionId, not a Bearer token.
API sessions expire after 35 minutes of inactivity; re-authenticate and obtain a fresh sessionId before that window closes.
The devKey is scoped to a specific developer account and organization; using a devKey from a different organization will result in an authentication error.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp