CHAPTER 8

Integration and Certification

8.1 WIA-PET-009 Certification Levels

The WIA-PET-009 standard defines three certification tiers, enabling organizations to demonstrate compliance appropriate to their role in the pet nutrition ecosystem.

+----------+------------------------+-------------------------------------------+
| Level    | Requirements           | Ideal For                                 |
+----------+------------------------+-------------------------------------------+
| Level 1  | - Data Format          | - Pet food manufacturers                  |
| Basic    |   Compliance           | - Product databases                       |
|          | - JSON schema          | - Simple tracking apps                    |
|          |   validation           | - Start-ups/MVPs                          |
|          | - Core entities only   |                                           |
+----------+------------------------+-------------------------------------------+
| Level 2  | - Level 1 PLUS         | - Veterinary clinics                      |
| Advanced | - API implementation   | - Diet planning apps                      |
|          | - Authentication       | - Allergy management systems              |
|          | - Extended entities    | - Weight management platforms             |
|          | - Allergy tracking     |                                           |
+----------+------------------------+-------------------------------------------+
| Level 3  | - Level 2 PLUS         | - Smart feeder manufacturers              |
| Full     | - Real-time sync       | - Comprehensive nutrition platforms       |
|          | - IoT device           | - Veterinary management systems           |
|          |   integration          | - Enterprise solutions                    |
|          | - Security audit       |                                           |
|          | - Vet system           |                                           |
|          |   interoperability     |                                           |
+----------+------------------------+-------------------------------------------+

8.2 Certification Process

8.2.1 Application and Documentation

Step 1: Pre-Certification Assessment (Self-Service)

Step 2: Formal Application

Step 3: Documentation Submission

8.2.2 Technical Validation

Automated Testing (Level 1)

API Testing (Level 2/3)

Integration Testing (Level 3)

8.2.3 Security Audit (Level 3 Only)

Level 3 certification requires independent security assessment:

8.3 RESTful API Specification

8.3.1 Authentication

POST /api/v1/auth/token
Content-Type: application/json

{
  "grant_type": "client_credentials",
  "client_id": "your_client_id",
  "client_secret": "your_client_secret",
  "scope": "pet.read pet.write nutrition.read nutrition.write"
}

Response:
{
  "access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
  "token_type": "Bearer",
  "expires_in": 3600,
  "scope": "pet.read pet.write nutrition.read nutrition.write"
}

8.3.2 Core Endpoints

# Pet Profile Management
GET    /api/v1/pets/{petId}
POST   /api/v1/pets
PUT    /api/v1/pets/{petId}
DELETE /api/v1/pets/{petId}

# Nutritional Requirements
GET    /api/v1/pets/{petId}/nutrition/requirements
PUT    /api/v1/pets/{petId}/nutrition/requirements

# Diet Plans
GET    /api/v1/pets/{petId}/diet-plans
POST   /api/v1/pets/{petId}/diet-plans
GET    /api/v1/diet-plans/{planId}
PUT    /api/v1/diet-plans/{planId}
DELETE /api/v1/diet-plans/{planId}

# Feeding Logs
GET    /api/v1/pets/{petId}/feeding-logs
POST   /api/v1/feeding-logs
GET    /api/v1/feeding-logs/{logId}

# Allergy Profiles
GET    /api/v1/pets/{petId}/allergies
POST   /api/v1/pets/{petId}/allergies
DELETE /api/v1/pets/{petId}/allergies/{allergyId}

# Food Products
GET    /api/v1/products
GET    /api/v1/products/{productId}
POST   /api/v1/products/search
GET    /api/v1/products/{productId}/allergen-check?petId={petId}

# Weight Tracking
GET    /api/v1/pets/{petId}/weight-history
POST   /api/v1/pets/{petId}/weight-measurements

8.4 Implementation Examples

8.4.1 Creating a Pet Profile

POST /api/v1/pets
Authorization: Bearer {access_token}
Content-Type: application/json

{
  "name": "Bella",
  "species": "dog",
  "breed": "Golden Retriever",
  "birthDate": "2017-08-15",
  "sex": "female_spayed",
  "microchipId": "985112345678901",
  "weight": {
    "current": 35.2,
    "ideal": 30.0,
    "unit": "kg"
  },
  "activityLevel": "moderate",
  "healthConditions": [
    {
      "condition": "osteoarthritis",
      "severity": "mild",
      "diagnosedDate": "2024-06-10"
    }
  ]
}

Response 201 Created:
{
  "petId": "PET-2025-BELLA-7821",
  "createdAt": "2025-12-15T10:30:00Z",
  "nutritionalRequirements": {
    "href": "/api/v1/pets/PET-2025-BELLA-7821/nutrition/requirements"
  }
}

