Tenant Configuration
2 API calls in this section.
Get Tenant Configuration
/express-shipping/config?language=enAPI: Get Tenant Configuration Endpoint: GET /express-shipping/config Purpose: Retrieve current express shipping configuration for the authenticated tenant. Returns pricing, service settings, and operational parameters. Authentication: - Bearer token: Authorization: Bearer {{access_token}} (required) - API Key: X-API-Key: {{api_key}} (alternative authentication method) Query Parameters: - language (string, optional): Preferred language for response messages (en, ar, ku) Business Logic: 1. Validate tenant authentication and permissions 2. Retrieve current express shipping configuration 3. Return comprehensive configuration settings 4. Include service status and pricing information Error Responses: 401 - Unauthorized: 403 - Forbidden: 500 - Internal Server Error:
1curl --request GET "$ONDI_BASE_URL/express-shipping/config?language=en" \2 --header "Authorization: Bearer {{access_token}}"Query parameters
languageOptionalen
Preferred language for response messages (en, ar, ku)
Headers
AuthorizationOptionalBearer {{access_token}}
Bearer token authentication (required)
Responses
1{2 "success": true,3 "data": {4 "tenant_id": "tenant_12345",5 "service_enabled": true,6 "configuration": {7 "pricing": {8 "base_price_per_kg": 10,9 "minimum_price": 5,10 "currency": "USD",11 "price_calculation_method": "weight_based",12 "free_shipping_threshold": 10013 },14 "service_settings": {15 "max_package_weight_kg": 30,16 "max_package_dimensions_cm": {17 "length": 120,18 "width": 80,19 "height": 8020 },21 "delivery_time_days": {22 "express": "3-5",23 "economy": "7-14"24 },25 "supported_countries": [26 "US",27 "CA",28 "GB",29 "DE",30 "FR"31 ],32 "restricted_items": [33 "batteries",34 "liquids",35 "fragile_electronics"36 ]37 },38 "operational": {39 "auto_confirm_orders": false,40 "require_customer_verification": true,41 "send_sms_notifications": true,42 "send_email_notifications": true,43 "tracking_updates_frequency": "real_time"44 },45 "integration": {46 "api_keys": {47 "tracking_provider": "configured",48 "sms_provider": "configured",49 "email_provider": "configured"50 },51 "webhook_endpoints": {52 "status_updates": "https://your-domain.com/webhooks/express-shipping",53 "delivery_confirmations": "https://your-domain.com/webhooks/deliveries"54 }55 }56 },57 "last_updated": "2024-01-27T10:00:00Z",58 "created_at": "2024-01-01T00:00:00Z"59 }60}1{2 "success": false,3 "message": "Express shipping configuration not found for this tenant. Please contact support to enable the service."4}1{2 "success": false,3 "message": "Authentication required. Please provide a valid access token."4}1{2 "success": false,3 "message": "Access denied. Insufficient permissions to view configuration."4}1{2 "success": false,3 "message": "Failed to retrieve configuration. Please try again."4}Update Tenant Configuration
/express-shipping/config?language=enAPI: Update Tenant Configuration Endpoint: PUT /express-shipping/config Purpose: Update express shipping configuration for the authenticated tenant. Allows modification of pricing, service settings, and operational parameters. Authentication: - Bearer token: Authorization: Bearer {{access_token}} (required) - API Key: X-API-Key: {{api_key}} (alternative authentication method) - Requires admin permissions for the tenant Request Body Fields: - configuration (object, required): Configuration object to update - pricing (object, optional): Pricing configuration - base_price_per_kg (number): Base price per kilogram - minimum_price (number): Minimum shipping price - currency (string): Currency code (USD, EUR, etc.) - price_calculation_method (string): 'weight_based' or 'fixed_rate' - free_shipping_threshold (number): Order value for free shipping - service_settings (object, optional): Service limitation settings - max_package_weight_kg (number): Maximum package weight in kg - max_package_dimensions_cm (object): Maximum dimensions - length (number): Maximum length in cm - width (number): Maximum width in cm - height (number): Maximum height in cm - delivery_time_days (object): Estimated delivery times - express (string): Express delivery time range - economy (string): Economy delivery time range - supported_countries (array): List of supported country codes - restricted_items (array): List of restricted item categories - operational (object, optional): Operational settings - auto_confirm_orders (boolean): Auto-confirm orders without review - require_customer_verification (boolean): Require customer phone verification - send_sms_notifications (boolean): Enable SMS notifications - send_email_notifications (boolean): Enable email notifications - tracking_updates_frequency (string): 'real_time', 'hourly', 'daily' - integration (object, optional): Integration settings - webhook_endpoints (object): Webhook URLs - status_updates (string): URL for status update webhooks - delivery_confirmations (string): URL for delivery confirmation webhooks Query Parameters: - language (string, optional): Preferred language for response messages Business Logic: 1. Validate tenant authentication and admin permissions 2. Validate configuration parameters and constraints 3. Update configuration settings (partial update supported) 4. Validate pricing and service settings for consistency 5. Return updated configuration Error Responses: 400 - Invalid Configuration: 403 - Insufficient Permissions: 404 - Configuration Not Found: 500 - Update Failed:
1curl --request PUT "$ONDI_BASE_URL/express-shipping/config?language=en" \2 --header "Authorization: Bearer {{access_token}}" \3 --header "Content-Type: application/json" \4 --header "Content-Type: application/json" \5 --data '{6 "configuration": {7 "pricing": {8 "base_price_per_kg": 12,9 "minimum_price": 6,10 "currency": "USD",11 "price_calculation_method": "weight_based",12 "free_shipping_threshold": 15013 },14 "service_settings": {15 "max_package_weight_kg": 25,16 "max_package_dimensions_cm": {17 "length": 100,18 "width": 70,19 "height": 7020 },21 "delivery_time_days": {22 "express": "2-4",23 "economy": "5-10"24 },25 "supported_countries": [26 "US",27 "CA",28 "GB",29 "DE",30 "FR",31 "IT"32 ],33 "restricted_items": [34 "batteries",35 "liquids",36 "fragile_electronics",37 "hazardous_materials"38 ]39 },40 "operational": {41 "auto_confirm_orders": true,42 "require_customer_verification": true,43 "send_sms_notifications": true,44 "send_email_notifications": true,45 "tracking_updates_frequency": "hourly"46 },47 "integration": {48 "webhook_endpoints": {49 "status_updates": "https://your-domain.com/webhooks/express-shipping-v2",50 "delivery_confirmations": "https://your-domain.com/webhooks/deliveries-v2"51 }52 }53 }54}'1{2 "configuration": {3 "pricing": {4 "base_price_per_kg": 12,5 "minimum_price": 6,6 "currency": "USD",7 "price_calculation_method": "weight_based",8 "free_shipping_threshold": 1509 },10 "service_settings": {11 "max_package_weight_kg": 25,12 "max_package_dimensions_cm": {13 "length": 100,14 "width": 70,15 "height": 7016 },17 "delivery_time_days": {18 "express": "2-4",19 "economy": "5-10"20 },21 "supported_countries": [22 "US",23 "CA",24 "GB",25 "DE",26 "FR",27 "IT"28 ],29 "restricted_items": [30 "batteries",31 "liquids",32 "fragile_electronics",33 "hazardous_materials"34 ]35 },36 "operational": {37 "auto_confirm_orders": true,38 "require_customer_verification": true,39 "send_sms_notifications": true,40 "send_email_notifications": true,41 "tracking_updates_frequency": "hourly"42 },43 "integration": {44 "webhook_endpoints": {45 "status_updates": "https://your-domain.com/webhooks/express-shipping-v2",46 "delivery_confirmations": "https://your-domain.com/webhooks/deliveries-v2"47 }48 }49 }50}Query parameters
languageOptionalen
Preferred language for response messages (en, ar, ku)
Request body fields
configurationExampleExample field from the request body.
configuration.pricingExampleExample field from the request body.
configuration.pricing.base_price_per_kgExampleExample field from the request body.
configuration.pricing.minimum_priceExampleExample field from the request body.
configuration.pricing.currencyExampleExample field from the request body.
configuration.pricing.price_calculation_methodExampleExample field from the request body.
configuration.pricing.free_shipping_thresholdExampleExample field from the request body.
configuration.service_settingsExampleExample field from the request body.
configuration.service_settings.max_package_weight_kgExampleExample field from the request body.
configuration.service_settings.max_package_dimensions_cmExampleExample field from the request body.
configuration.service_settings.delivery_time_daysExampleExample field from the request body.
configuration.service_settings.supported_countriesExampleExample field from the request body.
configuration.service_settings.restricted_itemsExampleExample field from the request body.
configuration.operationalExampleExample field from the request body.
configuration.operational.auto_confirm_ordersExampleExample field from the request body.
configuration.operational.require_customer_verificationExampleExample field from the request body.
configuration.operational.send_sms_notificationsExampleExample field from the request body.
configuration.operational.send_email_notificationsExampleExample field from the request body.
configuration.operational.tracking_updates_frequencyExampleExample field from the request body.
configuration.integrationExampleExample field from the request body.
configuration.integration.webhook_endpointsExampleExample field from the request body.
Headers
AuthorizationOptionalBearer {{access_token}}
Bearer token authentication (required)
Content-TypeOptionalapplication/json
Responses
1{2 "success": true,3 "data": {4 "tenant_id": "tenant_12345",5 "service_enabled": true,6 "configuration": {7 "pricing": {8 "base_price_per_kg": 12,9 "minimum_price": 6,10 "currency": "USD",11 "price_calculation_method": "weight_based",12 "free_shipping_threshold": 15013 },14 "service_settings": {15 "max_package_weight_kg": 25,16 "max_package_dimensions_cm": {17 "length": 100,18 "width": 70,19 "height": 7020 },21 "delivery_time_days": {22 "express": "2-4",23 "economy": "5-10"24 },25 "supported_countries": [26 "US",27 "CA",28 "GB",29 "DE",30 "FR",31 "IT"32 ],33 "restricted_items": [34 "batteries",35 "liquids",36 "fragile_electronics",37 "hazardous_materials"38 ]39 },40 "operational": {41 "auto_confirm_orders": true,42 "require_customer_verification": true,43 "send_sms_notifications": true,44 "send_email_notifications": true,45 "tracking_updates_frequency": "hourly"46 }47 },48 "last_updated": "2024-01-27T15:30:00Z",49 "created_at": "2024-01-01T00:00:00Z"50 },51 "message": "Configuration updated successfully"52}1{2 "success": false,3 "message": "Invalid configuration parameters",4 "details": {5 "errors": [6 "base_price_per_kg must be greater than 0",7 "minimum_price must be greater than 0"8 ]9 }10}1{2 "success": false,3 "message": "Insufficient permissions. Admin access required to update configuration."4}1{2 "success": true,3 "data": {4 "tenant_id": "tenant_12345",5 "service_enabled": true,6 "configuration": {7 "pricing": {8 "base_price_per_kg": 12,9 "minimum_price": 6,10 "currency": "USD",11 "price_calculation_method": "weight_based",12 "free_shipping_threshold": 15013 },14 "service_settings": {15 "max_package_weight_kg": 25,16 "max_package_dimensions_cm": {17 "length": 100,18 "width": 70,19 "height": 7020 },21 "delivery_time_days": {22 "express": "2-4",23 "economy": "5-10"24 },25 "supported_countries": [26 "US",27 "CA",28 "GB",29 "DE",30 "FR",31 "IT"32 ],33 "restricted_items": [34 "batteries",35 "liquids",36 "fragile_electronics",37 "hazardous_materials"38 ]39 },40 "operational": {41 "auto_confirm_orders": true,42 "require_customer_verification": true,43 "send_sms_notifications": true,44 "send_email_notifications": true,45 "tracking_updates_frequency": "hourly"46 },47 "integration": {48 "api_keys": {49 "tracking_provider": "configured",50 "sms_provider": "configured",51 "email_provider": "configured"52 },53 "webhook_endpoints": {54 "status_updates": "https://your-domain.com/webhooks/express-shipping-v2",55 "delivery_confirmations": "https://your-domain.com/webhooks/deliveries-v2"56 }57 }58 },59 "last_updated": "2024-01-27T15:30:00Z",60 "created_at": "2024-01-01T00:00:00Z"61 },62 "message": "Configuration updated successfully"63}1{2 "success": false,3 "message": "Invalid configuration parameters",4 "details": {5 "errors": [6 "base_price_per_kg must be greater than 0",7 "max_package_weight_kg cannot exceed 50kg",8 "webhook_endpoints.status_updates must be a valid URL"9 ]10 }11}1{2 "success": false,3 "message": "Express shipping configuration not found. Please contact support to initialize the service."4}1{2 "success": false,3 "message": "Failed to update configuration. Please try again."4}