/Investment
Usage Notes
When
- Remove test investments from development environments
- Delete cancelled investment options before launch
- Clean up duplicate records from data migration
Requirements
- No transactions, price records, or distribution history
- All InvestmentPrice records must be deleted first
Notes
- Investments with transaction history cannot be deleted
- Deletion is permanent with no recovery mechanism
- Alternative: set IsActive=false to maintain audit trail
Description
Permanently deletes an investment. Delete all InvestmentPrice records first. Consider setting IsActive=false as reversible alternative when audit trail preservation matters.
Required Headers - See Authentication
| Header | Value | Description |
|---|---|---|
| Authorization | {accessToken} | Bearer token for API access |
| Version | 2.0 | API version identifier |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ProductID |
integer | Native 7G product identifier for ownership validation during deletion. | |
ExternalProductId |
string | Client product reference for ownership validation during deletion. | |
InvestmentID |
integer | Native 7G investment identifier (most efficient deletion method). | |
ExternalInvestmentId |
string(50) | Client investment identifier (requires ProductID or ExternalProductId for scoping). |
Parameter Options
Choose one of these identification methods:
- Option 1: investmentID only (most efficient)
- Option 2: productID + externalInvestmentId
- Option 3: externalProductId + externalInvestmentId
- Option 4: productID + investmentID (for additional validation)
Note: All combinations validate product ownership before deletion.
SecurityCode is NOT Accepted on DELETE
Unlike GET and most write endpoints, DELETE /Investment only accepts
InvestmentID or ExternalInvestmentId as identifiers. Passing
SecurityCode as a query parameter has no effect - if neither of the two accepted
identifiers is supplied the controller rejects the request with:
"Either InvestmentID or ExternalInvestmentId must be provided!"
If you only have a SecurityCode, resolve it to an InvestmentID first via
GET /Investment?SecurityCode=...&ProductID=...,
then delete by that ID.
Example Requests
# Delete investment by ID only
curl -X DELETE 'https://api.7g.com.au/Investment?InvestmentID=12345' \
-H 'Authorization: {accessToken}' \
-H 'Version: 2.0'
# Delete by product ID and investment ID (recommended for validation)
curl -X DELETE 'https://api.7g.com.au/Investment?ProductID=100&InvestmentID=12345' \
-H 'Authorization: {accessToken}' \
-H 'Version: 2.0'
# Delete by external IDs combination
curl -X DELETE 'https://api.7g.com.au/Investment?ExternalProductId=FUND-001&ExternalInvestmentId=INV-001' \
-H 'Authorization: {accessToken}' \
-H 'Version: 2.0'
# Delete by product ID and external investment ID
curl -X DELETE 'https://api.7g.com.au/Investment?ProductID=100&ExternalInvestmentId=INV-001' \
-H 'Authorization: {accessToken}' \
-H 'Version: 2.0'Response Examples
{
"result": true,
"message": "Investment deleted successfully",
"recordCount": 0,
"data": null
}