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

# Batch Delete Logistics Recharges

> Delete multiple logistics recharges (fuel consumptions) in a single operation

# Batch Delete Logistics Recharges

Delete multiple logistics recharges in a single API call. This is more efficient than making individual delete calls when removing multiple records.

<Warning>
  **Permanent Action**: Deleting logistics recharges is permanent and cannot be undone. All associated emissions data will be removed from your organization's totals.
</Warning>

## Request

### Headers

<ParamField header="x-api-key" type="string" required>
  Your API key for authentication

  **Example:** `sk_live_1234567890abcdef`
</ParamField>

<ParamField header="x-organization-id" type="string" required>
  Your organization UUID

  **Example:** `a8315ef3-dd50-43f8-b7ce-d839e68d51fa`
</ParamField>

### Body Parameters

<ParamField body="recharge_ids" type="array[string]" required>
  Array of logistics recharge UUIDs to delete

  **Example:** `["550e8400-e29b-41d4-a716-446655440000", "660e8400-e29b-41d4-a716-446655440001"]`
</ParamField>

## Response

Returns `204 No Content` on successful deletion.

## Example

<CodeGroup>
  ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"}}
  curl -X POST "https://api.dcycle.io/v1/logistics/recharges/batch-delete" \
    -H "x-api-key: ${DCYCLE_API_KEY}" \
    -H "x-organization-id: ${DCYCLE_ORG_ID}" \
    -H "Content-Type: application/json" \
    -d '{
      "recharge_ids": [
        "550e8400-e29b-41d4-a716-446655440000",
        "660e8400-e29b-41d4-a716-446655440001"
      ]
    }'
  ```

  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import requests
  import os

  api_key = os.getenv("DCYCLE_API_KEY")
  org_id = os.getenv("DCYCLE_ORG_ID")

  headers = {
      "x-api-key": api_key,
      "x-organization-id": org_id,
      "Content-Type": "application/json"
  }

  payload = {
      "recharge_ids": [
          "550e8400-e29b-41d4-a716-446655440000",
          "660e8400-e29b-41d4-a716-446655440001"
      ]
  }

  response = requests.post(
      "https://api.dcycle.io/v1/logistics/recharges/batch-delete",
      headers=headers,
      json=payload
  )

  if response.status_code == 204:
      print(f"Deleted {len(payload['recharge_ids'])} logistics recharges")
  else:
      print(f"Error: {response.json()}")
  ```

  ```javascript JavaScript theme={"theme":{"light":"github-light","dark":"github-dark"}}
  const axios = require('axios');

  const apiKey = process.env.DCYCLE_API_KEY;
  const orgId = process.env.DCYCLE_ORG_ID;

  const headers = {
    'x-api-key': apiKey,
    'x-organization-id': orgId,
    'Content-Type': 'application/json'
  };

  const payload = {
    recharge_ids: [
      '550e8400-e29b-41d4-a716-446655440000',
      '660e8400-e29b-41d4-a716-446655440001'
    ]
  };

  axios.post(
    'https://api.dcycle.io/v1/logistics/recharges/batch-delete',
    payload,
    { headers }
  )
  .then(response => {
    if (response.status === 204) {
      console.log(`Deleted ${payload.recharge_ids.length} logistics recharges`);
    }
  })
  .catch(error => console.error(error));
  ```
</CodeGroup>

### Successful Response

```
HTTP/1.1 204 No Content
```

No response body is returned on successful deletion.

## Common Errors

### 401 Unauthorized

**Cause:** Missing or invalid API key

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "detail": "Invalid API key",
  "code": "INVALID_API_KEY"
}
```

### 404 Not Found

**Cause:** One or more recharge IDs not found or don't belong to your organization

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "code": "NOT_FOUND",
  "detail": "Logistics recharge not found"
}
```

### 422 Validation Error

**Cause:** Invalid request body format

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "detail": [
    {
      "loc": ["body", "recharge_ids"],
      "msg": "field required",
      "type": "value_error.missing"
    }
  ]
}
```

## Related Endpoints

<CardGroup cols={2}>
  <Card title="Delete Single Recharge" icon="trash" href="/api-reference/logistics/delete-recharge">
    Delete a single logistics recharge
  </Card>

  <Card title="Get Logistics Recharges" icon="gas-pump" href="/api-reference/logistics/get-recharges">
    Retrieve fuel consumption records
  </Card>

  <Card title="Batch Delete Requests" icon="trash-can" href="/api-reference/logistics/batch-delete-requests">
    Delete multiple shipment requests at once
  </Card>
</CardGroup>
