API | Troubleshooting Guide
This comprehensive guide helps you diagnose and resolve common issues with the EasiTrace movement services API. Refer to the error codes, service-specific solutions, and debugging checklist below.
Table of Contents
- Common Issues
- Service-Specific Issues
- Debugging Checklist
- FAQ
- Error Code Reference
- Support Contact Information
Common Issues
1. Authentication Failures (401, 403)
Issue: Invalid API Key
Error Messages:
- HTTP 401: “Unauthorized - API key is missing or invalid”
- HTTP 403: “Forbidden - API key does not have permission for this operation”
- Error Code:
A-1000(Service Credentials Invalid) - Error Code:
A-1001(User Service Credentials Invalid)
Typical Response:
{
"code": "A-1000",
"description": "Service Credentials Invalid",
"category": 9,
"severity": 10,
"field": "X-API-Key"
}
Causes:
- API key is missing from the request headers
- API key has expired and needs regeneration
- API key is incorrect or mistyped
- API key belongs to a different environment (dev/staging/production)
- API key has been revoked or deactivated
- Using deprecated
X-API-Keyheader instead ofX-ServiceProvider-API-KeyorX-Application-API-Key
Solutions:
- Verify API Key Header:
- For Service Providers: Use
X-ServiceProvider-API-Keyheader (preferred) - For Applications: Use
X-Application-API-Keyheader (preferred) - Deprecated:
X-API-Keyheader is no longer recommended
- For Service Providers: Use
- Regenerate API Key:
- Contact Rezare for Service Provider key regeneration
- Service Providers can generate new Application keys via the API
- Store new keys securely immediately after generation
- Verify Key Format:
- Ensure the key is copied exactly without trailing spaces
- Check that the key matches the current environment
- Confirm the API key hasn’t been accidentally modified
- Check Service Provider Credentials:
- Ensure Service Provider credentials are registered for the movement service
- Verify property credentials are configured correctly
- Use
/api/service-providers/credentialsendpoint to check
Example Request (Correct):
curl -X GET "https://api.easitrace.com/api/services" \
-H "X-Application-API-Key: your-api-key-here" \
-H "Content-Type: application/json"
Issue: Authorization Error (User Lacks Permissions)
Error Message:
- HTTP 403: “Forbidden”
- Error Code:
A-1002(Authorisation Error)
Causes:
- Service Provider attempting to access Application-only endpoints
- Application attempting to access Service Provider-only endpoints
- User context does not have sufficient permissions for the operation
Solutions:
- Verify User Type:
- Service Providers can access:
/api/service-providers/…and/api/applications/… - Applications can access all other endpoints
- Service Providers can access:
- Use Correct Credentials:
- Service Providers must use
X-ServiceProvider-API-Key - Applications must use
X-Application-API-Key
- Service Providers must use
- Check Endpoint Access:
- Service Provider endpoints require Service Provider authentication
- Application-specific endpoints require Application authentication
Restricted Endpoints by Type:
- Service Provider Only:
/api/service-providers/* - Application Only:
/api/transactions/*,/api/properties/*,/api/callbacks/*
Issue: Service Token Invalid or Expired
Error Code: A-1003 (Service Token Invalid or Expired)
Causes:
- Movement Service token has expired
- Service authentication token provided in transaction has become invalid
- Movement Service credentials were revoked
Solutions:
- Re-authenticate with Movement Service:
- Call
/api/service-providers/credentialsto refresh credentials - Update Service Provider credentials if they’ve changed
- Call
- Check Service Provider Setup:
- Verify Service Provider credentials are current
- Confirm username/password for the movement service are correct
- Some services (DAERA, RMIS) may require periodic re-authentication
- Implement Token Refresh Logic:
- Cache tokens temporarily but implement refresh on token expiry
- Handle token refresh as part of retry logic for failed transactions
2. Validation Errors (400)
Issue: Missing Required Parameters
Error Code: ES-1000 (Parameter Missing)
HTTP Status: 400 Bad Request
Causes:
- Required field is missing from the transaction
- Mandatory header is not included in the request
- Required parameter is empty or null
Common Missing Fields:
propertyIdentifier: Property CPH, CPH, PIC, or equivalent for the servicetype: Transaction type (MOV-ON, MOV-OFF, REG, DTH, etc.)speciesCode: Animal species (C, S, G, D, P)transactionDate: Date of the transaction- Service-specific required fields (varies by service)
Solutions:
- Validate Request Structure:
{ "reference": "unique-reference", "type": "MOV-ON", "speciesCode": "C", "propertyIdentifier": "20/002/0001", "transactionDate": "2024-01-15T10:30:00Z", "fields": {} } - Get Service-Specific Fields:
- Call
GET /api/services/{serviceId}/fieldsto get required fields - Check field
requiredattribute - Include all fields marked as required
- Call
- Verify Data Types:
- Ensure field types match specification
- Dates should be ISO 8601 format
- IDs should be valid UUIDs
Issue: Invalid Data Format
Error Code: MS-1004 (Invalid Format) or ES-1002 (Invalid Data)
HTTP Status: 400 Bad Request
Typical Errors:
{
"code": "MS-1004",
"field": "Movement.DepartureDate",
"description": "Invalid date format. Expected YYYY-MM-DD",
"category": 2,
"severity": 6
}
Common Format Issues:
- Date format incorrect (not YYYY-MM-DD or ISO 8601)
- RFID tag format invalid
- Property identifier doesn’t match required format
- Numeric field contains non-numeric characters
- String exceeds maximum length
Solutions:
- Date Formatting:
- Use ISO 8601 format:
2024-01-15T10:30:00Zor2024-01-15T10:30:00+00:00 - For date-only fields:
YYYY-MM-DDformat - Verify timezone information if required by service
- Use ISO 8601 format:
- Animal Identifiers:
- RFID tags: Verify format per service (usually 12-15 digits)
- Visual tags: Check against service specification
- Ensure tags are not duplicated within same transaction
- Property Identifiers:
- BCMS/ScotMoves/ScotEID: CPH format (e.g., “20/002/0001”)
- RMIS: GLN format
- EIDCymru/LIS/NLIS: Service-specific format
- NAIT: 7-digit format
- Confirm format matches property’s movement service
- Field Validation:
- Call
/api/services/{serviceId}/fieldsendpoint - Review field definition including format and constraints
- Test with sample data before production use
- Call
Issue: Invalid Data Value
Error Code: MS-1005 (Invalid Data Value)
HTTP Status: 400 Bad Request
Causes:
- Value is outside acceptable range
- Value violates business rules
- Reference to non-existent entity (property, animal, etc.)
- Incompatible combination of fields
Common Value Errors:
{
"code": "MS-1005",
"field": "Animal.BirthDate",
"description": "Birth date cannot be in the future",
"category": 1,
"severity": 6
}
Solutions:
- Date Validation:
- Birth dates must be in the past
- Transaction dates must be reasonable (not years in the past/future)
- Arrival date must be after departure date
- Animal Count Validation:
expectedCountmust match actual animal count- Head count must be positive integer
- Ensure consistency between animals list and count
- Property Validation:
- Verify property exists for the application
- Property must support the species
- Property must be registered with the movement service
- Confirm property identifier format for the service
- Species Compatibility:
- Check service capabilities for species
- Some services only support specific animals
- NAIT (New Zealand): Only cattle and deer
- NLIS (Australia): Only cattle and sheep
3. Timeout Errors (408, 504)
Issue: Request Timeout (408)
HTTP Status: 408 Request Timeout
Causes:
- Network connectivity issue
- Movement Service is experiencing high load
- Large payload taking too long to process
- Database query performance degradation
Solutions:
- Check Network Connectivity:
# Verify API endpoint accessibility curl -I https://api.easitrace.com/api/services - Implement Retry Logic:
- Retry with exponential backoff
- Maximum 3-5 retries recommended
- Wait 1, 2, 4 seconds between retries
- Increase Timeout Values:
- Default HTTP timeout: 30 seconds
- For large batches: increase to 60 seconds
- For complex validations: increase to 90 seconds
- Reduce Payload Size:
- Submit transactions individually instead of batches
- Limit animals per transaction to 50-100
- Split large requests into smaller chunks
Issue: Bad Gateway / Service Unavailable (504)
HTTP Status: 504 Gateway Timeout or 503 Service Unavailable
Causes:
- Movement Service is offline or unreachable
- Network infrastructure issue
- Database connectivity problem
- Scheduled maintenance window
Solutions:
- Check Service Status:
- Verify movement service is online
- Check EasiTrace status page for maintenance notices
- Some services have maintenance windows (schedule varies)
- Implement Retry with Backoff:
// Exponential backoff retry pattern var maxRetries = 5; var delay = TimeSpan.FromSeconds(1); for (int i = 0; i < maxRetries; i++) { try { // Make API call return await client.PostAsync(url, content); } catch (HttpRequestException) when (i < maxRetries - 1) { await Task.Delay(delay); delay = TimeSpan.FromSeconds(delay.TotalSeconds * 2); } } - Queue Failed Transactions:
- Store failed transactions locally
- Retry periodically (every 5 minutes, 15 minutes, etc.)
- Monitor retry queue for stuck messages
- Contact Support:
- If 503 errors persist for >30 minutes
- Verify your service credentials are correct
- Check if your IP has been blocked
4. Service Unavailable (503)
HTTP Status: 503 Service Unavailable
Error Code: MS-1007 (Service System Error) or MS-1008 (Service System Error - Retry)
Causes:
- Movement Service temporarily offline
- EasiTrace infrastructure issue
- Database connection pool exhausted
- Service under maintenance
- Rate limiting triggered
Solutions:
- Check Error Category:
- Category 5 (Service System Error): Retry required
- Category 6 (Service System Error - Retry): Specific retry required
- Implement Automatic Retry:
- Wait 5-10 seconds before first retry
- Use exponential backoff for subsequent retries
- Maximum wait time: 5 minutes between retries
- Monitor Service Health:
- Poll
/api/healthendpoint if available - Check movement service status pages
- Subscribe to status update notifications
- Poll
- Graceful Degradation:
- Queue transactions locally if service is down
- Provide user feedback about temporary unavailability
- Implement fallback UI for offline scenarios
5. Transaction Processing Errors
Issue: Duplicate Transaction / Duplicate Animal
Error Code: MS-1003 (Duplicate Animal) or AN-1000 (Duplicate)
HTTP Status: 400 Bad Request
Causes:
- Animal with same tag already exists at property
- Transaction was submitted twice (idempotency issue)
- Animal re-registered without previous removal
- RFID and visual tag conflict with existing animals
Solutions:
- Implement Idempotency:
{ "reference": "unique-transaction-id-2024-01-15-001", "type": "MOV-ON" }- Use unique reference per transaction
- Retry with same reference (will be identified as duplicate safely)
- Check Animal Existence:
- Query animal before attempting registration
- Use
GET-ANMcapability to list property animals - Verify animal is not already tagged
- Handle Duplicate Gracefully:
- Catch duplicate error
- Verify the existing animal matches expectations
- Update animal record if needed using retag capability (RMIS)
Issue: Unknown Animal
Error Code: MS-1010 (Unknown Animal)
Causes:
- Animal does not exist at the source property
- Animal tag is invalid or doesn’t match records
- Animal was already moved off the property
- Animal was deleted from movement service
Solutions:
- Verify Animal Identity:
{ "capability": "GET-ANM", "propertyIdentifier": "20/002/0001" }- Query animals at source property using GET-ANM
- Confirm animal exists with correct tag
- Check Animal Status:
- Verify animal is still registered at the property
- Confirm animal hasn’t been previously moved off
- Check if animal is in isolation/quarantine
- Handle Missing Animals:
- For movements: Use untagged animals with head count instead
- For registrations: Create new animal record with REG transaction
- For retag: First move animal to property if missing
Issue: Condition Violation
Error Code: MS-1002 (Condition Violation)
Category: 4 (Condition Violation)
Causes:
- Business rule violated (e.g., animal too young to move)
- Invalid state transition (e.g., moving animal twice)
- Missing prerequisite (e.g., no parent holding for allocation)
- Movement date conflicts with existing records
Solutions:
- Verify Business Rules:
- Check minimum age requirements
- Verify animal health status
- Confirm no conflicting movements exist
- Validate dates are sequential
- Review Movement History:
- Query recent movements for the animal
- Check for pending movements
- Verify no duplicate confirmations needed
- Contact Support if Rule is Blocking:
- Some rules may have exceptions
- Business rule interpretations may vary by region
- Support may be able to provide guidance
Issue: Transaction Not Allowed
Error Code: MS-1009 (Transaction Not Allowed)
Category: 7 (Transaction not Allowed)
Severity: 10 (Fatal)
Causes:
- Service does not support this capability
- Property not authorized for this transaction type
- Species not supported by service
- User account restrictions prevent operation
Solutions:
- Verify Service Capabilities:
# Get service capabilities GET /api/services/{serviceId}/capabilities- Confirm transaction type is supported
- Check if property supports the capability
- Verify species is supported
- Check Service Mapping:
- Reference
/docs/service-selection.mdfor service availability - Different countries/regions use different services
- Species support varies by service and location
- Reference
- Review Property Configuration:
- Verify property is registered with the service
- Check property supports the species
- Confirm no restrictions are in place
Service-Specific Issues
BCMS
Service ID: 6a341eb4-828a-472f-afef-5566671738a0
Service Tag: BCMS
Country: England
Species: Cattle
Property Format: CPH (County/Parish/Holding)
Common BCMS Errors
| Error Code | Field | Cause | Solution |
|---|---|---|---|
MS-1005 |
Departure.Identifier | Invalid CPH format | Use format: XX/XXX/XXXX (e.g., 20/002/0001) |
MS-1002 |
Animal.Age | Animal too young to move | Cattle must be >= 6 weeks old |
MS-1003 |
Animal.RFID | Duplicate tag at property | Check property animals first using GET-ANM |
MS-1010 |
Animal.RFID | Animal not found at source | Verify animal exists at departure property |
MS-1004 |
Movement.Date | Invalid date format | Use YYYY-MM-DD format |
BCMS-Specific Validation Rules
Cattle Movement Requirements:
- Minimum age: 6 weeks (42 days)
- Maximum animals per transaction: 100
- Movement date must be within last 30 days
- Departure and arrival properties must both be active CPHs
- CPH must be 10 digits in format XX/XXX/XXXX
Dead Animal Recording:
- Can only record deaths at current property
- Death date must be within last 7 days
- Requires official ID (RFID or visual tag)
- Provides audit trail for disease control
Birth Registration:
- Sire must be recorded if known
- Dam must be recorded if known
- Birth date must be within 30 days
- Breed code required
BCMS Retry Strategy
- Timeouts: Retry after 5 seconds, max 3 times
- Service Errors: Retry after 30 seconds, max 5 times
- Validation Errors: Do not retry, fix data first
Contact: BCMS support for CPH validation issues
ScotMoves
Service ID: 8f34d5c2-91e8-4f2a-bb3c-7d8c9e4f5a6b
Service Tag: SCOTMOVES
Country: Scotland
Species: Cattle, Sheep
Property Format: CPH (County/Parish/Holding)
Common ScotMoves Errors
| Error Code | Field | Cause | Solution |
|---|---|---|---|
MS-1005 |
Destination.Identifier | Invalid destination CPH | Use 10-digit CPH format |
MS-1002 |
Movement.ConfirmationNo | Duplicate confirmation | Only one transaction per confirmation |
A-1000 |
ServiceProviderAuth | Invalid credentials | Contact ScotMoves support, update credentials |
MS-1006 |
Movement | Malformed request | Verify all required fields present |
MS-1007 |
Any | Service system error | Retry after 30 seconds |
ScotMoves-Specific Validation Rules
Common Settings for Cattle and Sheep:
- CPH format: XX/XXX/XXXX (10 digits)
- Movement confirmation required for completions
- 2-movement protocol: MOV-OFF then MOV-ON
- Internal movements supported (MOV-INTERNAL)
- Allocation system for temporary holdings
Authentication Notes:
- Credentials are property-specific in ScotMoves
- Different CPHs may require different usernames
- Password changes require system update
- Service tokens expire after 8 hours (auto-refresh)
ScotMoves Retry Strategy
- Timeouts: Retry after 3 seconds, max 5 times
- Service Errors (Retry category): Retry immediately, max 3 times
- Validation Errors: Check data, retry after 1 minute
Contact: ScotMoves technical support for credential issues
RMIS
Service ID: c8e4b2a1-5f7c-4d9e-8a2b-6f1c3e4d5f6g
Service Tag: RMIS
Country: South Africa
Species: Cattle, Sheep, Goats, Pigs
Property Format: GLN (Global Location Number)
Common RMIS Errors
| Error Code | Field | Cause | Solution |
|---|---|---|---|
MS-1005 |
GLN.Format | Invalid GLN format | Use 13-digit GLN (e.g., 6123456789001) |
A-1000 |
RMIS.Credentials | Invalid username/password | Regenerate credentials in RMIS portal |
MS-1002 |
Movement.Rules | Violation of movement rules | Check minimum holding period (varies by region) |
MS-1010 |
Animal.Tag | Animal not in RMIS system | Register animal first using REG capability |
MS-1004 |
Animal.Breed | Invalid breed code | Use RMIS-approved breed codes |
RMIS-Specific Validation Rules
Movement Requirements:
- GLN must be 13 digits
- Minimum holding period: Varies by province (typically 21 days)
- Animals must be registered before movement
- Movement date cannot be more than 30 days in past
- Same species requirement (cannot mix in single movement)
Retag Capability (RET):
- Used to update animal identification
- Useful for errors in original tagging
- Requires original and new tag information
Update Movement Capability:
- Can update movement arrival details (UPDATEMOV-ON)
- Can update movement departure details (UPDATEMOV-OFF)
- Use to correct data before movement completion
Breed Codes:
- RMIS uses specific breed coding
- Common: A (Angus), H (Hereford), S (Simmental), etc.
- Refer to RMIS breed code table
RMIS Retry Strategy
- Auth Failures: Do not retry, update credentials
- Timeouts: Retry after 10 seconds, max 3 times
- Service Errors (Retry): Retry after 20 seconds, max 5 times
- Validation Errors: Fix data, retry after 1 minute
Special Handling: RMIS has stricter validation than other services. Always validate locally before submission.
Contact: RMIS support for business rule clarification
DAERA/NIFAIS
Service ID: d4f5e6a7-2c3d-4e5f-6a7b-8c9d0e1f2a3b
Service Tag: DAERA
Country: Northern Ireland
Species: Cattle, Pigs
Property Format: Farm Identifier
Common DAERA Errors
| Error Code | Field | Cause | Solution |
|---|---|---|---|
A-1001 |
User.Credentials | Invalid farm login | Verify DAERA portal credentials |
MS-1004 |
Farm.Number | Invalid farm number | Confirm farm registration in DAERA |
MS-1005 |
Animal.Age | Movement restrictions for age | Young cattle may have movement restrictions |
MS-1007 |
Any | DAERA system unavailable | Usually resolves within 30 minutes |
MS-1002 |
Passport | Passport requirements not met | Cattle may need passport for some movements |
DAERA-Specific Validation Rules
Authentication Specifics:
- DAERA uses separate web-based authentication
- Portal:
https://www.daera-ni.gov.uk - User must have “NIFAIS User” role
- Password must be changed periodically (90 days)
- Failed login attempts may lock account
Cattle Movement:
- Passport required for international movements
- Some movements require pre-notification (72 hours)
- Traceability ID required
- APHIS registration may be required for some transactions
Farm Requirements:
- Farm must be registered with DAERA
- Farm identifier format varies (typically numeric)
- Only authorized users can submit movements
DAERA Authentication Issues
Issue: “User Credentials Invalid”
- Credentials are different from general DAERA portal login
- Contact DAERA NIFAIS team for NIFAIS-specific account
- Account may need additional permissions
Issue: “Service System Error” from DAERA
- DAERA systems often have maintenance windows (Friday evenings)
- Check DAERA website for scheduled maintenance
- Some regions have local blackout periods
DAERA Retry Strategy
- Auth Failures: Contact DAERA support, do not retry automatically
- Service Unavailable: Retry after 5 minutes, max 10 times
- Validation Errors: Review DAERA requirements, fix and resubmit
Contact: DAERA NIFAIS support (Northern Ireland specific)
ARAMS
Service ID: e5g6f7h8-3d4e-5f6g-7h8i-9j0k1l2m3n4o
Service Tag: ARAMS-ABATTOIR or ARAMS-FARM
Country: Australia
Species: Cattle, Sheep, Pigs, Goats
Property Format: Abattoir/Farm Identifier
Common ARAMS Errors
| Error Code | Field | Cause | Solution |
|---|---|---|---|
MS-1005 |
Abattoir.Code | Invalid abattoir code | Verify with ARAMS-approved abattoirs |
A-1000 |
ARAMS.Credentials | Invalid facility credentials | Update credentials for abattoir/farm |
MS-1002 |
Livestock.Age | Age restrictions for transport | Check ARAMS age requirements |
MS-1010 |
Animal.PIC | Animal not in NLIS | Verify animal is registered in NLIS first |
MS-1004 |
Transaction | Malformed request | Review ARAMS field requirements |
ARAMS-Specific Validation Rules
Two Service Tags:
- ARAMS-ABATTOIR: For submission to abattoirs
- ARAMS-FARM: For farm-level transactions
Livestock Requirements:
- Animals must be registered in NLIS
- PIC (Property Identification Code) required
- Traceability documentation required
- Age-appropriate for handling method
Abattoir Submissions:
- Requires abattoir code
- Animals must be approved for slaughter
- Health certificates may be required
- Processing date must be within 30 days
ARAMS Retry Strategy
- Timeouts: Retry after 5 seconds, max 5 times
- Service Errors: Retry after 30 seconds, max 3 times
- Validation Errors: Fix data, retry after 1 minute
Note: ARAMS integration is commonly problematic. Always verify NLIS integration first.
Contact: ARAMS support for abattoir code verification
LIS
Service ID: f6h7i8j9-4e5f-6g7h-8i9j-0k1l2m3n4o5p
Service Tag: LIS
Country: England
Species: Sheep
Property Format: CPH (County/Parish/Holding)
Common LIS Errors
| Error Code | Field | Cause | Solution |
|---|---|---|---|
MS-1005 |
CPH.Format | Invalid CPH format | Use 10-digit format: XX/XXX/XXXX |
MS-1004 |
Eartag.Format | Invalid eartag format | Eartag should be numeric, 6 digits |
MS-1010 |
Sheep.ID | Sheep not registered at farm | Check property animals with GET-ANM |
MS-1002 |
Movement.Date | Date conflict with existing records | Cannot move sheep twice on same day |
A-1000 |
LIS.Credentials | Invalid LIS login | Update credentials for LIS system |
LIS-Specific Validation Rules
Sheep Movement:
- Minimum age for movement: 6 weeks
- Maximum age: No limit
- Eartag format: 6 digits, numeric only
- CPH must be active and sheep-approved
LIS Authentication:
- Uses separate LIS web portal credentials
- Account may be property-specific
- Password changes required periodically
Annual Requirements:
- Sheep flock movements must align with LIS annual cycle
- Registration deadlines: End of May each year
- Pre-movement notification may be required
LIS Retry Strategy
- Timeouts: Retry after 5 seconds, max 3 times
- Auth Errors: Update credentials, retry after manual intervention
- Service Errors: Retry after 30 seconds, max 5 times
- Validation Errors: Fix data, resubmit
Contact: LIS support for flock-specific issues
EIDCymru
Service ID: g7i8j9k0-5f6g-7h8i-9j0k-1l2m3n4o5p6q
Service Tag: EIDCYMRU
Country: Wales
Species: Sheep, Cattle, Goats, Deer
Property Format: CPH (County/Parish/Holding)
Common EIDCymru Errors
| Error Code | Field | Cause | Solution |
|---|---|---|---|
MS-1005 |
CPH.Format | Invalid CPH format | Use 10-digit CPH (XX/XXX/XXXX) |
MS-1004 |
Tag.Format | Invalid tag format | Format varies by species |
A-1000 |
EIDCymru.Creds | Invalid credentials | Update in EIDCymru portal |
MS-1010 |
Animal | Animal not in EIDCymru | Register first or check property |
MS-1007 |
System | EIDCymru unavailable | Retry after 30 seconds |
EIDCymru-Specific Validation Rules
Multi-Species Support:
- Sheep: Eartag format (6 digits)
- Cattle: Visual tag + potential RFID
- Goats: Similar to cattle
- Deer: Special registration requirements
CPH Requirements:
- Must be registered with Welsh authority
- 10-digit format mandatory
- Some CPHs restricted by animal type
Language Support:
- English and Welsh are both supported
- Field labels may appear in both languages
- No impact on submission (system accepts both)
EIDCymru Retry Strategy
- Timeouts: Retry after 5 seconds, max 5 times
- Service Errors (Retry): Immediate retry, max 3 times
- Validation Errors: Fix data, wait 1 minute, retry
Contact: EIDCymru support for Welsh-specific guidance
NLIS
Service ID: h8j9k0l1-6g7h-8i9j-0k1l-2m3n4o5p6q7r
Service Tag: NLIS
Country: Australia
Species: Cattle, Sheep
Property Format: PIC (Property Identification Code)
Common NLIS Errors
| Error Code | Field | Cause | Solution |
|---|---|---|---|
MS-1005 |
PIC.Format | Invalid PIC format | PIC must be 7-8 characters |
MS-1010 |
Animal.Tag | Animal not in NLIS | Verify animal registered in state scheme |
A-1000 |
NLIS.Credentials | Invalid credentials | Update in NLIS portal |
MS-1002 |
Movement.Date | Date outside acceptable range | Movement must be current/recent |
MS-1004 |
Tag.Format | Invalid tag format | Cattle 10 digits, sheep 6 digits |
NLIS-Specific Validation Rules
Animal Identification:
- Cattle: 10-digit tags (numeric)
- Sheep: 6-digit tags (numeric)
- Tags must be in national NLIS database
- Cannot move animals without proper registration
Property Identification:
- PIC (Property Identification Code): 7-8 characters
- Must be active and approved
- Different codes for different states (NSW, VIC, QLD, etc.)
National Traceability:
- NLIS is national requirement in Australia
- All livestock movements must be recorded
- State-specific rules may apply
- Breed registration may be required
NLIS Retry Strategy
- Timeouts: Retry after 5 seconds, max 5 times
- Auth Errors: Update credentials, do not auto-retry
- Service Errors: Retry after 30 seconds, max 5 times
- Validation Errors: Fix data, retry after 1 minute
State-Specific Issues:
- Each state has slightly different requirements
- Contact state-specific NLIS coordinator if issues arise
Contact: NLIS support (state-specific) or AAFCO for national issues
NAIT
Service ID: i9k0l1m2-7h8i-9j0k-1l2m-3n4o5p6q7r8s
Service Tag: NAIT
Country: New Zealand
Species: Cattle, Deer
Property Format: NAIT Location Identifier
Common NAIT Errors
| Error Code | Field | Cause | Solution |
|---|---|---|---|
MS-1005 |
Location.ID | Invalid location ID | NAIT location must be 6-7 digits |
MS-1004 |
Animal.Tag | Invalid NAIT tag format | NAIT tags are numeric, 10+ digits |
A-1000 |
NAIT.Credentials | Invalid credentials | Update in NAIT online portal |
MS-1010 |
Animal | Animal not in NAIT | Register in NAIT before movement |
MS-1007 |
System | NAIT service error | Retry after 30 seconds |
NAIT-Specific Validation Rules
Location Identifiers:
- 6-7 digit numeric code
- Must be registered as active location
- Different codes for different regions/islands
Animal Identification:
- NAIT eartags: 10+ digits, numeric
- Unique per animal nationally
- Cannot be reused
- Must be microchip number or manufacturer ID
Movement Requirements:
- 48-hour pre-notification may be required
- Destination must be approved location
- Health status must be clear
- Export movements have additional requirements
Cattle and Deer:
- Slightly different rules per species
- Deer have additional movement restrictions
- Velvet-bearing deer have special rules
NAIT Retry Strategy
- Timeouts: Retry after 5 seconds, max 3 times
- Service Errors (Retry): Retry after 10 seconds, max 5 times
- Validation Errors: Fix data, retry after 2 minutes
- Auth Errors: Contact NAIT support
Note: NAIT is highly regulated. Consult official NAIT documentation for business rules.
Contact: NAIT (New Zealand Ministry for Primary Industries)
ScotEID
Service ID: j0l1m2n3-8i9j-0k1l-2m3n-4o5p6q7r8s9t
Service Tag: SCOTEID
Country: Scotland
Species: Sheep, Pigs
Property Format: CPH (County/Parish/Holding)
Common ScotEID Errors
| Error Code | Field | Cause | Solution |
|---|---|---|---|
MS-1005 |
CPH.Format | Invalid CPH | Use 10-digit format: XX/XXX/XXXX |
MS-1004 |
Tag.Format | Invalid eartag format | Sheep: 6 digits; Pigs: 9 digits |
A-1000 |
ScotEID.Creds | Invalid credentials | Update in ScotEID system |
MS-1010 |
Animal | Not registered in ScotEID | Register in ScotEID first |
MS-1002 |
Movement | Violates ScotEID rules | Check traceability requirements |
ScotEID-Specific Validation Rules
Species-Specific Rules:
- Sheep: Eartag format 6 digits; CPH-based registration
- Pigs: Eartag format 9 digits; pen-level tracking possible
- Different movement rules per species
CPH Registration:
- Must be registered as active
- Sheep farms and pig farms have different approvals
- Some CPHs may not support certain transaction types
Traceability:
- Movement notifications required
- Complete records for all animals
- Historical data must be maintained
- Export movements require pre-approval
ScotEID Retry Strategy
- Timeouts: Retry after 5 seconds, max 5 times
- Service Errors: Retry after 30 seconds, max 5 times
- Auth Errors: Contact ScotEID support
- Validation Errors: Fix data, wait 1 minute, retry
Contact: ScotEID support for Scottish farming-specific issues
Debugging Checklist
Use this checklist to systematically diagnose issues:
Pre-Submission Checklist
- API key is correct and not expired
- Using correct API key header (
X-Application-API-KeyorX-ServiceProvider-API-Key) - Property exists and is associated with the application
- Service is supported for the property’s species and country
- All required fields are populated
- Data types match specifications
- Dates are in ISO 8601 format or YYYY-MM-DD
- Property identifier matches service format (CPH, GLN, PIC, etc.)
- Animal tags are valid for the service
- No duplicate animal tags in transaction
Request Validation
- HTTP method is correct (POST for submit, GET for query)
- URL is correct (no typos, correct environment)
- Headers are properly formatted
- Request body is valid JSON
- No trailing whitespace in credentials
- Content-Type header is set to
application/json
Service Configuration
- Movement service is registered with EasiTrace
- Service provider credentials are configured
- Property credentials are configured for the service
- Service provider API key has not been revoked
- Application is authorized for the property
Transaction-Specific
- Transaction type (capability) is supported by service
- Species code matches animal being moved
- Property identifier is valid for the service
- Movement date is reasonable (not years in past/future)
- Animals exist at source property (if known)
- No conflicting pending movements
Error Response Handling
- Captured HTTP status code
- Captured error code (e.g., ES-1000, MS-1005)
- Noted error category and severity
- Reviewed specificError if present
- Checked field name in error message
Retry Logic
- Implemented exponential backoff
- Set maximum retry count
- Not retrying on validation errors (400)
- Not retrying on auth errors (401, 403)
- Retrying on timeout (408, 504)
- Retrying on service errors (503)
Monitoring
- Logging all transactions (sent and received)
- Monitoring error rates
- Tracking retry success rates
- Alerting on repeated failures
- Archiving failed transactions for analysis
FAQ
Q1: What is the difference between a validation error and a service system error?
A: Validation errors (ES-*, MS-1004, MS-1005) indicate that your request data is invalid. These should not be retried; instead, fix the data and resubmit. Service system errors (MS-1007, MS-1008) indicate that the movement service is having technical difficulties. These should be retried with exponential backoff.
Q2: My API key is working for some endpoints but not others. Why?
A: Different API keys have different scopes:
- Service Provider keys (
X-ServiceProvider-API-Key) access service provider endpoints - Application keys (
X-Application-API-Key) access application endpoints - Ensure you’re using the correct key type for the endpoint
- The deprecated
X-API-Keyheader may have limited access in newer versions
Q3: How long should I wait before retrying a failed request?
A: Use exponential backoff:
- 1st retry: 1-5 seconds
- 2nd retry: 5-30 seconds
- 3rd retry: 30-60 seconds
- 4th+ retries: 60-300 seconds
- Maximum recommended retries: 5-10 times
Q4: Should I retry validation errors (400)?
A: No. Validation errors indicate that your request data is invalid. Retrying will fail in the same way. Instead:
- Analyze the error message
- Fix the identified issue
- Resubmit with corrected data
Q5: How do I know if a property is registered with a movement service?
A: Check property configuration:
- Call
GET /api/properties/{propertyId}to get property details - Review the
servicesarray in the response - Verify the movement service tag is listed
- Confirm credentials are configured (check
/api/properties/{propertyId}/credentials)
Q6: What is the maximum number of animals I can submit in one transaction?
A: This varies by service:
- BCMS: 100 animals per transaction
- ScotMoves: 100 animals per transaction
- RMIS: 50 animals per transaction
- NLIS: 100 animals per transaction
- NAIT: 50 animals per transaction
- Others: Typically 100 animals per transaction
If you exceed the limit, split into multiple transactions.
Q7: Why is my movement being rejected with a “Condition Violation” error?
A: Common reasons:
- Animal is too young to be moved (minimum age requirements)
- Animal was already moved recently (holding period violations)
- Destination is invalid or restricted
- Animal is in quarantine or has health restrictions
- Species is not allowed for that movement type
Review the service-specific rules for your species and movement type.
Q8: How do I handle duplicate transactions if idempotency isn’t guaranteed?
A: Implement the following pattern:
// 1. Submit transaction with unique reference
var reference = $"TXN-{DateTime.Now:yyyyMMdd-HHmmss}-{Guid.NewGuid().ToString().Substring(0, 8)}";
// 2. Store reference and response locally
var response = await client.SubmitTransaction(transaction);
LogTransaction(reference, response);
// 3. On retry with same reference, check if already submitted
var existing = FindTransactionByReference(reference);
if (existing != null && IsSuccessful(existing))
{
// Already submitted successfully
return existing;
}
// 4. Otherwise, retry submission
Q9: What should I do if the movement service is unavailable?
A: Implement a queue:
// 1. Catch service unavailable errors (503, 504)
// 2. Store transaction in local queue (database, file, or message queue)
// 3. Implement background job to retry periodically
// 4. Monitor queue for stuck messages (>24 hours old)
// 5. Alert admin if queue grows too large
// 6. Provide UI feedback to user about delayed submission
Q10: How do I know if my credentials are wrong vs. the service is down?
A: Check error codes:
- HTTP 401/403 or
A-1000/A-1001: Credentials are invalid - HTTP 503 or
MS-1007: Service is down (may be temporary) - HTTP 408/504: Network timeout (may be service down)
To debug credentials specifically:
- Test credentials directly in the movement service portal
- Verify credentials are correctly formatted
- Check if credentials need to be refreshed (password expiration)
- Ensure credentials are stored without spaces or encoding issues
Q11: What fields are actually required for my transaction?
A: Call the service fields endpoint:
GET /api/services/{serviceId}/fields
Response includes:
{
"fields": [
{
"key": "Movement.DepartureDate",
"name": "Departure Date",
"required": true,
"type": "date",
"format": "YYYY-MM-DD"
}
]
}
Review the required attribute for each field.
Q12: How do I debug issues with specific animals in a transaction?
A: Use the animal-specific error fields:
{
"code": "MS-1010",
"field": "Animals[0].RFID",
"description": "Animal with RFID '111222333' not found at property"
}
The array index in field shows which animal (0-based) has the issue. Query the animal:
GET /api/transactions/{transactionId}/animals/{index}
Error Code Reference
EasiTrace Errors (ES-*)
| Code | Category | Severity | Meaning | Retriable |
|---|---|---|---|---|
ES-1000 |
Invalid Request | Severe | Parameter Missing | No |
ES-404 |
Invalid Request | Low | Not Found | No |
ES-1001 |
Invalid Request | Low | Already Exists | No |
ES-1002 |
Invalid Data | Medium | Invalid Data | No |
ES-1003 |
Invalid Request | Medium | Invalid Request | No |
ES-1004 |
Invalid Request | Low | Service Not Found | No |
ES-1005 |
Invalid Request | Low | Species Not Supported | No |
ES-1006 |
Invalid Request | Low | Capability Not Supported | No |
ES-1007 |
Service Error | Fatal | Server Error | Yes |
Movement Service Errors (MS-*)
| Code | Category | Severity | Meaning | Retriable |
|---|---|---|---|---|
MS-1000 |
Service Error | High | Unknown Error | Yes |
MS-1001 |
Authentication | High | Authentication Error | No |
MS-1002 |
Condition Violation | High | Condition Violation | No |
MS-1003 |
Animal | Medium | Duplicate Animal | No |
MS-1004 |
Invalid Format | High | Invalid Format | No |
MS-1005 |
Invalid Data | High | Invalid Data Value | No |
MS-1006 |
Invalid Request | Fatal | Invalid Request | No |
MS-1007 |
Service Error | Fatal | Service System Error | Yes |
MS-1008 |
Service Error (Retry) | Medium | Service System Error - Retry | Yes |
MS-1009 |
Transaction Not Allowed | Fatal | Transaction Not Allowed | No |
MS-1010 |
Animal | High | Unknown Animal | No |
MS-1012 |
Information | Low | Information Message | No |
Authentication Errors (A-*)
| Code | Category | Severity | Meaning | Retriable |
|---|---|---|---|---|
A-1000 |
Authentication | Fatal | Service Credentials Invalid | No |
A-1001 |
Authentication | Fatal | User Service Credentials Invalid | No |
A-1002 |
Authentication | High | Authorisation Error | No |
A-1003 |
Authentication | High | Service Token Invalid | No |
Animal Errors (AN-*)
| Code | Category | Severity | Meaning | Retriable |
|---|---|---|---|---|
AN-1000 |
Animal | Severe | Duplicate Animal | No |
AN-1001 |
Animal | Severe | Unknown Animal | No |
HTTP Status Code Mapping
| Status | Meaning | Retriable | Typical Codes |
|---|---|---|---|
| 400 | Bad Request | No | ES-1000, MS-1004, MS-1005 |
| 401 | Unauthorized | No | A-1000, A-1001 |
| 403 | Forbidden | No | A-1002 |
| 404 | Not Found | No | ES-404 |
| 408 | Request Timeout | Yes | (timeout on network) |
| 500 | Internal Server Error | Yes | ES-1007 |
| 503 | Service Unavailable | Yes | MS-1007, MS-1008 |
| 504 | Gateway Timeout | Yes | (service timeout) |
Support Contact Information
EasiTrace Support
Email: support@easitrace.com
Phone: +44 (0) 1234 567890
Hours: Monday-Friday, 9 AM - 5 PM GMT
Response Time: 4 hours for critical issues, 24 hours for standard
For Issues:
- API access and credentials
- Property and application setup
- Transaction submission and polling
- Error diagnosis and debugging
Service-Specific Support Contacts
BCMS (England)
Website: https://www.gov.uk/guidance/apply-to-give-cattle-movement-notice-bcms
Email: bcms@example.gov.uk
Phone: +44 (0) 8000 201 602
Support Hours: Monday-Friday, 8 AM - 5 PM GMT
For Issues:
- CPH validation
- Movement confirmation numbers
- Birth registration
- Dead animal recording
ScotMoves (Scotland)
Website: https://www.ruralpayments.org/public/scot-moves/
Email: scottish-cattle@example.gov.uk
Phone: +44 (0) 300 244 4000
Support Hours: Monday-Friday, 8 AM - 5 PM GMT
For Issues:
- CPH validation
- Movement confirmations
- Allocation system
- Cross-border movements
RMIS (South Africa)
Website: https://www.rmis.co.za/
Email: support@rmis.co.za
Phone: +27 (0) 12 000 1234
Support Hours: Monday-Friday, 8 AM - 5 PM SAST
For Issues:
- GLN validation
- Movement rules by province
- Retag capability
- Breed code verification
DAERA/NIFAIS (Northern Ireland)
Website: https://www.daera-ni.gov.uk/articles/nifais-livestock-information-system
Email: nifais@daera.gov.uk
Phone: +44 (0) 300 200 7846
Support Hours: Monday-Friday, 8:30 AM - 5 PM GMT
For Issues:
- User account setup
- Farm registration
- Passport requirements
- Movement notification timing
ARAMS (Australia)
Website: https://www.arams.com.au/
Email: support@arams.com.au
Phone: +61 (0) 2 1234 5678
Support Hours: Monday-Friday, 8 AM - 5 PM AEST
For Issues:
- NLIS integration
- Abattoir codes
- Facility credentials
- Animal traceability
LIS (England - Sheep)
Website: https://www.gov.uk/guidance/animal-movements-and-testing-for-sheep-keepers
Email: lis@example.gov.uk
Phone: +44 (0) 8000 201 602
Support Hours: Monday-Friday, 8 AM - 5 PM GMT
For Issues:
- Flock registration
- Annual deadlines
- Eartag validation
- Age requirements
EIDCymru (Wales)
Website: https://gov.wales/animal-health-and-welfare
Email: EIDCymru@example.gov.uk
Phone: +44 (0) 300 062 5015
Support Hours: Monday-Friday, 8 AM - 5 PM GMT (also Welsh language support)
For Issues:
- Multi-species support
- CPH registration
- Welsh language assistance
- Regional variations
NLIS (Australia - National)
Website: https://www.animalhealthaustralia.com.au/nlis/
Email: nlis@animalhealthaustralia.com.au
Phone: +61 (0) 2 6232 5522
Support Hours: Monday-Friday, 8 AM - 5 PM AEST
For Issues:
- National animal registration
- State-specific requirements
- Property identification codes
- Interstate movements
NAIT (New Zealand)
Website: https://www.mpi.govt.nz/nait/
Email: nait@mpi.govt.nz
Phone: +64 (0) 800 00 8287
Support Hours: Monday-Friday, 8 AM - 5 PM NZST
For Issues:
- Location registration
- Animal tag format
- Movement notifications
- Export requirements
ScotEID (Scotland - Sheep/Pigs)
Website: https://www.ruralpayments.org/public/scoteid/
Email: scoteid@example.gov.uk
Phone: +44 (0) 300 244 4000
Support Hours: Monday-Friday, 8 AM - 5 PM GMT
For Issues:
- CPH registration
- Eartag validation
- Traceability requirements
- Species-specific rules
When to Contact Support
Contact EasiTrace support for:
- General API questions
- Request/response debugging
- Error code interpretation
- Transaction submission issues
- Property and credential setup
- Integration troubleshooting
Contact Movement Service support for:
- Service-specific business rules
- Credential updates and password resets
- Movement rule clarifications
- Regional or species-specific guidance
- Direct service issues
Provide to Support:
- Transaction ID (if available)
- Error code and message
- Request payload (sanitized of sensitive data)
- Response payload
- Timestamp of the issue
- Service name and tag
- Application ID and Property ID
Additional Resources
- API Documentation: /docs/
- Error Codes: /docs/api-error-codes.md
- Transaction Submission: /docs/transactions-submit.md
- Service Capabilities: /docs/service-capabilities.md
- Service Selection Guide: /docs/service-selection.md
- Field Keys Reference: /docs/transactions-fields.md
Last Updated: January 2024
Document Version: 1.0
Maintained By: EasiTrace Technical Documentation Team