Skip to main content

Transaction models

Transaction models represent the core payment processing entities in Chargeworx. These models capture payment transactions, their line items, and associated metadata.

Transaction

The primary entity representing a payment transaction in the system.

Key properties

PropertyTypeDescription
IdGuidUnique transaction identifier
ProjectIdGuidAssociated project reference
AmountDecimalTotal transaction amount
StatusStringTransaction status (Pending, Approved, Declined, etc.)
CreatedAtDateTimeTransaction creation timestamp
ProcessedAtDateTime?Transaction processing timestamp

Relationships

  • Belongs to a Project
  • Has many TransactionItems
  • Has many TransactionTags

TransactionItem

Represents individual line items within a transaction.

Key properties

PropertyTypeDescription
IdGuidUnique item identifier
TransactionIdGuidParent transaction reference
DescriptionStringItem description
AmountDecimalItem amount
QuantityIntItem quantity

Relationships

  • Belongs to a Transaction

TransactionTag / TransactionTagValue

Custom metadata tags that can be attached to transactions for categorization and filtering.

TransactionTag

Defines available tag types for transactions.
PropertyTypeDescription
IdGuidUnique tag identifier
NameStringTag name
ProjectIdGuidAssociated project

TransactionTagValue

Stores actual tag values assigned to transactions.
PropertyTypeDescription
IdGuidUnique value identifier
TransactionIdGuidAssociated transaction
TagIdGuidTag definition reference
ValueStringTag value

Relationships

  • TransactionTag belongs to a Project
  • TransactionTagValue belongs to a Transaction and references a TransactionTag

Usage patterns

Creating a transaction

Transactions are created through the payment API and associated with a specific project. Each transaction can contain multiple line items and custom tags.

Transaction lifecycle

  1. Created - Initial transaction record
  2. Pending - Submitted to payment processor
  3. Approved/Declined - Processor response received
  4. Settled - Funds transferred

Querying transactions

Transactions can be filtered by:
  • Project
  • Date range
  • Status
  • Custom tags
  • Amount range