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

# Generate WTN

> Generate a fully structured digital Waste Transfer Note

# Generate WTN

Generates a fully structured, compliance-checked digital Waste Transfer Note. This is a composite endpoint that runs carrier verification and waste classification in parallel internally, then combines the results into a single WTN document.

Each WTN is persisted with a unique reference and can be retrieved later via [GET /v1/wtn/{reference}](/api-reference/wtn-retrieve).

<Note>
  Requires authentication via `Authorization` header. See [Authentication](/authentication).
</Note>

## Request

**Method:** `POST`
**Path:** `/v1/generate-wtn`

### Headers

<ParamField header="Authorization" type="string" required>
  Bearer token with your API key, e.g. `Bearer wc_live_your_key`
</ParamField>

<ParamField header="Content-Type" type="string" required>
  Must be `application/json`
</ParamField>

### Body Parameters

<ParamField body="producer" type="object" required>
  The business producing the waste
</ParamField>

<ParamField body="producer.name" type="string" required>
  Business name
</ParamField>

<ParamField body="producer.address" type="string" required>
  Business address
</ParamField>

<ParamField body="producer.sic_code" type="string">
  SIC code for the producer's industry
</ParamField>

<ParamField body="producer.contact_name" type="string">
  Contact person's name
</ParamField>

<ParamField body="carrier" type="object" required>
  The waste carrier
</ParamField>

<ParamField body="carrier.registration_number" type="string" required>
  CBDU/CBDL registration number
</ParamField>

<ParamField body="carrier.auto_verify" type="boolean">
  Verify against EA register (default: `true`)
</ParamField>

<ParamField body="waste" type="object" required>
  Details of the waste being transferred
</ParamField>

<ParamField body="waste.description" type="string" required>
  Plain-English waste description
</ParamField>

<ParamField body="waste.auto_classify" type="boolean">
  Classify into EWC codes (default: `true`)
</ParamField>

<ParamField body="waste.ewc_code" type="string">
  Provide directly if `auto_classify` is `false`
</ParamField>

<ParamField body="waste.quantity_kg" type="number">
  Weight in kilograms
</ParamField>

<ParamField body="waste.container_type" type="string">
  Container type (e.g. `skip`, `wheelie_bin`, `drum`)
</ParamField>

<ParamField body="destination" type="object" required>
  The receiving waste facility
</ParamField>

<ParamField body="destination.name" type="string" required>
  Facility name
</ParamField>

<ParamField body="destination.address" type="string" required>
  Facility address
</ParamField>

<ParamField body="destination.permit_number" type="string">
  Environmental permit number (e.g. `EPR/AB1234CD`)
</ParamField>

<ParamField body="transfer_date" type="string" required>
  Date of waste transfer (YYYY-MM-DD format)
</ParamField>

## Response

### Success Response (201)

```json theme={null}
{
  "reference": "WTN-2026-0325-A7X9",
  "status": "complete",
  "producer": {
    "name": "ABC Office Fit-out Ltd",
    "address": "45 High Street, Bournemouth, BH1 2AA",
    "sic_code": "43320"
  },
  "carrier": {
    "registration_number": "CBDU217016",
    "business_name": "ACME WASTE SERVICES LTD",
    "tier": "upper",
    "verified": true,
    "expiry_date": "2027-01-15"
  },
  "waste": {
    "description": "Broken plasterboard from office refurbishment",
    "ewc_code": "17 08 02",
    "ewc_description": "Gypsum-based construction materials",
    "is_hazardous": false,
    "quantity_kg": 2500,
    "container_type": "skip"
  },
  "destination": {
    "name": "South Coast Recycling Ltd",
    "address": "Industrial Estate, Poole, BH15 1NF",
    "permit_number": "EPR/AB1234CD"
  },
  "duty_of_care": {
    "producer_identified": true,
    "carrier_verified": true,
    "waste_classified": true,
    "destination_provided": true,
    "all_checks_passed": true
  },
  "compliance": {
    "is_compliant": true,
    "flags": [],
    "warnings": []
  },
  "transfer_date": "2026-03-25",
  "created_at": "2026-03-25T14:32:00Z"
}
```

<ResponseField name="reference" type="string">
  Unique WTN reference (e.g. `WTN-2026-0325-A7X9`). Use this to retrieve the WTN later.
</ResponseField>

