> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agribackup.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Retrieve Batch Cryptographic Evidence

> Fetch Hedera DLT-anchored cryptographic evidence for a batch, including transaction IDs, consensus timestamp, Merkle root hash, and state proofs of inclusion.

Every batch that completes satellite deforestation screening is anchored to the Hedera Hashgraph distributed ledger, producing tamper-evident cryptographic evidence of its compliance state at a specific point in time. You can retrieve this evidence bundle at any time using the batch identifier. The response includes all Hedera consensus transaction IDs associated with the batch, the Merkle root hash anchored on-ledger, and a set of Hedera state proofs that independently verify the batch record was included in the ledger state — forming the foundation of your EUDR cryptographic audit trail.

## Endpoint

`GET /api/v1/enterprise/eudr/evidence/ledger/batch/{batchId}`

## Path Parameters

<ParamField path="batchId" type="string" required>
  The unique identifier of the batch whose cryptographic evidence you want to retrieve. Evidence is available once the batch has completed the asynchronous DLT anchoring process, confirmed by the `batch.risk_assessed` webhook event.
</ParamField>

## Response Fields

<ResponseField name="entityId" type="string">
  The batch identifier for which this evidence bundle was generated.
</ResponseField>

<ResponseField name="entityType" type="string">
  The type of entity for which evidence was anchored. Will be `BATCH` for this endpoint.
</ResponseField>

<ResponseField name="hederaTransactionIds" type="array">
  An array of all Hedera consensus transaction IDs associated with this batch across all anchoring operations. Each ID can be independently verified on the Hedera Mirror Node at `https://mainnet-public.mirrornode.hedera.com`.
</ResponseField>

<ResponseField name="merkleRootHash" type="string">
  The Merkle root hash anchored on the Hedera ledger at the time of the batch compliance anchoring event. Use this to independently reconstruct and verify the batch record's inclusion in the ledger state.
</ResponseField>

<ResponseField name="stateProofs" type="array">
  An array of Hedera state proof objects for independent audit verification.

  <Expandable title="stateProofs fields">
    <ResponseField name="stateProofs[].hederaTransactionId" type="string">
      The Hedera HCS transaction ID for this specific state proof entry.
    </ResponseField>

    <ResponseField name="stateProofs[].consensusTimestamp" type="string">
      The Hedera consensus timestamp assigned at the moment this transaction reached finality. This timestamp is cryptographically binding and cannot be altered retroactively.
    </ResponseField>

    <ResponseField name="stateProofs[].merkleProof" type="string">
      The Merkle proof path JSON for cryptographic inclusion verification.
    </ResponseField>

    <ResponseField name="stateProofs[].operationType" type="string">
      The ledger operation type recorded for this state proof entry (e.g., `CREATED`).
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="consensusTimestamp" type="string">
  The primary Hedera consensus timestamp (ISO-8601) of the batch anchoring event.
</ResponseField>

## Code Examples

<CodeGroup>
  ```python Python theme={null}
  import agribackup
  from agribackup.rest import ApiException

  configuration = agribackup.Configuration(host="https://live.agribackup.com/api/v1")
  configuration.api_key['ApiKeyAuth'] = 'sk_live_YOUR_API_KEY'

  with agribackup.ApiClient(configuration) as api_client:
      try:
          evidence_api = agribackup.EnterpriseEvidenceApi(api_client)

          batch_id = "batch_a1b2c3d4e5"
          response = evidence_api.get_batch_evidence(batch_id=batch_id)

          print("Entity ID:", response.entity_id)
          print("Merkle Root Hash:", response.merkle_root_hash)
          print("Consensus Timestamp:", response.consensus_timestamp)
          print("Transaction IDs:", response.hedera_transaction_ids)
          for proof in response.state_proofs:
              print(f"  Proof TX: {proof.hedera_transaction_id} | Op: {proof.operation_type}")

      except ApiException as e:
          print("Exception when calling EnterpriseEvidenceApi: %s\n" % e)
  ```

  ```javascript Node.js theme={null}
  import { AgriBackupClient } from '@agribackup/sdk';

  const client = new AgriBackupClient({
    apiKey: 'sk_live_YOUR_API_KEY',
    baseUrl: 'https://live.agribackup.com/api/v1'
  });

  async function getBatchEvidence() {
    try {
      const batchId = 'batch_a1b2c3d4e5';
      const response = await client.evidence.getBatchEvidence(batchId);

      console.log('Entity ID:', response.entityId);
      console.log('Merkle Root Hash:', response.merkleRootHash);
      console.log('Consensus Timestamp:', response.consensusTimestamp);
      console.log('Transaction IDs:', response.hederaTransactionIds);
      response.stateProofs.forEach(proof => {
        console.log(`  Proof TX: ${proof.hederaTransactionId} | Op: ${proof.operationType}`);
      });
    } catch (error) {
      console.error('Error retrieving batch evidence:', error.message);
    }
  }

  getBatchEvidence();
  ```

  ```bash cURL theme={null}
  curl --request GET \
    --url https://live.agribackup.com/api/v1/enterprise/eudr/evidence/ledger/batch/batch_a1b2c3d4e5 \
    --header 'X-API-Key: sk_live_YOUR_API_KEY'
  ```
</CodeGroup>

## Example Response

```json theme={null}
{
  "entityId": "batch_a1b2c3d4e5",
  "entityType": "BATCH",
  "hederaTransactionIds": [
    "0.0.12345@1713583200.000000000"
  ],
  "merkleRootHash": "0xabc123def456789abcdef0123456789abcdef0123456789abcdef0123456789",
  "stateProofs": [
    {
      "hederaTransactionId": "0.0.12345@1713583200.000000000",
      "consensusTimestamp": "2026-07-14T17:23:11",
      "merkleProof": "{\"path\":[\"0xfedcba...\",\"0x0f1e2d...\"],\"root\":\"0xabc123...\"}",
      "operationType": "CREATED"
    }
  ],
  "consensusTimestamp": "2026-07-14T17:23:11Z"
}
```

<Tip>
  You can independently verify each transaction ID using the public Hedera Mirror Node at `https://mainnet-public.mirrornode.hedera.com/api/v1/transactions/{transactionId}`. This verifiability is a core feature of the AgriBackup cryptographic compliance architecture.
</Tip>
