{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://raw.githubusercontent.com/api-evangelist/aftership/main/json-schema/aftership-coverage-v1-schema.json", "title": "Coverage", "x-generated": "2026-10-12", "x-method": "derived", "x-generator": "derive-json-schema.py", "x-source": "openapi/aftership-coverages-api-openapi.yml#/components/schemas/Coverage.v1", "x-stoplight": { "id": "4638c8b43cf9f" }, "type": "object", "x-tags": [ "Resource" ], "properties": { "id": { "type": "string", "minLength": 1, "description": "coverage id" }, "source_id": { "type": "string" }, "policy_number": { "type": "string", "minLength": 1, "description": "policy id from insurance supplier" }, "status": { "type": "string", "minLength": 1, "description": "policy status", "enum": [ "inactive", "activated", "claimed", "expired", "void" ] }, "policy_detail_url": { "type": "string", "minLength": 1, "description": "URL of the policy detail" }, "premium": { "$ref": "#/$defs/Amount.v1" }, "effective_time": { "type": "string", "minLength": 1, "description": "Effective time of coverage, times in ISO8601 format.\n\ne.g.:\n\"2012-01-01T12:00:00Z\"", "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{3}Z$" }, "expiration_time": { "type": "string", "minLength": 1, "description": "expiration time of coverage, render times in ISO8601 format\ne.g.:\n\"2012-01-01T12:00:00Z\"", "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{3}Z$" }, "updated_at": { "type": "string", "minLength": 1, "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{3}Z$", "description": "Updated time in ISO8601 format.\n\ne.g.:\n\"2012-01-01T12:00:00Z\"" }, "created_at": { "type": "string", "minLength": 1, "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{3}Z$", "description": "Created time in ISO8601 format.\n\ne.g.:\n\"2012-01-01T12:00:00Z\"" }, "items": { "$ref": "#/$defs/Order_item.v1" }, "shipping_address": { "$ref": "#/$defs/Address.v1" }, "sender_address": { "$ref": "#/$defs/Address.v1" }, "trackings": { "type": "array", "items": { "$ref": "#/$defs/Tracking.v1" } }, "subtotal": { "$ref": "#/$defs/Amount.v1" }, "shipping_total": { "$ref": "#/$defs/Amount.v1" }, "premium_paid_by": { "type": "string", "enum": [ "receiver", "sender" ], "default": "receiver", "description": "Indicates who paid for the premium" } }, "required": [ "id", "source_id", "policy_number", "status", "policy_detail_url", "premium", "effective_time", "expiration_time", "updated_at", "created_at", "items", "shipping_address", "sender_address", "subtotal" ], "$defs": { "Address.v1": { "type": "object", "x-internal": false, "title": "Address", "x-tags": [ "Primitive" ], "properties": { "street_1": { "type": "string", "minLength": 1, "description": "Street address 1, a complete line" }, "street_2": { "type": "string", "minLength": 1, "description": "Street address 2, a complete line" }, "street_3": { "type": "string", "minLength": 1, "description": "Street address 3, a complete line" }, "postal_code": { "type": "string", "minLength": 1, "description": "Postal code / zip code" }, "city": { "type": "string", "minLength": 1, "description": "City name, e.g. San Jose" }, "state": { "type": "object", "description": "State object", "required": [ "name" ], "properties": { "name": { "type": "string", "description": "State name, e.g. California" } } }, "country_region": { "description": "Country region object", "type": "object", "required": [ "code" ], "properties": { "code": { "type": "string", "description": "Country code, ISO 3166-1 alpha 3 standard, e.g. USA" } } }, "phone": { "type": "string" }, "email": { "type": "string" }, "first_name": { "type": "string" }, "last_name": { "type": "string" } }, "required": [ "street_1", "postal_code", "city", "state", "country_region", "first_name", "last_name" ] }, "Amount.v1": { "title": "Amount", "type": "object", "x-tags": [ "Primitive" ], "properties": { "amount": { "type": "string", "pattern": "^[0-9.]+$" }, "currency": { "type": "string", "pattern": "^[A-Z]{3}$", "minLength": 3, "maxLength": 3, "description": "Only support USD for now" } }, "required": [ "amount", "currency" ] }, "Order_item.v1": { "type": "object", "x-stoplight": { "id": "33da09c0dfb8c" }, "title": "Order Item", "x-tags": [ "Primitive" ], "properties": { "source_id": { "type": "string", "description": "A globally-unique identifier for the item." }, "title": { "type": "string", "minLength": 1, "description": "Name of the product" }, "quantity": { "type": "integer", "description": "Quantity of the item in order" }, "unit_insured_amount": { "$ref": "#/$defs/Amount.v1", "description": "Indicate the insured amount for each individual item" }, "sku": { "type": "string", "minLength": 1, "description": "SKU of the product item" }, "image_urls": { "type": "array", "description": "item image urls", "items": { "type": "string" } } }, "required": [ "source_id", "title", "quantity", "unit_insured_amount" ] }, "Tracking.v1": { "title": "Tracking", "type": "object", "description": "tracking information about package.", "x-tags": [ "Primitive" ], "required": [ "slug", "tracking_number", "ship_date" ], "properties": { "slug": { "type": "string" }, "tracking_number": { "type": "string" }, "ship_date": { "type": "string", "format": "date", "description": "ship_date should be in UTC timezone." } } } } }