> ## 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.

# List EUDR Batches | AgriBackup API Reference

> Retrieve a cursor-paginated list of all registered EUDR batches for your organisation, with optional filtering by update timestamp.

Returns a cursor-paginated list of all EUDR batches registered under your organisation. Use this endpoint to synchronise batch records with your ERP, monitor risk assessment progress, or build compliance dashboards. Each record in the response includes the batch's `batchCode`, `batchId`, and current `status`. For full detail including linked polygon IDs and shipment IDs, fetch individual batches using `GET /api/v1/enterprise/eudr/batches/{batchId}`.

## Request Headers

| Header      | Required | Description                            |
| ----------- | -------- | -------------------------------------- |
| `X-API-Key` | ✅        | Your live API key, e.g. `sk_live_...`. |

## Query Parameters

| Parameter        | Type              | Default | Description                                                                        |
| ---------------- | ----------------- | ------- | ---------------------------------------------------------------------------------- |
| `starting_after` | string            | —       | Cursor value from the previous page's `nextCursor` field. Omit for the first page. |
| `updated_after`  | string (ISO-8601) | —       | Return only batches updated after this timestamp.                                  |
| `limit`          | integer           | `100`   | Maximum number of records to return per page.                                      |

## Response — 200 OK

| Field        | Type           | Description                                                                       |
| ------------ | -------------- | --------------------------------------------------------------------------------- |
| `data`       | array          | List of batch summary objects (see below).                                        |
| `hasMore`    | boolean        | `true` if additional records exist beyond this page.                              |
| `nextCursor` | string \| null | Pass to `starting_after` for the next page. `null` when no further records exist. |

Each item in `data` contains:

| Field       | Type   | Description                                                               |
| ----------- | ------ | ------------------------------------------------------------------------- |
| `batchId`   | string | Unique internal batch identifier (UUID).                                  |
| `batchCode` | string | Human-readable compliance code, e.g. `COFFEE-KE-20260612-ABCDEF`.         |
| `status`    | string | Lifecycle status: `PENDING_RISK_ASSESSMENT`, `COMPLIANT`, or `HIGH_RISK`. |

```json theme={null}
{
  "data": [
    {
      "batchId": "uuid-1234",
      "batchCode": "COFFEE-KE-20260612-ABCDEF",
      "status": "COMPLIANT"
    }
  ],
  "hasMore": false,
  "nextCursor": null
}
```

