Request Schema
<?xml version="1.0" encoding="utf-8"?>
<xsd:schema elementFormDefault="qualified" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="CreatePassportRequest">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="MembershipGUID" type="xsd:string">
<xsd:annotation>
<xsd:documentation>The unique identifier for the crops membership the passport is being created for</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="SiteGUID" type="xsd:string">
<xsd:annotation>
<xsd:documentation>The unique identifier of the assured site to be used for the collection address</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="StoreGUID" minOccurs="0" type="xsd:string">
<xsd:annotation>
<xsd:documentation>The unique identifier of the assured grain store used for the collection point</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="CropType" minOccurs="0" type="xsd:string">
<xsd:annotation>
<xsd:documentation>The crop type to be shown in section 1 of the passport document</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="Variety" minOccurs="0" type="xsd:string">
<xsd:annotation>
<xsd:documentation>The crop variety to be shown in section 1 of the passport document</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="StoreOrBinName" minOccurs="0" type="xsd:string">
<xsd:annotation>
<xsd:documentation>The store or bin name to be shown in section 1 of the passport document</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="LoadingDate" minOccurs="0" type="xsd:dateTime">
<xsd:annotation>
<xsd:documentation>The loading date to be shown in section 1 of the passport document</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="HarvestYear" minOccurs="0" type="xsd:string">
<xsd:annotation>
<xsd:documentation>The harvest year to be shown in section 1 of the passport document</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="HaulierCompanyName" minOccurs="0" type="xsd:string">
<xsd:annotation>
<xsd:documentation>The company name of the haulier to be shown in section 1 of the passport document</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="VehicleRegistration" minOccurs="0" type="xsd:string">
<xsd:annotation>
<xsd:documentation>The vehicle registration of the haulier collecting the load to be shown in section 1 of the passport document</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="TrailerNumber" minOccurs="0" type="xsd:string">
<xsd:annotation>
<xsd:documentation>The number of the trailer used to transport the load to be shown in section 1 of the passport document</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="HaulierCollectionTicketNo" minOccurs="0" type="xsd:string">
<xsd:annotation>
<xsd:documentation>The ticket number given by the hauler for the collection to be shown in section 1 of the passport document</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="PostHarvestTreatmentOption" minOccurs="0">
<xsd:annotation>
<xsd:documentation>The post harvest treatment option to be indicated in section 4 of the passport document</xsd:documentation>
</xsd:annotation>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="">
<xsd:annotation>
<xsd:documentation>None Indicated</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
<xsd:enumeration value="A">
<xsd:annotation>
<xsd:documentation>Option A</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
<xsd:enumeration value="B">
<xsd:annotation>
<xsd:documentation>Option B</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
<xsd:enumeration value="C">
<xsd:annotation>
<xsd:documentation>Option C</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="PostHarvestTreatmentDate" minOccurs="0" type="xsd:dateTime">
<xsd:annotation>
<xsd:documentation>The date of post-harvest treatment to be shown in section 4 of the passport document</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="PostHarvestTreatmentProduct" minOccurs="0" type="xsd:string">
<xsd:annotation>
<xsd:documentation>The product used for post-harvest treatment to be shown in section 4 of the passport document
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="DONRiskAssessmentResult" minOccurs="0" type="xsd:double">
<xsd:annotation>
<xsd:documentation>The risk assessment score to be shown in section 5 of the passport document</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="DONTestDate" minOccurs="0" type="xsd:dateTime">
<xsd:annotation>
<xsd:documentation>The date of test to be shown in section 5 of the passport document</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="DONTestResult" minOccurs="0" type="xsd:string">
<xsd:annotation>
<xsd:documentation>The result to be shown in section 5 of the passport document</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="ZONTestDate" minOccurs="0" type="xsd:dateTime">
<xsd:annotation>
<xsd:documentation>The date of test to be shown in section 5 of the passport document</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="ZONTestResult" minOccurs="0" type="xsd:string">
<xsd:annotation>
<xsd:documentation>The result to be shown in section 5 of the passport document</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
Example Request
POST https://api.redtractor.org.uk/v1/passports.eb HTTP/1.1
Accept: text/xml
Content-Type: text/xml; charset=utf-8
<?xml version="1.0" encoding="utf-8"?>
<CreatePassportRequest>
<MembershipGUID>xsd:string</MembershipGUID>
<SiteGUID>xsd:string</SiteGUID>
<StoreGUID>xsd:string</StoreGUID>
<CropType>xsd:string</CropType>
<Variety>xsd:string</Variety>
<StoreOrBinName>xsd:string</StoreOrBinName>
<LoadingDate>xsd:dateTime</LoadingDate>
<HarvestYear>xsd:string</HarvestYear>
<HaulierCompanyName>xsd:string</HaulierCompanyName>
<VehicleRegistration>xsd:string</VehicleRegistration>
<TrailerNumber>xsd:string</TrailerNumber>
<HaulierCollectionTicketNo>xsd:string</HaulierCollectionTicketNo>
<PostHarvestTreatmentOption>xsd:string</PostHarvestTreatmentOption>
<PostHarvestTreatmentDate>xsd:dateTime</PostHarvestTreatmentDate>
<PostHarvestTreatmentProduct>xsd:string</PostHarvestTreatmentProduct>
<DONRiskAssessmentResult>xsd:double</DONRiskAssessmentResult>
<DONTestDate>xsd:dateTime</DONTestDate>
<DONTestResult>xsd:string</DONTestResult>
<ZONTestDate>xsd:dateTime</ZONTestDate>
<ZONTestResult>xsd:string</ZONTestResult>
</CreatePassportRequest>
Response Schema
<?xml version="1.0" encoding="utf-8"?>
<xsd:schema elementFormDefault="qualified" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="CropPassport">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="ShortCode" type="xsd:string">
<xsd:annotation>
<xsd:documentation>The unique reference number assigned to the passport </xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="MembershipGUID" type="xsd:string">
<xsd:annotation>
<xsd:documentation>The unique identifier for the crops membership the passport belongs to</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="SiteGUID" type="xsd:string">
<xsd:annotation>
<xsd:documentation>The unique identifier of the assured site used for the collection address </xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="StoreGUID" minOccurs="0" type="xsd:string">
<xsd:annotation>
<xsd:documentation>The unique identifier of the assured grain store to be used for the collection point</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="BusinessName" type="xsd:string">
<xsd:annotation>
<xsd:documentation>The business name shown on the passport document</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="CollectionAddress" type="xsd:string">
<xsd:annotation>
<xsd:documentation>The collection address shown on the passport document</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="CropType" minOccurs="0" type="xsd:string">
<xsd:annotation>
<xsd:documentation>The crop type shown on the passport document</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="Variety" minOccurs="0" type="xsd:string">
<xsd:annotation>
<xsd:documentation>The crop variety shown on the passport document</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="StoreOrBinName" minOccurs="0" type="xsd:string">
<xsd:annotation>
<xsd:documentation>The store or bin name shown on the passport document</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="LoadingDate" minOccurs="0" type="xsd:dateTime">
<xsd:annotation>
<xsd:documentation>The loading date shown on the passport document</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="HarvestYear" minOccurs="0" type="xsd:string">
<xsd:annotation>
<xsd:documentation>The harvest year shown on the passport document</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="HaulierCompanyName" minOccurs="0" type="xsd:string">
<xsd:annotation>
<xsd:documentation>The company name of the haulier shown on the passport document</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="VehicleRegistration" minOccurs="0" type="xsd:string">
<xsd:annotation>
<xsd:documentation>The vehicle registration number of the haulier as shown on the passport document</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="TrailerNumber" minOccurs="0" type="xsd:string">
<xsd:annotation>
<xsd:documentation>The trailer number shown on the passport document</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="HaulierCollectionTicketNo" minOccurs="0" type="xsd:string">
<xsd:annotation>
<xsd:documentation>The number of the trailer used to transport the load as shown on the passport document </xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="CertifierName" type="xsd:string">
<xsd:annotation>
<xsd:documentation>The name of the certification body shown for the assurance claim included on the passport document</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="MembershipNumber" type="xsd:string">
<xsd:annotation>
<xsd:documentation>The Red Tractor membership number for the assurance claim included on the passport document</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="CheckDate" type="xsd:dateTime">
<xsd:annotation>
<xsd:documentation>The date the assurance claim included on the passport document was validated</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="Status" type="xsd:string">
<xsd:annotation>
<xsd:documentation>The validated status of the assurance claim included on the passport document</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="ExpiryDate" type="xsd:dateTime">
<xsd:annotation>
<xsd:documentation>The certificate expiry date for the assurance claim included on the passport document</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="Enterprises" type="xsd:string">
<xsd:annotation>
<xsd:documentation>Comma-delimited list of the certified enterprises shown for the assurance claim included on the passport document</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="PostHarvestTreatmentOption" minOccurs="0">
<xsd:annotation>
<xsd:documentation>The post harvest treatment option indicated in section 4 of the passport document</xsd:documentation>
</xsd:annotation>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="">
<xsd:annotation>
<xsd:documentation>None Indicated</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
<xsd:enumeration value="A">
<xsd:annotation>
<xsd:documentation>Option A</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
<xsd:enumeration value="B">
<xsd:annotation>
<xsd:documentation>Option B</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
<xsd:enumeration value="C">
<xsd:annotation>
<xsd:documentation>Option C</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="PostHarvestTreatmentDate" minOccurs="0" type="xsd:dateTime">
<xsd:annotation>
<xsd:documentation>The date of post-harvest treatment shown in section 4 of the passport document</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="PostHarvestTreatmentProduct" minOccurs="0" type="xsd:string">
<xsd:annotation>
<xsd:documentation>The product used for post-harvest treatment shown in section 4 of the passport document</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="DONRiskAssessmentResult" minOccurs="0" type="xsd:double">
<xsd:annotation>
<xsd:documentation>The risk assessment score to be shown in section 5 of the passport document</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="DONTestDate" minOccurs="0" type="xsd:dateTime">
<xsd:annotation>
<xsd:documentation>The date of test shown in section 5 of the passport document </xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="DONTestResult" minOccurs="0" type="xsd:string">
<xsd:annotation>
<xsd:documentation>The result shown in section 5 of the passport document</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="ZONTestDate" minOccurs="0" type="xsd:dateTime">
<xsd:annotation>
<xsd:documentation>The date of test shown in section 5 of the passport document</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="ZONTestResult" minOccurs="0" type="xsd:string">
<xsd:annotation>
<xsd:documentation>The result to be shown in section 5 of the passport document </xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="GrainStoreName" minOccurs="0" type="xsd:string">
<xsd:annotation>
<xsd:documentation>Name of grain store used as collection point</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="GrainStoreLatitude" minOccurs="0" type="xsd:string">
<xsd:annotation>
<xsd:documentation>Grain store latitude
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="GrainStoreLongitude" minOccurs="0" type="xsd:string">
<xsd:annotation>
<xsd:documentation>Grain store longitude</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
Example Response
HTTP/1.1 200 OK
Content-Type: text/xml
<?xml version="1.0" encoding="utf-8"?>
<CropPassport>
<ShortCode>xsd:string</ShortCode>
<MembershipGUID>xsd:string</MembershipGUID>
<SiteGUID>xsd:string</SiteGUID>
<StoreGUID>xsd:string</StoreGUID>
<BusinessName>xsd:string</BusinessName>
<CollectionAddress>xsd:string</CollectionAddress>
<CropType>xsd:string</CropType>
<Variety>xsd:string</Variety>
<StoreOrBinName>xsd:string</StoreOrBinName>
<LoadingDate>xsd:dateTime</LoadingDate>
<HarvestYear>xsd:string</HarvestYear>
<HaulierCompanyName>xsd:string</HaulierCompanyName>
<VehicleRegistration>xsd:string</VehicleRegistration>
<TrailerNumber>xsd:string</TrailerNumber>
<HaulierCollectionTicketNo>xsd:string</HaulierCollectionTicketNo>
<CertifierName>xsd:string</CertifierName>
<MembershipNumber>xsd:string</MembershipNumber>
<CheckDate>xsd:dateTime</CheckDate>
<Status>xsd:string</Status>
<ExpiryDate>xsd:dateTime</ExpiryDate>
<Enterprises>xsd:string</Enterprises>
<PostHarvestTreatmentOption>xsd:string</PostHarvestTreatmentOption>
<PostHarvestTreatmentDate>xsd:dateTime</PostHarvestTreatmentDate>
<PostHarvestTreatmentProduct>xsd:string</PostHarvestTreatmentProduct>
<DONRiskAssessmentResult>xsd:double</DONRiskAssessmentResult>
<DONTestDate>xsd:dateTime</DONTestDate>
<DONTestResult>xsd:string</DONTestResult>
<ZONTestDate>xsd:dateTime</ZONTestDate>
<ZONTestResult>xsd:string</ZONTestResult>
<GrainStoreName>xsd:string</GrainStoreName>
<GrainStoreLatitude>xsd:string</GrainStoreLatitude>
<GrainStoreLongitude>xsd:string</GrainStoreLongitude>
</CropPassport>
Example Request
POST https://api.redtractor.org.uk/v1/passports.eb HTTP/1.1
Accept: application/json
Content-Type: application/json; charset=utf-8
{"MembershipGUID":String,
"SiteGUID":String,
"StoreGUID":String,
"CropType":String,
"Variety":String,
"StoreOrBinName":String,
"LoadingDate":String,
"HarvestYear":String,
"HaulierCompanyName":String,
"VehicleRegistration":String,
"TrailerNumber":String,
"HaulierCollectionTicketNo":String,
"PostHarvestTreatmentOption":String,
"PostHarvestTreatmentDate":String,
"PostHarvestTreatmentProduct":String,
"DONRiskAssessmentResult":Number,
"DONTestDate":String,
"DONTestResult":String,
"ZONTestDate":String,
"ZONTestResult":String}
Example Response
HTTP/1.1 200 OK
Content-Type: application/json
{"ShortCode":String,
"MembershipGUID":String,
"SiteGUID":String,
"StoreGUID":String,
"BusinessName":String,
"CollectionAddress":String,
"CropType":String,
"Variety":String,
"StoreOrBinName":String,
"LoadingDate":String,
"HarvestYear":String,
"HaulierCompanyName":String,
"VehicleRegistration":String,
"TrailerNumber":String,
"HaulierCollectionTicketNo":String,
"CertifierName":String,
"MembershipNumber":String,
"CheckDate":String,
"Status":String,
"ExpiryDate":String,
"Enterprises":String,
"PostHarvestTreatmentOption":String,
"PostHarvestTreatmentDate":String,
"PostHarvestTreatmentProduct":String,
"DONRiskAssessmentResult":Number,
"DONTestDate":String,
"DONTestResult":String,
"ZONTestDate":String,
"ZONTestResult":String,
"GrainStoreName":String,
"GrainStoreLatitude":String,
"GrainStoreLongitude":String}
To create a new passport, as a minimum you must specify the membership and site to be associated with the passport.
The site determines the collection address shown on the resulting passport. The user requesting the passport must be a registered contact for the membership. To discover all memberships and sites usable by the current user, call the authorisation API method.
You can also provide information to pre-populate section 1 of the passport documentation. All of these values are optional, but if not provided, will need to be compled by hand prior to the collection of the load.
Obtaining a completed passport PDF document
To have the passport document returned in PDF format, specify "application/pdf" as the MIME type in the HTTP Accept header you include with your request.