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
| Property | Type | Description |
|---|---|---|
| Id | Guid | Unique transaction identifier |
| ProjectId | Guid | Associated project reference |
| Amount | Decimal | Total transaction amount |
| Status | String | Transaction status (Pending, Approved, Declined, etc.) |
| CreatedAt | DateTime | Transaction creation timestamp |
| ProcessedAt | DateTime? | Transaction processing timestamp |
Relationships
- Belongs to a Project
- Has many TransactionItems
- Has many TransactionTags
TransactionItem
Represents individual line items within a transaction.Key properties
| Property | Type | Description |
|---|---|---|
| Id | Guid | Unique item identifier |
| TransactionId | Guid | Parent transaction reference |
| Description | String | Item description |
| Amount | Decimal | Item amount |
| Quantity | Int | Item 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.| Property | Type | Description |
|---|---|---|
| Id | Guid | Unique tag identifier |
| Name | String | Tag name |
| ProjectId | Guid | Associated project |
TransactionTagValue
Stores actual tag values assigned to transactions.| Property | Type | Description |
|---|---|---|
| Id | Guid | Unique value identifier |
| TransactionId | Guid | Associated transaction |
| TagId | Guid | Tag definition reference |
| Value | String | Tag 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
- Created - Initial transaction record
- Pending - Submitted to payment processor
- Approved/Declined - Processor response received
- Settled - Funds transferred
Querying transactions
Transactions can be filtered by:- Project
- Date range
- Status
- Custom tags
- Amount range
