.png)
BILL Integration Guide
BILL integrates with enterprise systems through OAuth-authenticated REST APIs, selected webhook notifications, and document-related API operations.
BILL integration options at a glance
BILL’s primary integration model is its HTTP REST API, which supports access to business objects such as Vendors, Customers, Bills, Invoices, Payments, and Purchase Orders. BILL also provides webhook-style notifications for selected resources and events, although coverage must be confirmed for each use case. Document and attachment operations may be available for accounts-payable workflows, subject to endpoint, permission, and file-format requirements. OAuth 2.0 secures application access. Martini can consume BILL APIs, receive supported notifications, orchestrate scheduled or event-driven workflows, paginate through resources, map JSON payloads, and expose normalized APIs to internal applications.
Common BILL integration patterns
Common BILL data objects used in integrations
Authentication and security considerations
OAuth 2.0 authentication
BILL application integrations use OAuth 2.0 with client credentials, access tokens, token expiration and refresh handling, and environment-specific application configuration. Confirm the current authorization flow, scopes, token endpoints, and sandbox requirements against the BILL developer documentation.
Secrets and permissions
Store BILL client credentials, tokens, and environment values in Martini secrets or secure environment configuration. Apply least-privilege scopes and account permissions, separating read-oriented synchronization from workflows that can create or process financial transactions.
Request validation
For webhook-style notifications, validate authenticity according to BILL’s current requirements, verify required identifiers and event fields, and retrieve the authoritative object before making material downstream changes.
Operational considerations for BILL integrations
Pagination and rate limits
Assume list operations may require pagination unless the resource documentation states otherwise. Process pages incrementally, control concurrency, and use retry delays and backoff for HTTP 429 responses or transient service errors.
Idempotency and financial status
Persist source references and BILL identifiers when creating or updating Bills, Invoices, and Payments. Map approval, payment, cancellation, and settlement statuses explicitly rather than treating them as interchangeable.
Webhooks and schema changes
Design for duplicate, delayed, and out-of-order notifications, incomplete event payloads, and follow-up resource retrieval. Version mappings, preserve unknown fields where appropriate, and test API-version or product changes against sandbox data before production deployment.
Amounts and attachments
Use decimal-safe handling for amounts, taxes, discounts, and payments, and normalize currency and date values explicitly. Confirm attachment encoding, file limits, temporary URL behavior, authentication, retention, and target-system requirements before implementing document transfer.
Why use Martini instead of scripts or point-to-point integrations?
Orchestrate more than API calls
Martini coordinates BILL API consumption, webhook intake, pagination, enrichment, target writes, state management, validation, and reconciliation in maintainable workflows rather than scattering logic across scripts.
Separate mappings from business rules
Reusable mappings and workflow rules can normalize BILL financial objects for different ERPs, accounting platforms, databases, and notification channels while preserving BILL identifiers and lifecycle status.
Improve operational reliability
Martini provides a structured place to handle authentication, retries, throttling, duplicate prevention, logging, monitoring, and environment-specific configuration as integration requirements evolve.
Expose reusable APIs
Martini can expose a controlled API façade that presents normalized BILL data to internal applications, reducing point-to-point dependencies and allowing downstream consumers to remain insulated from BILL API details.