Skip to main content

Red Tractor

Overview

Quality Assurance standards exist across the UK, to ensure that we are maintaining the highest standards food and farm standards scheme. They cover all areas of food production from animal welfare and food safety to traceability and environmental protection.

Membership of these schemes and the right to display the relevant certifications, impacts the product process at all levels and will be a deciding factor when Organisers/Grain Traders are agreeing to trade.

Approval is set up by the Farm itself and requested from Red Tractor - RT (England) or Scottish Quality Crops - SQC (Scotland).

In the RT database, you can look up using either: Postcode, company name (i.e. farm name), address or holding number. In order to deliver this we are looking to use real time APIs at the point a new business unit is added. This information should then be stored against the Business Unit.

Red Tractor (UK) API

This is a set of rest API's that can be queried against in order to receive information on the current red tractor assurance status/validity of a locations storage facilities.

The primary location of the red tractor documentation is Red Tractor Xure API. We make use of the Authentication and Tracking API's within this integration.

Certificates

The response value contains a set of certificates based on the query context, the API currently supports query by postcode and by holding number.

{
"CheckDate": "2022-03-07T12:45:37.697+00:00",
"Certificates": [
{
"TaggedSite": "Shires Farms",
"TaggedSiteIdentifier": "1ACOH2UMWR.BK2DB39GZMYUU",
"TaggedSiteReference": null,
"TaggedSitePostcode": "MK16 8LF",
"TaggedSiteCountry": "United Kingdom",
"Scheme": "RT Crops",
"SchemeIdentifier": "0349EQH8NH.16LGK2EH7S03C",
"MembershipNumber": "71251",
"MembershipStatus": "Current",
"Certifier": "Lloyd's Register",
"CertifierIdentifier": "000HK277ZW.AX8YUZ1CKM4N",
"CertificateIdentifier": "2RRVTHNXTS.AP9HWY0UAEKRM",
"CertificateStatus": "Valid",
"CertificateStatusDetail": "FULL",
"CertificateExpiryDate": "2022-08-31T00:00:00.000+01:00",
"CertificateEnterprises": [
{ "Enterprise": "Cereals", "EnterpriseIdentifier": "000IL3890W.16LGLIFDMWAT0" },
{ "Enterprise": "Wheat", "EnterpriseIdentifier": "000IL3890W.16LGLIIWWAUUA" },
{ "Enterprise": "Barley", "EnterpriseIdentifier": "000IL3890W.16LGLIJ6XZOUD" },
{ "Enterprise": "REDII Compliant", "EnterpriseIdentifier": "1QQUSGMWSS.0TAG2VPYQ70HJ" },
{ "Enterprise": "NUTS2 UKJ1", "EnterpriseIdentifier": "1QQUSGMWSS.0VQ2FJXRYIK1Q" },
{ "Enterprise": "Long-term storage", "EnterpriseIdentifier": "2RRVTHNXTS.CDSTU11TXD62J" },
{ "Enterprise": "Short-term storage", "EnterpriseIdentifier": "2RRVTHNXTS.CDSUZS7KKDO3N" }
],
"CertifiedSites": [
{
"SiteName": "Shires Farms",
"SiteAddress": "Quarry Hall Farm",
"SitePostcode": "MK16 8LF",
"SiteCountry": null,
"IsPrimary": true,
"SiteIdentifiers": [{ "Identifier": "03/160/0019", "IdentifierType": "holdingno" }]
}
],
"RTCropsOwnerNumber": null,
"RTCropsContractorNumber": null,
"GrainStoresReported": true,
"GrainStores": [
{
"SiteName": "Shires Farms",
"SitePostcode": "MK16 8LF",
"StoreName": "Main store",
"StoreType": "LongTerm",
"StoreLocation": "52.10518 N, 0.745368 W"
},
{
"SiteName": "Shires Farms",
"SitePostcode": "MK16 8LF",
"StoreName": "Top Shed",
"StoreType": "ShortTerm",
"StoreLocation": "52.10475 N, 0.744314 W"
}
]
}
]
}

Our Implentation

We take this information and process it into a generic form that can be more easily consumed by our API's and clients

Our integration with the service returns the CertificateIdentifier; CertificateStatus if it is Valid or Grace; the CertifiedSites array

Consuming The Library

With Postcode lookup

import { RedTractorLookup, RedTractorSchemeAssurance } from '@hectare/platform.integrations.red-tractor'

const rt = await new RedTractorSchemeAssurance()
const query: RedTractorLookup = {
country: <ISO3CountryCode>,
postcode: <validPostcode>
}
await rt.retrieve(query)

With Holding number lookup

import { RedTractorLookup, RedTractorSchemeAssurance } from '@hectare/platform.integrations.red-tractor'

const rt = await new RedTractorSchemeAssurance()
const query: RedTractorLookup = {
country: <ISO3CountryCode>,
handlingNumber: <validHandlingNumber>,
postcode: <validPostcode> //optional
}
await rt.retrieve(query)