Back to Warranty API

Create Warranty

POST /api/v1/warranty

Creates a new warranty record. Requires brand permission for the specified brand_id.

Request Body

Field Type Required Description
brand_id integer Yes Brand ID (must have permission)
hin string Yes Hull ID Number (12 alphanumeric chars)
model string Yes Boat model name
model_code string No Internal model code
model_year string Yes Model year
is_used boolean No Whether boat is pre-owned (default: false)
registration_date string Yes YYYY-MM-DD format
purchase_date string No YYYY-MM-DD, defaults to registration_date
warranty_start_date string No YYYY-MM-DD, defaults to registration_date
warranty_duration_months integer No Duration in months (e.g., 36)
coverage_type string No full, limited, structural, hull-only, or other
warranty_status string No active (default), expired, or voided
warranty_notes string No Additional notes
order_number string No Internal order number
external_order_number string No External system order number
warranty_external_id string No External warranty ID
contact object Yes Owner contact information (see Contact Object)

Contact Object

Field Type Required Description
first_name string Yes Owner first name
last_name string Yes Owner last name
email string Conditional Email (required if no phone)
phone string Conditional Phone (required if no email)
address string No Street address
zipcode string Yes ZIP/postal code
city string No City
state string No State/province
country_code string No ISO 3166-1 alpha-2 (default: US)

Example Request

curl -X POST https://api.marquatica.com/api/v1/warranty \
  -H "Authorization: Bearer <Token>" \
  -H "Content-Type: application/json" \
  -d '{
    "brand_id": 1,
    "hin": "ABC12345DE78",
    "model": "Model XYZ",
    "model_code": "MXYZ",
    "model_year": "2025",
    "is_used": false,
    "registration_date": "2025-01-15",
    "purchase_date": "2025-01-10",
    "warranty_start_date": "2025-01-15",
    "warranty_duration_months": 36,
    "coverage_type": "full",
    "warranty_status": "active",
    "warranty_notes": "New boat purchase",
    "order_number": "ORD-2025-001",
    "external_order_number": "EXT-5678",
    "warranty_external_id": "W-99001",
    "contact": {
      "first_name": "John",
      "last_name": "Doe",
      "email": "john@example.com",
      "phone": "555-123-4567",
      "address": "123 Marina Blvd",
      "zipcode": "33101",
      "city": "Miami",
      "state": "FL",
      "country_code": "US"
    }
  }'

Success Response (201 Created)

{
  "success": true,
  "status": 201,
  "data": {
    "hin": "ABC12345DE78",
    "brand_id": 1,
    "model": "Model XYZ",
    "model_year": "2025",
    "registration_date": "2025-01-15",
    "warranty_status": "active",
    "contact": {
      "first_name": "John",
      "last_name": "Doe",
      "email": "john@example.com",
      "phone": "555-123-4567",
      "zipcode": "33101"
    }
  },
  "meta": {
    "timestamp": "2025-01-15T14:30:00.000000Z",
    "version": "0.1.2"
  }
}

Error Responses

{
  "success": false,
  "status": 422,
  "error": {
    "code": "INVALID_HIN_FORMAT",
    "message": "HIN must be 12 alphanumeric characters"
  },
  "meta": {
    "timestamp": "2026-02-12T04:40:18.689023Z",
    "version": "0.1.2"
  }
}
{
  "success": false,
  "status": 409,
  "error": {
    "code": "DUPLICATE_HIN",
    "message": "A warranty with this HIN already exists for this brand"
  },
  "meta": {
    "timestamp": "2026-02-12T04:39:36.799347Z",
    "version": "0.1.2"
  }
}
{
  "success": false,
  "status": 403,
  "error": {
    "code": "BRAND_NOT_PERMITTED",
    "message": "You do not have permission to access this brand"
  },
  "meta": {
    "timestamp": "2026-02-12T04:40:43.683236Z",
    "version": "0.1.2"
  }
}
Try It Out
cURL Preview
POST https://api.marquatica.com/api/v1/warranty
Base URL
Authorization
Bearer Token
Body Parameters
* brand_id required
* hin required
* model required
* model_year required
* registration_date required
Contact
* contact.first_name required
* contact.last_name required
* contact.email required
* contact.phone required
* contact.zipcode required
model_code optional
is_used optional
purchase_date optional
warranty_start_date optional
warranty_duration_months optional
coverage_type optional
warranty_status optional
warranty_notes optional
order_number optional
external_order_number optional
warranty_external_id optional
contact.address optional
contact.city optional
contact.state optional
contact.country_code optional
Response
Send a request to see the response
On this page