Skip to main content

Red Tractor

Overview

The Red Tractor (UK) API operates as 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.

API Docs

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"
}
]
}
]
}

We take this information and process it into a generic form that can be more easily consumed by our API's and clients The service returns simply 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)