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

ParameterTypeRequiredDescription
typestringYesType of warranty event. Must be "repair" or "replacement".
charged_amountintegerYesCost of the warranty event in cents. Must be a positive integer. Example: 4500 = €45.00
product_idstringYesReference identifier of the product covered by this warranty event (reference_uuid field).
namestringNoShort label for the warranty event.
descriptionstringNoAdditional 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 statusReason
422type is not repair or replacement
422charged_amount is missing or not a positive integer
422product_id is missing
401API account not authorised for this subscription
404Subscription not found