{
	"info": {
		"_postman_id": "2khat-catalog-sync-api",
		"name": "2khat Catalog Sync API",
		"description": "REST API for the 2khat Catalog Sync WordPress plugin.\n\n## Authentication\n\nAll requests require RSA domain signature verification.\n\n1. Normalize the store domain: host from `site_url()`, without `www.` prefix.\n2. Sign the domain string with the 2khat private key (SHA256).\n3. Base64-encode the binary signature.\n4. Send: `Authorization: Twokcs <base64-signature>`\n\nLegacy: `Authorization: Basic <base64-signature>`\n\n**OpenSSL example:**\n```\necho -n \"example.com\" | openssl dgst -sha256 -sign 2khat_private.pem | openssl base64 -A\n```\n\nSet collection variables `base_url` and `auth_signature` before sending requests.",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
	},
	"auth": {
		"type": "apikey",
		"apikey": [
			{
				"key": "value",
				"value": "Twokcs {{auth_signature}}",
				"type": "string"
			},
			{
				"key": "key",
				"value": "Authorization",
				"type": "string"
			}
		]
	},
	"variable": [
		{
			"key": "base_url",
			"value": "https://example.com",
			"type": "string"
		},
		{
			"key": "auth_signature",
			"value": "PASTE_BASE64_SIGNATURE_HERE",
			"type": "string"
		}
	],
	"item": [
		{
			"name": "Version",
			"item": [
				{
					"name": "Get plugin version",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{base_url}}/wp-json/twokcs/v1/version",
							"host": ["{{base_url}}"],
							"path": ["wp-json", "twokcs", "v1", "version"]
						},
						"description": "Returns the plugin version.\n\n**Response:** `{ \"version\": \"1.0.6\" }`"
					},
					"response": []
				}
			]
		},
		{
			"name": "Products",
			"item": [
				{
					"name": "List products (paginated)",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{base_url}}/wp-json/twokcs/v1/products?page=1&per_page=100",
							"host": ["{{base_url}}"],
							"path": ["wp-json", "twokcs", "v1", "products"],
							"query": [
								{
									"key": "page",
									"value": "1",
									"description": "Page number (default: 1, min: 1)"
								},
								{
									"key": "per_page",
									"value": "100",
									"description": "Items per page (default: 100, max: 200)"
								},
								{
									"key": "status",
									"value": "publish",
									"description": "Post status filter (default: publish)",
									"disabled": true
								},
								{
									"key": "exclude",
									"value": "1,2,3",
									"description": "Comma-separated product IDs to exclude",
									"disabled": true
								},
								{
									"key": "attribute",
									"value": "color",
									"description": "Filter by attribute slug (with or without pa_ prefix)",
									"disabled": true
								},
								{
									"key": "attribute_term",
									"value": "12,13",
									"description": "Comma-separated attribute term IDs",
									"disabled": true
								},
								{
									"key": "summery",
									"value": "1",
									"description": "Return id/name/slug only (no variations)",
									"disabled": true
								},
								{
									"key": "debug",
									"value": "1",
									"description": "SQL stats when WP_DEBUG + TWOKCS_DEBUG enabled",
									"disabled": true
								}
							]
						},
						"description": "Returns paginated published products with nested variations.\n\n**Response:** `{ count, max_pages, results: [...] }`"
					},
					"response": []
				},
				{
					"name": "List products (summary mode)",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{base_url}}/wp-json/twokcs/v1/products?page=1&per_page=100&summery=1",
							"host": ["{{base_url}}"],
							"path": ["wp-json", "twokcs", "v1", "products"],
							"query": [
								{
									"key": "page",
									"value": "1"
								},
								{
									"key": "per_page",
									"value": "100"
								},
								{
									"key": "summery",
									"value": "1"
								}
							]
						},
						"description": "Lightweight product list: `{ id, name, slug }` per item."
					},
					"response": []
				},
				{
					"name": "List products (filter by attribute)",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{base_url}}/wp-json/twokcs/v1/products?attribute=color&attribute_term=12,13&page=1&per_page=100",
							"host": ["{{base_url}}"],
							"path": ["wp-json", "twokcs", "v1", "products"],
							"query": [
								{
									"key": "attribute",
									"value": "color"
								},
								{
									"key": "attribute_term",
									"value": "12,13"
								},
								{
									"key": "page",
									"value": "1"
								},
								{
									"key": "per_page",
									"value": "100"
								}
							]
						},
						"description": "Filter products by attribute slug and term IDs."
					},
					"response": []
				}
			]
		},
		{
			"name": "Categories",
			"item": [
				{
					"name": "List categories (paginated)",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{base_url}}/wp-json/twokcs/v1/categories?page=1&per_page=100",
							"host": ["{{base_url}}"],
							"path": ["wp-json", "twokcs", "v1", "categories"],
							"query": [
								{
									"key": "page",
									"value": "1",
									"description": "Page number (default: 1)"
								},
								{
									"key": "per_page",
									"value": "100",
									"description": "Items per page (default: 100, max: 200)"
								},
								{
									"key": "exclude",
									"value": "1,2,3",
									"description": "Comma-separated category term IDs to exclude",
									"disabled": true
								},
								{
									"key": "debug",
									"value": "1",
									"disabled": true
								}
							]
						},
						"description": "Returns paginated product categories.\n\n**Response:** `{ count, max_pages, results: [...] }`"
					},
					"response": []
				}
			]
		},
		{
			"name": "Attributes",
			"item": [
				{
					"name": "List attributes (paginated)",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{base_url}}/wp-json/twokcs/v1/attributes?page=1&per_page=100",
							"host": ["{{base_url}}"],
							"path": ["wp-json", "twokcs", "v1", "attributes"],
							"query": [
								{
									"key": "page",
									"value": "1"
								},
								{
									"key": "per_page",
									"value": "100"
								},
								{
									"key": "exclude",
									"value": "1,2,3",
									"description": "Comma-separated attribute IDs to exclude",
									"disabled": true
								},
								{
									"key": "debug",
									"value": "1",
									"disabled": true
								}
							]
						},
						"description": "Returns paginated WooCommerce product attributes.\n\n**Response:** `{ count, max_pages, results: [...] }`"
					},
					"response": []
				}
			]
		},
		{
			"name": "Attribute Terms",
			"item": [
				{
					"name": "List all attribute terms (paginated)",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{base_url}}/wp-json/twokcs/v1/attribute-terms?page=1&per_page=100",
							"host": ["{{base_url}}"],
							"path": ["wp-json", "twokcs", "v1", "attribute-terms"],
							"query": [
								{
									"key": "page",
									"value": "1"
								},
								{
									"key": "per_page",
									"value": "100"
								},
								{
									"key": "exclude",
									"value": "1,2,3",
									"description": "Comma-separated term IDs to exclude",
									"disabled": true
								},
								{
									"key": "debug",
									"value": "1",
									"disabled": true
								}
							]
						},
						"description": "Returns paginated attribute terms across all attributes.\n\n**Response:** `{ count, max_pages, results: [...] }`"
					},
					"response": []
				},
				{
					"name": "List attribute terms by attribute ID",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{base_url}}/wp-json/twokcs/v1/attribute-terms?attribute_id=1&page=1&per_page=100",
							"host": ["{{base_url}}"],
							"path": ["wp-json", "twokcs", "v1", "attribute-terms"],
							"query": [
								{
									"key": "attribute_id",
									"value": "1",
									"description": "Filter terms to a single attribute"
								},
								{
									"key": "page",
									"value": "1"
								},
								{
									"key": "per_page",
									"value": "100"
								}
							]
						},
						"description": "Returns terms for a single attribute only."
					},
					"response": []
				}
			]
		},
		{
			"name": "Variants",
			"item": [
				{
					"name": "List variants by product IDs",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{base_url}}/wp-json/twokcs/v1/variants?product_ids=10,20",
							"host": ["{{base_url}}"],
							"path": ["wp-json", "twokcs", "v1", "variants"],
							"query": [
								{
									"key": "product_ids",
									"value": "10,20",
									"description": "Comma-separated parent product IDs"
								},
								{
									"key": "debug",
									"value": "1",
									"disabled": true
								}
							]
						},
						"description": "Returns compact published variants grouped by parent product ID.\n\n**Response:** `{ count, results: [{ product_id, variants: [...] }] }`\n\nVariant fields: `id`, `on_sale`, `status`, `price`, `regular_price`, `sale_price`, `stock_quantity`, `stock_status`"
					},
					"response": []
				},
				{
					"name": "List variants by variation IDs",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{base_url}}/wp-json/twokcs/v1/variants?ids=305,306,307",
							"host": ["{{base_url}}"],
							"path": ["wp-json", "twokcs", "v1", "variants"],
							"query": [
								{
									"key": "ids",
									"value": "305,306,307",
									"description": "Comma-separated variation IDs (order preserved)"
								},
								{
									"key": "debug",
									"value": "1",
									"disabled": true
								}
							]
						},
						"description": "Returns compact variants for the given variation IDs in request order.\n\n**Response:** `{ count, results: [...] }`"
					},
					"response": []
				},
				{
					"name": "Get single variant by ID",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{base_url}}/wp-json/twokcs/v1/variant?id=305",
							"host": ["{{base_url}}"],
							"path": ["wp-json", "twokcs", "v1", "variant"],
							"query": [
								{
									"key": "id",
									"value": "305",
									"description": "Single variation ID"
								},
								{
									"key": "debug",
									"value": "1",
									"disabled": true
								}
							]
						},
						"description": "Returns a single compact published variant.\n\nReturns **404** when the variation is missing or not published."
					},
					"response": []
				}
			]
		}
	]
}
