View on GitHub

easitrace

« Back to Contents

Transaction Fields

Due to each movement service requiring different information, each transaction model contains a set of soft fields. These fields are effectively a collection of key-value pairs of strings. The fields are then mapped to the appropriate part of the request sent to the movement service.

Generic vs Specific Fields

Originally, the key for each field in a service capability was unique to that service. This has the potential to cause mapping issues for applications, so we have created a set of generic field keys which will be used across movement services, making it easier for service providers to develop their integration. Backwards compatibility with the existing field keys is maintained.

How Generic Fields Work

When submitting a transaction, you can use either a generic field key or a service-specific field key:

Generic Key Example:

{
  "fields": {
    "Departure.Identifier": "1234567890123"
  }
}

Service-Specific Key Example (RMIS):

{
  "fields": {
    "RMIS.Departure.Gln": "1234567890123"
  }
}

Note: You can find the full reference list of all fields here.

Both approaches are equivalent - the system automatically maps between them based on the service being used.

Generic Field Key Categories

The system defines 150+ generic field keys organized into the following categories:

Category Count Description
Movement 84 Departure, destination, haulier, FCI, buyer/seller fields
Register 9 Birth registration and animal details
Health 6 Medicines, injury, welfare indicators
Death 7 Disposal, location, and cause information
StillBirth 5 Disposal and type information
Import/Export 4 Country and date tracking
Property 4 Property identifiers and date ranges
Query Operations 7 GetAnimals, Historical, ReTag query fields
Global 4 Email, herd, serial, user reference
Buyer/Seller 2 Invoice and payment tracking

Common Generic Field Keys

Movement Fields

Departure Location:

Destination Location:

Transport/Haulier:

Movement Details:

Register Fields

Death Fields

Query Fields

Service-Specific Mappings

Different services map generic keys to their own specific keys:

Generic Key RMIS ScotMoves DAERA
Departure.Identifier RMIS.Departure.Gln ScotMoves.Movement.DepartureLocation GenericInput.DepartureCPH
Destination.Identifier RMIS.Destination.Gln ScotMoves.Movement.DestinationLocation GenericInput.DestinationCPH
Departure.Date RMIS.Departure.Date ScotMoves.Movement.MovementDate GenericInput.MovementDate
Death.Location N/A ScotMoves.Death.MainLocation GenericInput.DeathLocation
Register.BirthPropertyIdentifier RMIS.RequestingGln ScotMoves.Register.BirthLocation GenericInput.BirthCPH

Field Data Types

Generic field keys support the following data types:

Using Generic Fields in Your Application

  1. Get Available Fields: Call GET /api/services/{serviceId}/fields to see which fields are supported by a specific service

  2. Use Generic Keys: Submit transactions using generic field keys - they will work across all services

  3. Backward Compatibility: Existing service-specific keys continue to work

  4. Field Validation: The system validates fields based on the target service’s requirements

Example Transaction with Generic Fields

{
  "reference": "MY-TRANSACTION-001",
  "transactionDate": "2024-03-10T10:30:00Z",
  "type": "MOV-OFF",
  "speciesCode": "C",
  "propertyIdentifier": "1234567890123",
  "fields": {
    "Departure.Identifier": "1234567890123",
    "Destination.Identifier": "9876543210123",
    "Departure.Date": "2024-03-10",
    "Departure.Latitude": "-33.865143",
    "Departure.Longitude": "151.209900"
  },
  "animals": [
    {
      "rfid": "982000123456789",
      "visual": "UK100015401645"
    }
  ]
}

For Complete Field Reference

For a complete list of all 150+ generic field keys with descriptions and type information, see:

For service-specific field mappings, refer to each service’s documentation which lists both generic and specific keys for all transaction types.