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
| Code | Status | When Used | Action Required |
|---|---|---|---|
200 | OK | Data retrieved successfully | Process the returned data |
201 | Created | Resource created successfully | Store the new resource ID |
202 | Accepted | Request accepted (conflicts found) | Handle the existing resource |
204 | No Content | Resource deleted successfully | Update local state |
Error Codes
| Code | Status | Common Causes | Recommended Action |
|---|---|---|---|
400 | Bad Request | Invalid request format | Check request structure |
401 | Unauthorized | Invalid/missing token | Re-authenticate |
403 | Forbidden | Insufficient permissions | Check partner scopes |
404 | Not Found | Resource doesn’t exist | Verify resource ID |
409 | Conflict | Duplicate identifier | Use unique identifier |
422 | Unprocessable Entity | Validation failed | Fix validation errors |
429 | Too Many Requests | Rate limit exceeded | Implement backoff |
500 | Internal Server Error | Server error | Retry with backoff |
503 | Service Unavailable | Service down | Retry later |
Best Practices
1. Request ID Logging
Always log therequestId 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
Bearerprefix 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
- Log Request IDs: Always capture and log
requestIdfrom responses - Check API Version: Verify
meta.apiVersioncompatibility - Monitor Response Times: Use
meta.responseTimefor performance monitoring - Validate Request Format: Ensure JSON structure matches API requirements
- Test Authentication: Verify JWT token and scopes are correct
Support Information
When contacting support, always include:- Request ID: From the
requestIdfield - Timestamp: When the error occurred
- API Version: From
meta.apiVersion - Error Details: Complete error response
- Request Data: Sanitized request payload (remove sensitive data)

