DELETE

/BizEntity

When to Use

  • Remove test entities from development environments
  • Delete duplicate entities from data migration errors
  • Clean up entities created in error with no transaction history

Prerequisites

  • Entity must have zero transaction history, zero balances, and no active distributions

Considerations

  • Entities with any transaction records cannot be deleted
  • Deletion is permanent and cannot be undone
  • All related data is cascade deleted (accounts, addresses, parties, communications, payment details, parent relationships)
  • Alternative: Use PUT /BizEntity to set status to Inactive (2) instead of deleting

Description

Permanently removes an entity and all associated data (accounts, addresses, parties, communications, payment details, parent relationships). The API prevents deletion of entities with any transaction history or non-zero account balances.

Validation Before Deletion: Verify the entity has zero transactions using GET /BizTransaction before attempting deletion.

Recommended Alternative: For entities with transaction history, use PUT /BizEntity to update bizEntityStatusID to Inactive (2) or Suspended (3) instead. This preserves audit trails and allows reactivation if needed.

Required Headers - See Authentication

HeaderValueDescription
Authorization{accessToken}Bearer token for API access
Version2.0API version identifier

Query Parameters

Parameter Type Required Description
BizEntityID >
integer
Native 7G identifier for direct entity deletion. Fastest performance using primary index for high-frequency operations.
ExternalBizEntityId >
string
External system identifier for dual-ID deletion workflows. Slower than BizEntityID due to secondary index lookup.
BizEntityID
integer
Native 7G identifier for direct entity deletion. Fastest performance using primary index for high-frequency operations.
ExternalBizEntityId
string
External system identifier for dual-ID deletion workflows. Slower than BizEntityID due to secondary index lookup.

Example Requests

bash
# Delete by native 7G ID (fastest performance)
curl -X DELETE 'https://api.7g.com.au/BizEntity?BizEntityID=12345' \
  -H 'Authorization: {accessToken}' \
  -H 'Version: 2.0'

# Delete by external ID (dual-ID system)
curl -X DELETE 'https://api.7g.com.au/BizEntity?ExternalBizEntityId=EXT-DEV-001' \
  -H 'Authorization: {accessToken}' \
  -H 'Version: 2.0'

# Safe deletion with verification (recommended workflow)
# Step 1: Verify entity exists and check structure
curl -X GET 'https://api.7g.com.au/BizEntity?BizEntityID=12345' \
  -H 'Authorization: {accessToken}' \
  -H 'Version: 2.0'

# Step 2: Verify no transaction history
curl -X GET 'https://api.7g.com.au/BizTransaction?BizEntityID=12345' \
  -H 'Authorization: {accessToken}' \
  -H 'Version: 2.0'

# Step 3: Execute deletion if validation passes
curl -X DELETE 'https://api.7g.com.au/BizEntity?BizEntityID=12345' \
  -H 'Authorization: {accessToken}' \
  -H 'Version: 2.0'

Response Examples

json
{
  "result": true,
  "message": "Entity deleted successfully",
  "recordCount": 0,
  "data": []
}