Skip to main content

Overview

BoxBilling supports integrations with external systems for accounting, CRM, and payment processing. Each organization can connect one integration per provider type.

Integration types

TypeDescriptionSupported providers
payment_providerPayment processingStripe, Adyen, GoCardless
accountingFinancial syncNetSuite, Xero
crmCustomer syncHubSpot, Salesforce
taxTax calculationAnrok, Avalara

Creating an integration

curl -X POST /v1/integrations \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "integration_type": "accounting",
    "provider_type": "xero",
    "settings": {
      "client_id": "...",
      "client_secret": "...",
      "tenant_id": "..."
    }
  }'
Only one integration per provider type is allowed per organization.

Testing a connection

POST /v1/integrations/{id}/test
Returns:
{
  "success": true,
  "details": {
    "connected": true,
    "organization_name": "My Company"
  }
}

Integration adapters

BoxBilling uses a strategy-based adapter pattern. Each provider implements the IntegrationAdapter interface:
MethodDescription
sync_customer(customer_id)Sync customer data to external system
sync_invoice(invoice_id)Sync invoice to external system
sync_payment(payment_id)Sync payment to external system
process_webhook(payload)Handle incoming webhooks
test_connection()Verify credentials and connectivity

Sync result

All adapter methods return an IntegrationSyncResult:
{
  "success": true,
  "external_id": "EXT-12345",
  "external_data": {"name": "Customer Inc"},
  "error": null
}

Integration mappings

Integration mappings track the relationship between BoxBilling entities and their external counterparts:
FieldDescription
integration_idThe integration this mapping belongs to
mappable_typeEntity type (e.g. customer, invoice)
mappable_idBoxBilling entity UUID
external_idExternal system’s ID
external_dataCached data from external system
last_synced_atLast synchronization timestamp

Integration customers

Direct customer-level mappings between BoxBilling customers and their external representations:
{
  "integration_id": "integration-uuid",
  "customer_id": "customer-uuid",
  "external_customer_id": "EXT-CUST-001",
  "settings": {}
}

Integration statuses

StatusDescription
activeIntegration is operational
inactiveIntegration is disabled
errorIntegration has encountered errors
When an integration encounters errors, the error_details JSON field contains diagnostic information.

API endpoints

MethodPathDescription
POST/v1/integrationsCreate integration
GET/v1/integrationsList integrations
GET/v1/integrations/{id}Get integration details
PUT/v1/integrations/{id}Update integration
DELETE/v1/integrations/{id}Delete integration
POST/v1/integrations/{id}/testTest connection