Transaction
Overview
The Transaction
entity is a central part of the system used to record all financial transactions. Each transaction can represent different types of user actions, such as deposits (TOPUP) or token purchases. The entity also tracks the status of transactions, from initiation to success or failure.
Key Concepts:
- Platform: The platform identifier (RentInvesto or Crowdex).
- External ID: Either a ZEN ID or a blockchain transaction hash.
- Statuses:
PENDING
: A new transaction.AWAITING_APPROVAL
: Waiting for admin approval (for bank transfers).PENDING_APPROVAL
: Blockchain transaction initiated (for bank transfers and ZEN).APPROVAL_FAILED
: Blockchain transaction failed.SUCCESSFUL
: Blockchain transaction completed successfully (an email is sent for TOPUP).FAILED
: ZEN declined the transaction.
Attributes
correlationId
- A unique identifier to correlate transactions with external systems or internal processes.
project
- The associated project for the transaction.
user
- The user who initiated the transaction.
provider
- The payment provider used for the transaction (e.g., ZEN or INTERNAL).
paymentMethod
- The payment method chosen by the user.
total
- The total amount of the transaction in the selected currency.
totalUSD
- The total amount of the transaction in USD.
shares
- The number of shares involved in the transaction (if applicable).
sharePrice
- The price per share in the selected currency.
sharePriceUSD
- The price per share in USD.
currency
- The currency used in the transaction (e.g., EUR, USD).
status
- The current status of the transaction. Possible values:
PENDING
AWAITING_APPROVAL
PENDING_APPROVAL
APPROVAL_FAILED
SUCCESSFUL
FAILED
externalId
- The external identifier for the transaction, such as a ZEN ID or blockchain transaction hash.
crowdexProject
- The Crowdex project associated with the transaction (if applicable).
type
- The type of transaction. Possible values:
TOPUP
PURCHASE
REWARD
REWARD_CLAIM
REWARD_EXCHANGE
platform
- The platform where the transaction occurred. Can be either
RentInvesto
orCrowdex
.
error
- A description of any error that occurred during the transaction process.
Transaction Flow
1. TOPUP (Deposit)
When a user deposits funds (via bank transfer, ZEN, or cryptocurrency), a TOPUP
transaction is created. Depending on the provider, the status changes as follows:
PENDING
: The transaction is created.AWAITING_APPROVAL
: For bank transfers, waiting for admin approval.PENDING_APPROVAL
: Blockchain transaction initiated (if applicable).SUCCESSFUL
: Transaction is completed, and an email is sent to the user.FAILED
: The transaction failed, typically for ZEN-related issues.
2. PURCHASE
When a user exchanges project tokens for funds deposited earlier, a PURCHASE
transaction is created. The flow follows a similar pattern to the TOPUP
process.
3. Expiration
If a transaction remains in PENDING
status for 5 days, it is automatically expired, and an email notification is sent to the user.
Status Descriptions
- PENDING: The transaction has just been created.
- AWAITING_APPROVAL: For bank transfers, awaiting admin approval.
- PENDING_APPROVAL: Blockchain transaction initiated (for bank transfers and ZEN transactions).
- APPROVAL_FAILED: Something went wrong during the blockchain transaction process.
- SUCCESSFUL: The transaction was completed successfully. For
TOPUP
, an email is sent to the user. - FAILED: The transaction was declined (typically for ZEN transactions).