Accept Insurance Offer
Accepts an insurance offer for a declaration in the system.
Request
POST /api/v1/declarations/{declaration_id}/insurances/{insurance_id}/accept
Parameters
| Name | Type | In | Description |
|---|---|---|---|
declaration_id | string | path | Required. The ID of the declaration |
insurance_id | string | path | Required. The ID of the insurance offer |
Headers
| Name | Description |
|---|---|
Authorization | Required. Bearer token for authentication |
X-Target-Server | Required. Target server identifier |
Example
curl --request POST \
--url '{{HOST}}/api/v1/declarations/67db101b6f7e65dcdd379d6f/insurances/682338497ac580beda9d7f7c/accept' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...' \
--header 'X-Target-Server: declaration'
Response
A successful request returns an HTTP 200 status code with "OK" response.
Status Codes
| Status Code | Description |
|---|---|
| 200 | Success |
| 400 | Bad Request - Invalid parameters |
| 401 | Unauthorized - Invalid or missing authentication token |
| 404 | Not Found - Declaration ID or Insurance ID does not exist |
| 500 | Internal Server Error |
Notes
- This endpoint is used to accept an existing insurance offer for a declaration.
- The user must have appropriate permissions to accept insurance offers.
- After accepting an insurance offer, the declaration status will be updated accordingly.