## 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:
          api_instance = agribackup.EnterpriseBatchesApi(api_client)
          response = api_instance.get_batches(limit=100)

          for batch in response.data:
              print(batch.batch_id, batch.batch_code, batch.status)

          if response.has_more:
              next_page = api_instance.get_batches(
                  starting_after=response.next_cursor,
                  limit=100
              )
      except ApiException as e:
          print("Error:", 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 listBatches() {
    try {
      const response = await client.batches.getBatches({ limit: 100 });

      for (const batch of response.data) {
        console.log(batch.batchId, batch.batchCode, batch.status);
      }

      if (response.hasMore) {
        const nextPage = await client.batches.getBatches({
          startingAfter: response.nextCursor,
          limit: 100
        });
      }
    } catch (error) {
      console.error('Error:', error.message);
    }
  }
  ```

  ```bash cURL theme={null}
  curl -G https://live.agribackup.com/api/v1/enterprise/eudr/batches \
    -H "X-API-Key: sk_live_YOUR_API_KEY" \
    --data-urlencode "limit=100"
  ```
</CodeGroup>


## OpenAPI

````yaml get /api/v1/enterprise/eudr/batches
openapi: 3.0.1
info:
  title: AgriBackup Enterprise EUDR API
  description: >-
    # Introduction


    AgriBackup is the cryptographic compliance engine for EU-bound commodity
    imports. Built on Deterministic Logic, Immutable Evidence, and
    High-Throughput Ingestion, our API provides Tier-1 enterprise routing for EU
    Deforestation Regulation (EUDR).


    ## The Integration Vector

    To integrate this Digital Trust Layer into your ERP, you must execute the
    following sequence:

    1. **Authentication:** Generate your `X-API-Key` from the client dashboard.

    2. **Telemetry:** Register your webhook URLs via `POST /webhooks`.

    3. **Ingestion:** Push your GeoJSON polygons via `POST /polygons`.

    4. **Logistics:** Lock the batch to a shipment via `POST /shipments/link`.


    ## Asynchronous Architecture

    Because satellite deforestation screening and Hedera DLT anchoring take
    time, ingestion endpoints return a `202 Accepted`. You must listen for the
    corresponding Webhook to confirm cryptographic execution.


    ## Base URLs

    * **Production:** `https://live.agribackup.com`

    * **Sandbox:** `https://sandbox.agribackup.com`
  contact:
    name: AgriBackup Architecture Team
    url: https://agribackup.com
    email: contact@agribackup.com
  license:
    name: Proprietary
    url: https://agribackup.com/terms
  version: v1.0
servers:
  - url: https://live.agribackup.com
    description: Production (Mainnet)
  - url: https://sandbox.agribackup.com
    description: Sandbox (Testnet)
security: []
tags:
  - name: Enterprise Risk Management
  - name: Enterprise Clearance Webhooks
    description: Asynchronous status receivers for TRACES NT
  - name: Enterprise Jobs
    description: Query status and metrics of asynchronous compliance jobs
  - name: Enterprise Suppliers
  - name: Enterprise Diagnostics
    description: Monitor API health, consensus ledger, and satellite systems availability
  - name: Enterprise Suppliers
    description: Map internal ERP vendor IDs to EU Operator UUIDs
  - name: Enterprise Webhooks
    description: Register endpoints for asynchronous compliance events
  - name: Enterprise Archival
    description: Endpoints for bulk compliance archiving and auditor extensibility
  - name: Enterprise Logistics
    description: Smart contract linking of batches to logistics shipments
  - name: Enterprise Declarations
    description: DDS generation with legal land tenure proofs
  - name: Enterprise Batches
  - name: Enterprise API Keys
  - name: Enterprise Diagnostics
  - name: Enterprise Logistics
  - name: Enterprise Jobs
  - name: Enterprise Evidence
    description: Cryptographic evidence ledger anchored on Hedera Hashgraph
  - name: Enterprise Declarations
  - name: Enterprise Credentials
  - name: Enterprise Evidence
  - name: Enterprise Risk Management
    description: Pre-assessment of country risk and satellite deforestation probabilities
  - name: Enterprise Batches
    description: Programmatic batch ingestion and management
  - name: Enterprise Polygons
  - name: Introduction
  - name: Enterprise Polygons
    description: Programmatic polygon ingestion and verification
  - name: Enterprise Archival
  - name: Enterprise Credentials
    description: Programmatic ingestion of vault-secured enterprise secrets
  - name: Enterprise API Keys
    description: Endpoints for managing B2B API Keys (Requires standard JWT login)
  - name: Enterprise Webhooks
paths:
  /api/v1/enterprise/eudr/batches:
    get:
      tags:
        - Enterprise Batches
      summary: List Batches
      description: Retrieves a cursor-paginated list of registered EUDR batches.
      operationId: getBatches
      parameters:
        - name: starting_after
          in: query
          required: false
          schema:
            type: string
        - name: updated_after
          in: query
          required: false
          schema:
            type: string
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            format: int32
            default: 100
      responses:
        '200':
          description: List of batches successfully retrieved
          headers:
            X-RateLimit-Limit:
              description: >-
                The maximum number of requests you're permitted to make per
                hour.
              schema:
                type: integer
                format: int32
            X-RateLimit-Remaining:
              description: >-
                The number of requests remaining in the current rate limit
                window.
              schema:
                type: integer
                format: int32
            X-RateLimit-Reset:
              description: >-
                The time at which the current rate limit window resets in UTC
                epoch seconds.
              schema:
                type: integer
                format: int32
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnterpriseBatchCollectionResponse'
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: Python
          source: >-
            import agribackup

            from agribackup.rest import ApiException


            # Initialize Client

            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:
                    api_instance = agribackup.EnterpriseBatchesApi(api_client)
                    response = api_instance.get_batches()
                    print(response)
                except ApiException as e:
                    print("Exception when calling API: %s\n" % e)
        - lang: Node.js
          source: |-
            import { AgriBackupClient } from '@agribackup/sdk';

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

            async function execute() {
              try {
                const response = await client.batches.getBatches();
                console.log(response);
              } catch (error) {
                console.error(error);
              }
            }
        - lang: Java
          source: |-
            import com.agribackup.client.*;
            import com.agribackup.client.api.*;
            import com.agribackup.client.model.*;

            public class Example {
                public static void main(String[] args) {
                    ApiClient defaultClient = Configuration.getDefaultApiClient();
                    defaultClient.setBasePath("https://live.agribackup.com/api/v1");
                    defaultClient.setApiKey("sk_live_YOUR_API_KEY");

                    EnterpriseBatchesApi apiInstance = new EnterpriseBatchesApi(defaultClient);
                    try {
                        Object result = apiInstance.getBatches();
                        System.out.println(result);
                    } catch (ApiException e) {
                        System.err.println("Exception when calling API: " + e.getResponseBody());
                    }
                }
            }
        - lang: C#
          source: |-
            using System;
            using System.Threading.Tasks;
            using AgriBackup.SDK.Api;
            using AgriBackup.SDK.Client;
            using AgriBackup.SDK.Model;

            class Program {
                static async Task Main() {
                    Configuration config = new Configuration();
                    config.BasePath = "https://live.agribackup.com/api/v1";
                    config.AddApiKey("ApiKeyAuth", "sk_live_YOUR_API_KEY");

                    var apiInstance = new EnterpriseBatchesApi(config);
                    try {
                        var result = await apiInstance.GetBatchesAsync();
                        Console.WriteLine(result);
                    } catch (ApiException e) {
                        Console.WriteLine("Exception when calling API: " + e.Message);
                    }
                }
            }
components:
  schemas:
    EnterpriseBatchCollectionResponse:
      required:
        - data
        - hasMore
      type: object
      properties:
        data:
          type: array
          description: List of batch records
          items:
            $ref: '#/components/schemas/BatchRegistrationResponse'
        hasMore:
          type: boolean
          description: Indicates if there are more records available
        nextCursor:
          type: string
          description: Cursor to use in the 'starting_after' parameter for the next page
          nullable: true
      description: Paginated list of enterprise batches
    BatchRegistrationResponse:
      required:
        - batchCode
        - batchId
        - status
      type: object
      properties:
        batchId:
          type: string
          description: Internal database ID of the batch
          example: uuid-1234
        batchCode:
          type: string
          description: Unique compliance code for this batch
          example: COFFEE-KE-20260612-ABCDEF
        status:
          type: string
          description: Hedera anchoring status
          example: PENDING_RISK_ASSESSMENT
          enum:
            - PENDING_RISK_ASSESSMENT
            - COMPLIANT
            - HIGH_RISK
      description: Response after registering a batch
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      description: Enterprise API Key provided via the AgriBackup developer console.
      name: X-API-Key
      in: header

````