Offering Compliance API Documentation
Offering compliance functionality enables service providers to define and track compliance requirements for their marketplace offerings. Users of these offerings must complete compliance checklists, and service providers can monitor completion status across all their offerings.
Overview
The offering compliance system allows service providers to:
- Define compliance checklists for their offerings
- Track user compliance across all offerings
- Monitor completion rates and identify users needing attention
- Ensure regulatory and organizational compliance requirements are met
Architecture
The system consists of three main components:
- Compliance Checklists - Customizable questionnaires attached to offerings
- Offering Users - Users who have access to offerings and must complete compliance
- Service Provider Management - Dashboard and APIs for compliance monitoring
Configuration
Setting Up Offering Compliance
1. Create a Compliance Checklist
First, create a checklist with type offering_compliance
:
1 2 3 4 5 6 7 8 9 |
|
2. Add Questions to the Checklist
1 2 3 4 5 6 7 8 9 10 11 |
|
3. Assign Checklist to Offering
Attach the compliance checklist to an offering:
1 2 3 4 5 6 7 |
|
API Endpoints
Checking Offering Compliance Requirements
Before accessing compliance-specific endpoints, you can check if an offering has compliance requirements using the standard offering API.
Get Offering Details
1 |
|
Response includes:
1 2 3 4 5 6 |
|
Field Description:
Field | Type | Description |
---|---|---|
has_compliance_requirements |
Boolean | Indicates whether this offering requires users to complete compliance checklists |
Usage:
true
- This offering requires compliance. Users must complete checklists before using the service.false
- This offering has no compliance requirements. Users can use the service without additional checklists.
For Offering Users
These endpoints allow offering users to view and complete their compliance requirements.
Base URL Pattern
1 |
|
1. Get Compliance Checklist
Retrieves the compliance checklist for an offering user, including all questions and existing answers.
1 2 |
|
Permissions Required:
- The authenticated user must be the offering user
- Service provider staff with UPDATE_OFFERING_USER permission
Response:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
|
2. Get Completion Status
Retrieves only the completion status for the offering user's compliance.
1 2 |
|
Response:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
|
3. Submit Compliance Answers
Submit or update answers to compliance questions.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
|
Answer Data Formats:
Question Type | Format | Example |
---|---|---|
text_input |
String | "Short text answer" |
text_area |
String | "Detailed compliance information" |
boolean |
Boolean | true or false |
number |
Number | 42 or 3.14 |
single_select |
Array with one UUID | ["option-uuid"] |
multi_select |
Array with multiple UUIDs | ["option-1", "option-2"] |
Response:
1 2 3 4 5 6 7 8 9 10 11 12 |
|
For Service Providers
These endpoints allow service providers to monitor and manage compliance across all their offerings.
Base URL Pattern
1 |
|
1. Compliance Overview
Get aggregated compliance statistics for all offerings managed by the service provider.
1 2 |
|
Permissions Required:
- Customer owner or staff with LIST_SERVICE_PROVIDER_CUSTOMERS permission
Response:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
|
2. List Offering Users with Compliance Status
Get detailed compliance status for individual offering users.
1 2 |
|
Query Parameters:
Parameter | Type | Description |
---|---|---|
offering_uuid |
UUID | Filter by specific offering |
compliance_status |
String | Filter by status: completed , pending , no_checklist |
Example Request:
1 |
|
Response:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
|
Workflow Examples
Complete User Compliance Flow
- Check if offering requires compliance
1 |
|
Check the has_compliance_requirements
field in the response.
- User receives offering access
-
When an offering user is created for an offering with compliance requirements, a compliance checklist completion is automatically created
-
User views compliance requirements (only if
has_compliance_requirements
istrue
)
1 |
|
- User submits compliance answers
1 |
|
- Service provider monitors compliance
1 |
|
Service Provider Monitoring Flow
- View overall compliance statistics
1 |
|
- Identify non-compliant users
1 |
|
- Follow up with specific users
Use the user details from the response to send reminders or take action
Lifecycle Management
Automatic Checklist Creation
When an offering user is created:
- System checks if the offering has a compliance checklist
- If present, creates a ChecklistCompletion object automatically
- Links it to the offering user via generic foreign key
Automatic Cleanup
When an offering user is deleted:
- Associated ChecklistCompletion is automatically deleted
- All related answers are cascade deleted
- No orphaned data remains
Error Handling
Common Error Responses
400 Bad Request - No Checklist Configured
1 2 3 |
|
This occurs when trying to access compliance endpoints for an offering without a configured checklist.
403 Forbidden - Insufficient Permissions
1 2 3 |
|
404 Not Found - Resource Not Found
1 2 3 |
|
This can occur when:
- The offering user doesn't exist
- The service provider doesn't exist
- The user doesn't have access to the resource
Validation Errors
When submitting invalid answers:
1 2 3 4 5 6 7 8 9 |
|
Integration Patterns
Frontend Integration
When displaying offerings in your application, use the has_compliance_requirements
field to show appropriate UI elements:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
|
Order Flow Integration
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
|
Service Provider Dashboard
Use the compliance overview endpoints to build monitoring dashboards:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
|
Best Practices
For Service Providers
- Define Clear Questions
- Use descriptive question text
- Mark truly required fields as required
-
Provide helpful guidance text where needed
-
Regular Monitoring
- Check compliance overview regularly
- Follow up with users who have pending compliance
-
Consider setting up automated reminders
-
Checklist Design
- Keep checklists concise and relevant
- Group related questions logically
- Use appropriate question types for each data point
For Developers
- Performance Optimization
- Use the
has_compliance_requirements
field to avoid unnecessary API calls - Use the
compliance_overview
endpoint for dashboard views - Apply filters to reduce data transfer
-
Cache compliance status where appropriate
-
Error Handling
- Always check
has_compliance_requirements
before accessing compliance endpoints - Handle gracefully when compliance endpoints return 400 (no checklist configured)
- Handle permission errors gracefully
-
Provide clear feedback to users
-
Integration
- Check
has_compliance_requirements
in offering lists to show UI indicators - Only call compliance endpoints when
has_compliance_requirements
istrue
- Consider webhooks for compliance completion events
- Integrate with notification systems for reminders
- Build dashboards using the overview endpoints
Migration Guide
Adding Compliance to Existing Offerings
- Create the compliance checklist
- Update the offering with the checklist UUID
- Existing offering users will need to complete compliance
- New offering users will get compliance requirements automatically
Removing Compliance Requirements
- Set offering's
compliance_checklist
to null - Existing completions remain for audit purposes
- No new completions will be created
Security Considerations
- Data Privacy
- Compliance data is only visible to authorized users
- Service providers can only see data for their own offerings
-
Users can only see and edit their own compliance data
-
Audit Trail
- All answer submissions are tracked with timestamps
- User information is preserved with each answer
-
Changes are logged for compliance auditing
-
Permission Model
- Based on existing Waldur permission system
- Respects customer and project boundaries
- Service provider permissions are strictly scoped