8.5 Error Handling Standards

+---------------+---------------------------+--------------------------------+
| HTTP Status   | Error Code                | When to Use                    |
+---------------+---------------------------+--------------------------------+
| 400           | INVALID_REQUEST           | Malformed JSON, missing fields |
| 401           | UNAUTHORIZED              | Missing/invalid auth token     |
| 403           | FORBIDDEN                 | Insufficient permissions       |
| 404           | RESOURCE_NOT_FOUND        | Pet ID, plan ID doesn't exist  |
| 409           | CONFLICT                  | Duplicate microchip, etc.      |
| 422           | VALIDATION_ERROR          | Invalid data values            |
| 429           | RATE_LIMIT_EXCEEDED       | Too many requests              |
| 500           | INTERNAL_SERVER_ERROR     | Unexpected server error        |
| 503           | SERVICE_UNAVAILABLE       | Temporary outage/maintenance   |
+---------------+---------------------------+--------------------------------+
Response 422 Unprocessable Entity:
{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Pet profile validation failed",
    "details": [
      {
        "field": "weight.current",
        "issue": "Must be positive number",
        "value": -5.2
      },
      {
        "field": "birthDate",
        "issue": "Cannot be future date",
        "value": "2030-01-01"
      }
    ]
  }
}

8.6 Versioning and Backwards Compatibility

WIA-PET-009 uses semantic versioning (MAJOR.MINOR.PATCH):

API Versioning Strategy:

8.7 Certification Maintenance

Annual Compliance Review:

Revocation Conditions:

8.8 Certification Benefits

For Organizations:

For Users (Pet Owners, Veterinarians):

8.9 Reference Implementations

WIA provides open-source reference implementations to accelerate adoption:

All available at: github.com/WIA-Official/wia-pet-009-reference

8.10 Future Roadmap

Version 1.1 (Q2 2026):

Version 2.0 (Q4 2027):

Chapter Summary

Five Key Takeaways:

  1. Three-Tier Certification Accommodates Ecosystem: Level 1 (data format compliance) for manufacturers/databases, Level 2 (+ API implementation) for vet clinics/apps, Level 3 (+ IoT integration, security audit) for smart feeders/enterprise—gradual adoption path reduces barriers.
  2. RESTful API Standardizes Integrations: Defined endpoints for pets, nutrition requirements, diet plans, feeding logs, allergies enable seamless data exchange—veterinary prescription → smart feeder → consumption logs → owner app without proprietary translations.
  3. Security Audit Mandatory for Level 3: IoT device certification requires independent penetration testing, encryption verification (TLS 1.3+, AES-256), GDPR-equivalent privacy compliance, and incident response planning—protects sensitive pet health data.
  4. Semantic Versioning Ensures Stability: MAJOR.MINOR.PATCH scheme (breaking.features.bugfixes) with N-1 version support for 24 months, 12-month deprecation warnings, and migration guides prevent ecosystem disruption during evolution.
  5. Open Reference Implementations Accelerate Adoption: WIA provides Node.js backend, React Native mobile SDK, Arduino/ESP32 smart feeder firmware, and FHIR veterinary plugins at github.com/WIA-Official/wia-pet-009-reference—reduces development time/cost.

Review Questions

  1. Certification Level Selection: A startup building allergy-tracking mobile app plans integration with 3 smart feeders and 2 veterinary management systems. Which certification level should they pursue and why? List specific requirements they must implement.
  2. API Implementation: Design complete API request/response for creating diet plan with 2 meals/day for weight loss, including authentication header, request body with food products and portions, success response with plan ID, and potential error responses (400, 422).
  3. Error Handling: User attempts to create pet profile with birthdate "2030-01-01", weight "-5 kg", and duplicate microchip ID already in system. Write complete 422 error response with appropriate field-level validation details per WIA-PET-009 standard.
  4. Security Architecture: Design end-to-end security for Level 3 certified smart feeder including: authentication flow for device registration, data encryption at rest/transit, owner authorization for veterinary access, and data export/deletion mechanisms.
  5. Versioning Scenario: WIA-PET-009 v2.0 introduces breaking change to allergyProfile schema. You maintain Level 2 certified diet planning app. Outline your migration strategy including: supporting both versions, deprecation timeline, user communication, testing approach.
  6. Integration Design: Architect complete system integrating: veterinary EHR (FHIR-based), smart feeder (MQTT protocol), mobile app (REST API), and weight scale (Bluetooth). Map data flows, identify transformation points, specify WIA-PET-009 entities at each integration boundary.