Trackdéchets Developer Documentation

website·Indexed 18 days ago

https://developers.trackdechets.beta.gouv.fr/

Technical documentation for the Trackdéchets API, featuring a GraphQL-based interface. It includes guides on authentication via access tokens, a GraphQL playground, and detailed reference materials for waste tracking schemas such as BSDD, BSFF, BSVHU, and BSPAOH. The documentation provides validation rules, query filters, and practical examples for scenarios like multi-modal transport, provisional storage, and waste grouping.

Tokens
153.8K
Snippets
836
Records
1.2K
Agent score
94%

What's inside Trackdéchets API

  1. Overview of the Trackdéchets GraphQL API

    Trackdéchets is a free digital platform developed by the French Ministry of Ecological Transition to digitize the traceability of hazardous waste. It provides a GraphQL API that allows existing information systems (business software or commercial software) across the waste traceability chain to interconnect and exchange standardized data.
  2. Overview of Trackdéchets Webhooks

    Webhooks allow a user's Information System (IS) to receive notifications when a waste tracking document (BSD) associated with them is created, modified, or deleted. This reduces the need for periodic polling of the Trackdéchets API.
  3. Define an AcceptedFormInput object

    The AcceptedFormInput object is used to specify the details of a waste tracking form. It includes information about the waste producer, the destination facility, transporters, and waste characteristics.

    Key constraints:

    • Direct Supply: If isDirectSupply is set to true, no transporter or packaging information (wasteDetails.packagingInfos) should be provided.
    • Transporters: The transporters list contains IDs in the order of waste handling. It must contain exactly one ID for direct shipment and a maximum of 5 IDs for multi-modal transport. Transporters are managed via createFormTransporter, updateFormTransporter, and deleteFormTransporter mutations.
    • Intermediaries: A maximum of 3 intermediary companies (entities involved in management but not traceability responsibility) can be added. These entities can read the form without signing it.
    {
      "id": "ID",
      "customId": "String",
      "emitter": "EmitterInput",
      "recipient": "RecipientInput",
      "transporter": "TransporterInput",
      "isDirectSupply": "Boolean",
      "transporters": ["ID!"],
      "wasteDetails": "WasteDetailsInput",
      "trader": "TraderInput",
      "broker": "BrokerInput",
      "grouping": ["InitialFormFractionInput!"],
      "ecoOrganisme": "EcoOrganismeInput",
      "temporaryStorageDetail": "TemporaryStorageDetailInput",
      "intermediaries": ["CompanyInput!"]
    }
  4. CompanyPrivate object schema

    The CompanyPrivate object contains detailed administrative and operational information about a company within the Trackdéchets system, including identification numbers, contact details, and regulatory certifications. It is used to manage the private profile of an establishment.
    # Fields for CompanyPrivate
    {
      id: ID!
      companyTypes: [CompanyType!]!
      collectorTypes: [CollectorType!]!
      wasteProcessorTypes: [WasteProcessorType!]!
      wasteVehiclesTypes: [WasteVehiclesType!]!
      gerepId: String
      securityCode: Int!
      verificationStatus: CompanyVerificationStatus!
      contact: String
      contactEmail: String
      contactPhone: String
      website: String
      users: [CompanyMember!]
      userRole: UserRole
      userPermissions: [UserPermission!]!
      userNotifications: UserNotifications!
      ecoOrganismePartnersIds: [String!]!
      givenName: String
      orgId: String!
      siret: String
      vatNumber: String
      address: String
      name: String
      naf: String
      libelleNaf: String
      installation: Installation
      transporterReceipt: TransporterReceipt
      traderReceipt: TraderReceipt
      brokerReceipt: BrokerReceipt
      vhuAgrementDemolisseur: VhuAgrement
      vhuAgrementBroyeur: VhuAgrement
    }
  5. Manage waste tracking documents for DASRI, asbestos, VHU, and Refrigerant Fluids

    The API operational mode for DASRI, asbestos, VHU (ELV), and Refrigerant Fluid documents differs from the standard BSDD. Key differences include:

    • The id field serves as the human-readable identifier (there is no separate readableId).
    • Draft status is managed via a boolean isDraft rather than a specific status value.
    • The draft stage is optional.
  6. Data schema for AddRegistryLine

    The AddRegistryLine object defines the required and optional fields for adding a registry line in the registreV2 API. It captures detailed information about waste types, quantities, dates, and the entities involved in the waste transfer chain (initial emitter, emitter, broker, trader, and recipient).
    # Key fields for AddRegistryLine
    {
      publicId: ID!                         # Unique identifier
      reportAsCompanySiret: String          # SIRET of the declarant
      reportForCompanySiret: String!        # SIRET of the recipient
      wasteDescription: String!            # Common name of excavated earth, sediments, or waste
      wasteCode: String                     # Waste code
      wasteCodeBale: String                 # Basel waste code
      wastePop: Boolean!                    # POP indicator
      wasteIsDangerous: Boolean             # Dangerous waste indicator
      wasteDap: String                      # DAP
      receptionDate: DateTime!              # Date of reception
      weightValue: Float!                    # Weight in tonnes
      weightIsEstimate: Boolean!            # Weight type (estimate or actual)
      volume: Float                         # Volume in M3
      parcelInseeCodes: [String!]           # INSEE codes of the parcels
      parcelNumbers: [String!]              # Parcel number(s)
      parcelCoordinates: [String!]         # Parcel coordinates
      sisIdentifier: String                 # SIS identifier of the land
      initialEmitterCompanyType: RegistryCompanyType # Type of initial producer
      initialEmitterCompanyOrgId: String    # Identification number of initial producer
      initialEmitterCompanyName: String     # Company name of initial producer
      initialEmitterCompanyAddress: String  # Address of initial producer
      initialEmitterCompanyPostalCode: String # Postal code of initial producer
      initialEmitterCompanyCity: String     # City of initial producer
      initialEmitterCompanyCountryCode: String # Country code of initial producer
      initialEmitterMunicipalitiesInseeCodes: [String!] # INSEE code(s) of municipality(ies)
      emitterCompanyType: RegistryCompanyType! # Type of sender or holder
      emitterCompanyOrgId: String           # Identification number of sender or holder
      emitterCompanyName: String            # Company name of sender or holder
      emitterCompanyAddress: String         # Address of sender or holder
      emitterCompanyPostalCode: String     # Postal code of sender or holder
      emitterCompanyCity: String            # City of sender or holder
      emitterCompanyCountryCode: String     # Country code of sender or holder
      emitterPickupSiteName: String         # Reference of the sender's site or collection point
      emitterPickupSiteAddress: String      # Address of the sender's site or collection point
      emitterPickupSitePostalCode: String   # Postal code of the sender's site or collection point
      emitterPickupSiteCity: String         # City of the sender's site or collection point
      emitterPickupSiteCountryCode: String  # Country code of the sender's site or collection point
      ecoOrganismeSiret: String             # SIRET of the eco-organism
      ecoOrganismeName: String              # Company name of the eco-organism
      brokerCompanySiret: String            # SIRET of the broker
      brokerCompanyName: String             # Company name of the broker
      brokerRecepisseNumber: String         # Broker receipt number
      traderCompanySiret: String            # SIRET of the trader
      traderCompanyName: String             # Company name of the trader
      traderRecepisseNumber: String         # Trader receipt number
      operationCode: String!                # Treatment code performed
      operationMode: OperationMode          # Treatment mode
      noTraceability: Boolean               # Traceability break authorized
      ttdImportNumber: String              # Import notification or declaration number
    }
  7. Define the AcceptedFormInput object for BSDD API

    The AcceptedFormInput object is used to provide details about the processing and destination of waste. It includes requirements for processing operations, destination parcel identification (via INSEE codes, parcel numbers, or coordinates), and processing metadata.
    {
      processingOperationDone: string; // Required. Treatment performed (code D/R). Max 250 chars.
      destinationOperationMode: OperationMode; // Required. Treatment mode.
      isUpcycled: boolean; // Optional. Indicates if soil was recovered (Terre valorisée).
      destinationParcelInseeCodes: string[]; // Optional. INSEE codes of parcels (5 characters each, e.g., "96140").
      destinationParcelNumbers: string[]; // Optional. Parcel numbers in format [prefix]-[section]-[number] (e.g., "123-A-4567").
      destinationParcelCoordinates: string[]; // Optional. Coordinates in degrees with a space separator (e.g., "48.894258 2.240027").
      processingOperationDescription: string; // Optional. Description of elimination/recovery operation. Max 250 chars.
      processedBy: string; // Required. Person in charge of treatment. Max 250 chars.
      processedAt: DateTime; // Required. Date when the waste was treated.
    }