Skip to main content

Overview

This guide provides comprehensive information for partners integrating with the Parchment Health API. Our API follows REST principles and RFC 7807 standards to ensure consistent, predictable responses across all endpoints.

Quick Start

1. Authentication Setup

First, obtain your partner credentials:

2. Basic Request Structure

All API requests follow this pattern:

3. Response Handling

All responses follow a standardized format:

Response Standards

Success Response Structure

Error Response Structure (RFC 7807)

Common Integration Patterns

1. Patient Creation with Error Handling

2. Robust Error Handling Class

3. Validation Error Display

Status Code Reference

Success Codes

Error Codes

Best Practices

1. Request ID Logging

Always log the requestId for debugging:

2. Retry Logic with Exponential Backoff

3. Rate Limiting Handling

4. Response Caching

Testing Integration

1. Unit Tests

2. Integration Tests

Troubleshooting

Common Issues

1. Authentication Failures (401)

Problem: "Valid authentication token is required" Solutions:
  • Verify JWT token is valid and not expired
  • Check token includes required scopes
  • Ensure Bearer prefix in Authorization header

2. Partner Patient ID Conflicts (409)

Problem: "Partner patient ID already in use" Solutions:
  • Use globally unique identifiers (include timestamp/UUID)
  • Check existing patients before creation
  • Implement ID generation strategy

3. Validation Errors (422)

Problem: Field validation failures Solutions:
  • Review required fields in API documentation
  • Validate data format (dates, phone numbers)
  • Check field length limits

4. Rate Limiting (429)

Problem: "Rate limit exceeded" Solutions:
  • Implement request queuing
  • Add delays between requests
  • Use retry-after header values

Debugging Checklist

  1. Log Request IDs: Always capture and log requestId from responses
  2. Check API Version: Verify meta.apiVersion compatibility
  3. Monitor Response Times: Use meta.responseTime for performance monitoring
  4. Validate Request Format: Ensure JSON structure matches API requirements
  5. Test Authentication: Verify JWT token and scopes are correct

Support Information

When contacting support, always include:
  • Request ID: From the requestId field
  • Timestamp: When the error occurred
  • API Version: From meta.apiVersion
  • Error Details: Complete error response
  • Request Data: Sanitized request payload (remove sensitive data)
Example support request:

Migration from Legacy API

If you’re migrating from the legacy API format:

Response Format Changes

Legacy Format:
New Format:

Code Migration Example

Before:
After:
This guide provides everything needed to successfully integrate with the Parchment Health API using the new standardized response format.