Data Models
TypeScript interfaces for User, Product, Category, Address, and Order
Last updated: Feb 09, 2026
Data Models
TypeScript interfaces for the main API data objects.
User
interface User {
id: number;
name: string;
email: string;
phone: string | null;
avatar_url: string | null;
email_verified_at: string | null;
created_at: string;
}
Product
interface Product {
id: number;
sku: string;
name: string;
slug: string;
description: string;
short_description: string;
price: number;
special_price: number | null;
final_price: number;
discount_percentage: number;
currency: string;
stock_status: 'in_stock' | 'out_of_stock';
quantity: number;
in_stock: boolean;
is_featured: boolean;
is_new: boolean;
weight: number;
dimensions: {
length: number;
width: number;
height: number;
};
brand: Brand | null;
categories: Category[];
images: ProductImage[];
variants: ProductVariant[];
attributes: ProductAttribute[];
reviews_summary: {
average_rating: number;
total_reviews: number;
};
meta: {
meta_title: string;
meta_description: string;
meta_keywords: string;
};
created_at: string;
updated_at: string;
}
Category
interface Category {
id: number;
name: string;
slug: string;
description: string | null;
image: string | null;
parent_id: number | null;
children: Category[];
}
Address
interface Address {
id: number;
type: 'shipping' | 'billing';
first_name: string;
last_name: string;
email: string;
phone: string;
address_line_1: string;
address_line_2: string | null;
city: string;
state: string;
postcode: string;
country: string;
country_name: string;
is_default_shipping: boolean;
is_default_billing: boolean;
}
Order
interface Order {
id: number;
order_number: string;
status: 'pending' | 'processing' | 'shipped' | 'delivered' | 'cancelled';
payment_status: 'pending' | 'paid' | 'failed' | 'refunded';
payment_method: string;
subtotal: number;
discount: number;
shipping: number;
tax: number;
total: number;
currency: string;
items: OrderItem[];
shipping_address: Address;
billing_address: Address;
notes: string | null;
created_at: string;
updated_at: string;
}