Warranties
Use the warranty endpoint to register a repair or replacement event on a subscription item.
Endpoint: /api/public/v1/subscriptions/{id}/warranty_event
Method: POST
Swagger https://docs.sequra.com/update/reference/post_api-public-v1-subscriptions-id-warranty-event
Request
{
"type": "repair",
"name": "Lens scratch repair",
"description": "Customer reported scratched lens, covered under warranty",
"charged_amount": 4500,
"product_id": "frame-ref-001"
}Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
type | string | Yes | Type of warranty event. Must be "repair" or "replacement". |
charged_amount | integer | Yes | Cost of the warranty event in cents. Must be a positive integer. Example: 4500 = €45.00 |
product_id | string | Yes | Reference identifier of the product covered by this warranty event (reference_uuid field). |
name | string | No | Short label for the warranty event. |
description | string | No | Additional details about the event. |
Amount to charge
Recommended amount to charge is present in cart item attributes (you can use the GET endpoint to recover it). It is calculated as item monthly price multiplied by certain amount of months.
{
"id": 368,
"last_persisted_cart": {
"id": 339,
"cart_items": [
{
"reference_uuid": "2bf2c34f-f100-4a0e-9d5a-29e69a84472c",
"warranty_breakage_cost": {
"value": 6249,
"string": "62,49 €"
},
"warranty_lost_cost": {
"value": 12498,
"string": "124,98 €"
},
...
},
...
],
],
...
}
Response
{
"success": true,
"message": "Warranty event created successfully"
}Error responses
| HTTP status | Reason |
|---|---|
| 422 | type is not repair or replacement |
| 422 | charged_amount is missing or not a positive integer |
| 422 | product_id is missing |
| 401 | API account not authorised for this subscription |
| 404 | Subscription not found |
Updated about 11 hours ago