Skip to main content

Overview

Flux provides a robust system for tracking volumes through tickets that capture measurements in and transfers across facilities. This guide will help you understand how to add, update, and review tickets to track your volumes effectively.

Types of Tickets

There are three main types of tickets you can create:
  • Truck Tickets: Track product movements between facilities via trucks
  • Tank Tickets: Record point-in-time measurements of product in storage tanks
  • Meter Tickets: Capture continuous flow measurement data from meters
Each ticket type has specific required fields and validation rules. See the volumes for detailed specifications.

Adding Tickets

To add a new ticket:
  1. Choose the ticket type.
  2. Gather required data (Facility IDs, Entity IDs, timestamps, measurements, etc.).
  3. Search for existing ticket by external_id.
  4. Create the ticket via API.
  5. Retrieve and check for any errors.
  6. Update the ticket if needed.
  7. If no errors, status automatically transitions to PENDING_REVIEW.
Note: While Flux assigns a unique id to each ticket, you provide an external_id that must be unique within your organization. This prevents accidentally creating duplicate tickets.

Workflow

  1. Creation
  2. Validation Automatically triggered on every POST and PATCH request.
    • Existence checks for all referenced entities (e.g. facilities, entities, meters, etc.)
    • Required field validation.
    • Facility type validation (e.g. only one pickup/delivery facility type allowed).
    • Measurement unit validation (e.g. temperature units must not be used for volume fields).
    • Timestamp validation.
    • Volume and reading validations.
    • Status updated based on validation results.
    • Ticket Code validation (e.g. SALE or REC codes require both destination and source fields on Meter Tickets).
    • Anomoly detection and validation. Coming Soon
      Note: For Meter tickets, both destination and source fields are mandatory if the ticket has a SALE or REC code. For all other codes, only destination fields are required.
  3. Review
  4. Resolution
    • Tickets can be updated via API using the appropriate endpoint:
    • Each update triggers revalidation.
    • Each field can have multiple validation errors.
    • Errors must be resolved before status can advance to PENDING_REVIEW.
    • Error history maintained for audit purposes.