Transaction
Model to represent a transaction
- accountType: string
_id requiredAccount ID of the merchant that owns this transaction
- appleType: string
_transaction _id requiredApple Pay transaction identifier
- cardType: stringrequired
Masked card number (e.g., '****1234')
- cardType: string
_brand requiredCard brand (e.g., 'VISA', 'MASTERCARD', 'AMEX')
- cardType: string
_type requiredType of card used ('Credit' or 'Debit')
- createdType: integer
_at requiredTransaction creation timestamp in milliseconds since epoch
- currencyType: stringrequired
ISO 4217 currency code (e.g., 'USD', 'EUR')
- eventType: string
_id requiredUnique identifier for this specific transaction event (for idempotency)
- midType: stringrequired
Merchant ID assigned by Koard
- paymentType: string
_method requiredPayment method used (e.g., 'apple_pay', 'credit_card')
- processorType: string
_mid requiredMerchant ID assigned by the payment processor (e.g., PayRoc)
- processorType: string
_tid requiredTerminal ID assigned by the payment processor
- readerType: string
_identifier requiredUnique identifier for the card reader device
- subtotalType: integerrequired
Subtotal amount in cents (before tax, tip, and surcharge)
- tidType: stringrequired
Terminal ID assigned by Koard
- totalType: integer
_amount requiredTotal transaction amount in cents (subtotal + tax + tip + surcharge)
- transactionType: string
_id requiredUnique identifier for the transaction across all events
- additionalType: object | null
_details Additional transaction details as key-value pairs
- batchType: string | null
_id - deviceType: string | null
_id Physical device identifier (e.g., iPad serial number)
- gatewayType: string | null
Payment gateway used for processing
- gatewayType: string | null
_transaction _id Transaction ID returned by the payment gateway
- gatewayType: object | null
_transaction _response Raw response from the payment gateway
- historyType: array of object | null
Historical events for this transaction
- locationType: string | null
_id Location/store ID where transaction occurred
- merchantType: string | null
_name Name of the merchant for this transaction
- ownerType: string | null
_id - parentType: array of string | null
_account _ids - processorType: string | null
Payment processor name (e.g., 'payroc', 'stripe')
- processorType: string | null
_response _code Response code from the payment processor
- processorType: string | null
_response _message Response message from the payment processor
- refundedType: integer | null
Total amount refunded in cents
- reversedType: integer | null
Total amount reversed in cents
- statusType: string | null
Current transaction status
- statusType: string | null
_reason Reason for the current transaction status
- surchargeType: integer | null
_amount Surcharge amount in cents
- surchargeType: boolean
_applied Whether a surcharge was applied to this transaction
- surchargeType: number | null
_rate Surcharge rate as a decimal (e.g., 0.035 = 3.5%)
- taxType: integer | null
_amount Tax amount in cents
- taxType: integer | null
_rate Tax rate in basis points (e.g., 850 = 8.5%)
- tipType: integer | null
_amount Tip amount in cents
- tipType: string | null
_type Type of tip calculation method
- transactionType: string | null
_type Type of transaction operation