<ResponseField name="duty_of_care" type="object">
  Confirms whether each legal requirement for waste transfer is met
</ResponseField>

<ResponseField name="duty_of_care.all_checks_passed" type="boolean">
  True only when all duty of care checks pass
</ResponseField>

### Duty of Care Checklist

| Field                  | Description                                           |
| ---------------------- | ----------------------------------------------------- |
| `producer_identified`  | Producer name and address are provided                |
| `carrier_verified`     | Carrier registration verified against the EA register |
| `waste_classified`     | Waste has been classified with a valid EWC code       |
| `destination_provided` | Destination facility name and address are provided    |
| `all_checks_passed`    | True only when all above checks pass                  |

### Performance Notes

Total latency is typically 2-3 seconds, driven by the classification step. If you provide an `ewc_code` directly and set `auto_classify` to `false`, latency drops to \~500ms.

WTNs are not cached. Each request creates a new document. The internal calls to `/v1/verify-carrier` and `/v1/classify-waste` use their own caches, so repeated WTNs for the same carrier or waste type are faster.

### Error Responses

| Code                    | HTTP | When                                                        |
| ----------------------- | ---- | ----------------------------------------------------------- |
| `INVALID_REQUEST`       | 400  | Missing required fields                                     |
| `CARRIER_NOT_FOUND`     | 404  | Carrier registration not found (when `auto_verify` is true) |
| `CLASSIFICATION_FAILED` | 500  | Waste classification could not be completed                 |

## Example

<CodeGroup>
  ```bash curl theme={null}
  curl -X POST https://api.wastecheck.co.uk/v1/generate-wtn \
    -H "Authorization: Bearer wc_live_your_api_key_here" \
    -H "Content-Type: application/json" \
    -d '{
      "producer": {
        "name": "ABC Office Fit-out Ltd",
        "address": "45 High Street, Bournemouth, BH1 2AA",
        "sic_code": "43320"
      },
      "carrier": {
        "registration_number": "CBDU217016",
        "auto_verify": true
      },
      "waste": {
        "description": "Broken plasterboard from office refurbishment",
        "auto_classify": true,
        "quantity_kg": 2500,
        "container_type": "skip"
      },
      "destination": {
        "name": "South Coast Recycling Ltd",
        "address": "Industrial Estate, Poole, BH15 1NF",
        "permit_number": "EPR/AB1234CD"
      },
      "transfer_date": "2026-03-25"
    }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch(
    "https://api.wastecheck.co.uk/v1/generate-wtn",
    {
      method: "POST",
      headers: {
        "Authorization": "Bearer wc_live_your_api_key_here",
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        producer: {
          name: "ABC Office Fit-out Ltd",
          address: "45 High Street, Bournemouth, BH1 2AA",
          sic_code: "43320",
        },
        carrier: {
          registration_number: "CBDU217016",
          auto_verify: true,
        },
        waste: {
          description: "Broken plasterboard from office refurbishment",
          auto_classify: true,
          quantity_kg: 2500,
          container_type: "skip",
        },
        destination: {
          name: "South Coast Recycling Ltd",
          address: "Industrial Estate, Poole, BH15 1NF",
          permit_number: "EPR/AB1234CD",
        },
        transfer_date: "2026-03-25",
      }),
    }
  );
  const data = await response.json();
  console.log(data.reference); // "WTN-2026-0325-A7X9"
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      "https://api.wastecheck.co.uk/v1/generate-wtn",
      headers={
          "Authorization": "Bearer wc_live_your_api_key_here",
      },
      json={
          "producer": {
              "name": "ABC Office Fit-out Ltd",
              "address": "45 High Street, Bournemouth, BH1 2AA",
              "sic_code": "43320",
          },
          "carrier": {
              "registration_number": "CBDU217016",
              "auto_verify": True,
          },
          "waste": {
              "description": "Broken plasterboard from office refurbishment",
              "auto_classify": True,
              "quantity_kg": 2500,
              "container_type": "skip",
          },
          "destination": {
              "name": "South Coast Recycling Ltd",
              "address": "Industrial Estate, Poole, BH15 1NF",
              "permit_number": "EPR/AB1234CD",
          },
          "transfer_date": "2026-03-25",
      },
  )
  data = response.json()
  print(data["reference"])  # "WTN-2026-0325-A7X9"
  ```
</CodeGroup>
