Provisioned devices missing billing attributes in billing engine integration

Devices successfully provisioning through our onboarding workflow are missing critical billing attributes when they sync to our billing engine. The billing attribute mapping appears configured correctly in the provisioning workflow, but the attributes aren’t transferring to the billing system. This is causing incomplete billing records and revenue leakage.

The integration logs show:


BillingSync: Device METER-4421 synced successfully
Warning: Missing required attributes - rateClass, billingCycle, accountId
Billing record created with incomplete data

The onboarding workflow integration sets these attributes during provisioning, and they’re visible in the ThingWorx device properties, but they’re not flowing through to the billing engine. We need post-provisioning validation to catch these issues before devices go operational. Has anyone dealt with billing attribute synchronization problems between ThingWorx and external billing systems?

Don’t forget about data type mismatches. Billing engines often have strict type requirements - a string where an integer is expected will cause the field to be dropped during sync. Check your attribute data types in ThingWorx match the billing engine schema exactly.

The timing issue could definitely be a factor. Our billing sync is configured as part of the provisioning workflow, but I’m not certain it waits for all attribute assignments to complete. How do you implement proper sequencing to ensure attributes are set before sync triggers?

Also verify the timing of the billing sync. If the sync service is triggered before the provisioning workflow completes setting all attributes, you’ll get partial data transfer. The onboarding workflow should have a completion event that triggers billing sync, not an immediate parallel sync during provisioning. We had this exact problem with our ERP integration - sync was happening too early in the workflow.

Here’s a comprehensive solution addressing all three focus areas:

Billing Attribute Mapping: Your issue stems from multiple mapping problems. First, implement explicit attribute mapping configuration:


// Define billing attribute mapping
var billingMap = {
  thingworx_rateClass: "billing_rate_class",
  thingworx_billingCycle: "billing_cycle_code",
  thingworx_accountId: "account_number"
};

Key mapping requirements:

  1. Verify exact field name matching between ThingWorx properties and billing engine schema (case-sensitive)
  2. Validate data type compatibility - use explicit type conversion where needed
  3. Handle null/undefined values gracefully - billing engines often reject records with null required fields
  4. Implement default value logic for optional attributes
  5. Document all mapping transformations (e.g., date format conversions, enumeration mappings)

Create a dedicated billing attribute service that encapsulates all mapping logic and validation. This centralizes transformation rules and makes troubleshooting easier than scattered mapping code throughout workflows.

Onboarding Workflow Integration: The timing issue you suspected is likely a major contributor. Restructure your provisioning workflow with proper state management:

Workflow stages:

  1. Device Registration: Create Thing, assign device identifier
  2. Attribute Assignment: Set all device properties including billing attributes
  3. Validation Checkpoint: Verify all required attributes present and valid
  4. External System Sync: Trigger billing engine integration
  5. Completion: Mark device as fully provisioned

Critical implementation details:

  • Use workflow subscription or completion events, NOT parallel execution for billing sync
  • Add explicit wait conditions between stages (e.g., wait for attribute assignment completion before validation)
  • Implement rollback logic - if billing sync fails, mark device provisioning as incomplete
  • Log detailed workflow state transitions for troubleshooting

The billing sync must occur AFTER all attributes are set and validated. Configure your workflow to trigger billing sync only when the validation checkpoint confirms all required billing attributes are present and correctly formatted.

Post-Provisioning Validation: This is your missing safety net. Implement comprehensive validation before external sync:

Validation service implementation:

  1. Required attribute check: Verify presence of rateClass, billingCycle, accountId, and any other mandatory billing fields
  2. Data type validation: Confirm each attribute matches billing engine schema requirements
  3. Value range validation: Check that enumerated values (like rateClass) match billing engine’s allowed values
  4. Reference validation: Verify accountId exists in billing system before attempting device sync
  5. Completeness scoring: Calculate percentage of optional attributes populated for audit purposes

Validation should return detailed results:

  • Pass/fail status
  • List of missing required attributes
  • List of invalid attribute values with specific errors
  • Recommendations for remediation

If validation fails:

  • Block billing sync from executing
  • Set device provisioning status to “incomplete - billing attributes missing”
  • Generate alert for operations team with specific attribute issues
  • Queue device for manual review and correction

Implement automated retry logic:

  • After attributes are corrected, automatically retry validation and billing sync
  • Track retry attempts and escalate if device remains unsynced after 3 attempts
  • Maintain audit log of all validation attempts and outcomes

For your immediate situation:

  1. Audit existing provisioned devices to identify all affected units with incomplete billing records
  2. Create a remediation script that re-syncs devices after validating billing attributes are now present
  3. Implement the validation checkpoint in your provisioning workflow before deploying new devices
  4. Add monitoring alerts for billing sync failures to catch issues immediately
  5. Schedule weekly audit reports comparing ThingWorx device count to billing engine device count to identify sync gaps

This solution prevents revenue leakage by ensuring billing attributes are complete and validated before sync, provides immediate feedback when issues occur, and maintains data integrity between ThingWorx and your billing system.

Use workflow state management with explicit dependencies. Your provisioning workflow should have distinct states: device registration, attribute assignment, validation, and external sync. Each state should only proceed when the previous state completes successfully. Add validation checkpoints that verify required attributes exist before allowing transition to sync state.

Good point on data types. I’ll audit the type mappings along with fixing the workflow sequencing. We need a comprehensive validation step before sync attempts.