@henrylabs/mcp 1.5.0 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/auth.d.mts.map +1 -1
- package/auth.d.ts.map +1 -1
- package/code-tool-types.d.mts.map +1 -1
- package/code-tool-types.d.ts.map +1 -1
- package/code-tool-worker.mjs.map +1 -1
- package/code-tool.d.mts.map +1 -1
- package/code-tool.d.ts.map +1 -1
- package/code-tool.mjs.map +1 -1
- package/docs-search-tool.d.mts +2 -2
- package/docs-search-tool.d.mts.map +1 -1
- package/docs-search-tool.d.ts +2 -2
- package/docs-search-tool.d.ts.map +1 -1
- package/docs-search-tool.mjs.map +1 -1
- package/http.d.mts.map +1 -1
- package/http.d.ts.map +1 -1
- package/http.mjs.map +1 -1
- package/index.mjs.map +1 -1
- package/instructions.mjs.map +1 -1
- package/local-docs-search.d.mts.map +1 -1
- package/local-docs-search.d.ts.map +1 -1
- package/local-docs-search.js +121 -113
- package/local-docs-search.js.map +1 -1
- package/local-docs-search.mjs +121 -113
- package/local-docs-search.mjs.map +1 -1
- package/logger.d.mts.map +1 -1
- package/logger.d.ts.map +1 -1
- package/logger.mjs.map +1 -1
- package/methods.d.mts.map +1 -1
- package/methods.d.ts.map +1 -1
- package/options.mjs.map +1 -1
- package/package.json +2 -2
- package/server.d.mts.map +1 -1
- package/server.d.ts.map +1 -1
- package/server.js +1 -1
- package/server.mjs +1 -1
- package/server.mjs.map +1 -1
- package/src/local-docs-search.ts +125 -116
- package/src/server.ts +1 -1
- package/stdio.d.mts.map +1 -1
- package/stdio.d.ts.map +1 -1
- package/stdio.mjs.map +1 -1
- package/types.d.mts.map +1 -1
- package/types.d.ts.map +1 -1
package/local-docs-search.mjs
CHANGED
|
@@ -13,20 +13,20 @@ const EMBEDDED_METHODS = [
|
|
|
13
13
|
stainlessPath: '(resource) products > (method) search',
|
|
14
14
|
qualified: 'client.products.search',
|
|
15
15
|
params: [
|
|
16
|
-
"{ filters: { query: string; type: 'text'; country?: string; price?: { currency?: string; max?: number; min?: number; }; sortBy?: 'price-low-to-high' | 'price-high-to-low'; } | { imageUrl: string; type: 'image'; country?: string; }; type: 'global'; cursor?: number; limit?: number; mode?: 'async' | 'sync'; } | { filters: { merchant: string; country?: string; }; type: 'merchant'; cursor?: number; limit?: number; mode?: 'async' | 'sync'; query?: string; };",
|
|
16
|
+
"{ filters: { query: string; type: 'text'; country?: string; price?: { currency?: string; max?: number; min?: number; }; sortBy?: 'price-low-to-high' | 'price-high-to-low'; } | { imageUrl: string; type: 'image'; country?: string; }; type: 'global'; cursor?: number; limit?: number; mode?: 'async' | 'sync'; skipCache?: boolean; } | { filters: { merchant: string; country?: string; }; type: 'merchant'; cursor?: number; limit?: number; mode?: 'async' | 'sync'; query?: string; skipCache?: boolean; };",
|
|
17
17
|
],
|
|
18
|
-
response: "{ refId: string; status: 'pending' | 'processing' | 'complete' | 'failed'; error?: object; result?: { pagination: { nextCursor: number; previousCursor: number; }; products: { host: string; link: string; merchant: string; name: string; availability?: 'in_stock' | 'limited_stock' | 'out_of_stock' | 'preorder' | 'backorder'; description?: string; images?: object[]; options?: object | object; originalPrice?: object; price?: object; sku?: string; }[]; }; }",
|
|
18
|
+
response: "{ refId: string; status: 'pending' | 'processing' | 'complete' | 'failed'; error?: object; result?: { pagination: { nextCursor: number; previousCursor: number; }; products: { host: string; link: string; merchant: string; name: string; availability?: 'in_stock' | 'limited_stock' | 'out_of_stock' | 'preorder' | 'backorder'; description?: string; images?: object[]; options?: object | object; originalPrice?: object; price?: object; reviews?: object; sku?: string; }[]; }; }",
|
|
19
19
|
perLanguage: {
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
typescript: {
|
|
21
|
+
method: 'client.products.search',
|
|
22
|
+
example: "import HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK({\n apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.products.search({\n filters: {\n type: 'text',\n query: 'Air Max Shoes',\n country: 'US',\n price: {\n min: 1,\n max: 100,\n currency: 'USD',\n },\n sortBy: 'price-low-to-high',\n },\n type: 'global',\n limit: 40,\n mode: 'async',\n});\n\nconsole.log(response.refId);",
|
|
22
23
|
},
|
|
23
24
|
python: {
|
|
24
25
|
method: 'products.search',
|
|
25
26
|
example: 'import os\nfrom henry_sdk import HenrySDK\n\nclient = HenrySDK(\n api_key=os.environ.get("HENRY_SDK_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.products.search(\n filters={\n "type": "text",\n "query": "Air Max Shoes",\n "country": "US",\n "price": {\n "min": 1,\n "max": 100,\n "currency": "USD",\n },\n "sort_by": "price-low-to-high",\n },\n type="global",\n cursor=0,\n limit=40,\n mode="async",\n)\nprint(response.ref_id)',
|
|
26
27
|
},
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
example: "import HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK({\n apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.products.search({\n filters: {\n type: 'text',\n query: 'Air Max Shoes',\n country: 'US',\n price: {\n min: 1,\n max: 100,\n currency: 'USD',\n },\n sortBy: 'price-low-to-high',\n },\n type: 'global',\n limit: 40,\n mode: 'async',\n});\n\nconsole.log(response.refId);",
|
|
28
|
+
http: {
|
|
29
|
+
example: 'curl https://api.henrylabs.ai/v1/product/search \\\n -H \'Content-Type: application/json\' \\\n -H "x-api-key: $HENRY_SDK_API_KEY" \\\n -d \'{\n "filters": {\n "query": "Air Max Shoes",\n "type": "text"\n },\n "type": "global",\n "cursor": 0,\n "limit": 20,\n "skipCache": false\n }\'',
|
|
30
30
|
},
|
|
31
31
|
},
|
|
32
32
|
},
|
|
@@ -39,19 +39,19 @@ const EMBEDDED_METHODS = [
|
|
|
39
39
|
stainlessPath: '(resource) products > (method) poll_search',
|
|
40
40
|
qualified: 'client.products.pollSearch',
|
|
41
41
|
params: ['refId: string;'],
|
|
42
|
-
response: "{ refId: string; status: 'pending' | 'processing' | 'complete' | 'failed'; error?: object; result?: { pagination: { nextCursor: number; previousCursor: number; }; products: { host: string; link: string; merchant: string; name: string; availability?: 'in_stock' | 'limited_stock' | 'out_of_stock' | 'preorder' | 'backorder'; description?: string; images?: object[]; options?: object | object; originalPrice?: object; price?: object; sku?: string; }[]; }; }",
|
|
43
|
-
markdown: "## poll_search\n\n`client.products.pollSearch(refId: string): { refId: string; status: 'pending' | 'processing' | 'complete' | 'failed'; error?: object; result?: object; }`\n\n**get** `/product/search/status`\n\nCheck the status of a product search retrieval job and get results when ready.\n\n### Parameters\n\n- `refId: string`\n Reference ID used for checking status\n\n### Returns\n\n- `{ refId: string; status: 'pending' | 'processing' | 'complete' | 'failed'; error?: object; result?: { pagination: { nextCursor: number; previousCursor: number; }; products: { host: string; link: string; merchant: string; name: string; availability?: 'in_stock' | 'limited_stock' | 'out_of_stock' | 'preorder' | 'backorder'; description?: string; images?: object[]; options?: object | object; originalPrice?: object; price?: object; sku?: string; }[]; }; }`\n\n - `refId: string`\n - `status: 'pending' | 'processing' | 'complete' | 'failed'`\n - `error?: object`\n - `result?: { pagination: { nextCursor: number; previousCursor: number; }; products: { host: string; link: string; merchant: string; name: string; availability?: 'in_stock' | 'limited_stock' | 'out_of_stock' | 'preorder' | 'backorder'; description?: string; images?: { url: string; isFeatured?: boolean; }[]; options?: { status: 'found'; values: { value: string; availability?: 'in_stock' | 'limited_stock' | 'out_of_stock' | 'preorder' | 'backorder'; images?: object[]; label?: string; link?: string; nextOption?: object; }[]; label?: string; } | { message: string; status: 'unknown'; }; originalPrice?: { currency:
|
|
42
|
+
response: "{ refId: string; status: 'pending' | 'processing' | 'complete' | 'failed'; error?: object; result?: { pagination: { nextCursor: number; previousCursor: number; }; products: { host: string; link: string; merchant: string; name: string; availability?: 'in_stock' | 'limited_stock' | 'out_of_stock' | 'preorder' | 'backorder'; description?: string; images?: object[]; options?: object | object; originalPrice?: object; price?: object; reviews?: object; sku?: string; }[]; }; }",
|
|
43
|
+
markdown: "## poll_search\n\n`client.products.pollSearch(refId: string): { refId: string; status: 'pending' | 'processing' | 'complete' | 'failed'; error?: object; result?: object; }`\n\n**get** `/product/search/status`\n\nCheck the status of a product search retrieval job and get results when ready.\n\n### Parameters\n\n- `refId: string`\n Reference ID used for checking status\n\n### Returns\n\n- `{ refId: string; status: 'pending' | 'processing' | 'complete' | 'failed'; error?: object; result?: { pagination: { nextCursor: number; previousCursor: number; }; products: { host: string; link: string; merchant: string; name: string; availability?: 'in_stock' | 'limited_stock' | 'out_of_stock' | 'preorder' | 'backorder'; description?: string; images?: object[]; options?: object | object; originalPrice?: object; price?: object; reviews?: object; sku?: string; }[]; }; }`\n\n - `refId: string`\n - `status: 'pending' | 'processing' | 'complete' | 'failed'`\n - `error?: object`\n - `result?: { pagination: { nextCursor: number; previousCursor: number; }; products: { host: string; link: string; merchant: string; name: string; availability?: 'in_stock' | 'limited_stock' | 'out_of_stock' | 'preorder' | 'backorder'; description?: string; images?: { url: string; isFeatured?: boolean; }[]; options?: { status: 'found'; values: { value: string; availability?: 'in_stock' | 'limited_stock' | 'out_of_stock' | 'preorder' | 'backorder'; images?: object[]; label?: string; link?: string; nextOption?: object; }[]; label?: string; } | { message: string; status: 'unknown'; }; originalPrice?: { currency: string; value: number; }; price?: { currency: string; value: number; }; reviews?: { count?: number; criticRatings?: { name: string; rating: string; link?: string; }[]; histogram?: { count: number; stars: number; }[]; insights?: { snippets: string[]; title: string; }[]; rating?: number; userReviews?: { text: string; author?: string; date?: string; images?: string[]; rating?: number; source?: string; title?: string; }[]; }; sku?: string; }[]; }`\n\n### Example\n\n```typescript\nimport HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK();\n\nconst response = await client.products.pollSearch({ refId: 'prs-ref_3fa85f64-5717-4562-b3fc' });\n\nconsole.log(response);\n```",
|
|
44
44
|
perLanguage: {
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
typescript: {
|
|
46
|
+
method: 'client.products.pollSearch',
|
|
47
|
+
example: "import HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK({\n apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.products.pollSearch({ refId: 'prs-ref_3fa85f64-5717-4562-b3fc' });\n\nconsole.log(response.refId);",
|
|
47
48
|
},
|
|
48
49
|
python: {
|
|
49
50
|
method: 'products.poll_search',
|
|
50
51
|
example: 'import os\nfrom henry_sdk import HenrySDK\n\nclient = HenrySDK(\n api_key=os.environ.get("HENRY_SDK_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.products.poll_search(\n ref_id="prs-ref_3fa85f64-5717-4562-b3fc",\n)\nprint(response.ref_id)',
|
|
51
52
|
},
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
example: "import HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK({\n apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.products.pollSearch({ refId: 'prs-ref_3fa85f64-5717-4562-b3fc' });\n\nconsole.log(response.refId);",
|
|
53
|
+
http: {
|
|
54
|
+
example: 'curl https://api.henrylabs.ai/v1/product/search/status \\\n -H "x-api-key: $HENRY_SDK_API_KEY"',
|
|
55
55
|
},
|
|
56
56
|
},
|
|
57
57
|
},
|
|
@@ -63,20 +63,26 @@ const EMBEDDED_METHODS = [
|
|
|
63
63
|
description: 'Fetch detailed information about a product from a given URL. Requests are async by default, or use mode=sync to wait up to 30 seconds for completion.',
|
|
64
64
|
stainlessPath: '(resource) products > (method) details',
|
|
65
65
|
qualified: 'client.products.details',
|
|
66
|
-
params: [
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
params: [
|
|
67
|
+
'link: string;',
|
|
68
|
+
'country?: string;',
|
|
69
|
+
"mode?: 'async' | 'sync';",
|
|
70
|
+
'selectedOptions?: string[];',
|
|
71
|
+
'skipCache?: boolean;',
|
|
72
|
+
],
|
|
73
|
+
response: "{ refId: string; status: 'pending' | 'processing' | 'complete' | 'failed'; error?: object; result?: { host: string; link: string; merchant: string; name: string; availability?: 'in_stock' | 'limited_stock' | 'out_of_stock' | 'preorder' | 'backorder'; description?: string; images?: { url: string; isFeatured?: boolean; }[]; options?: { status: 'found'; values: object[]; label?: string; } | { message: string; status: 'unknown'; }; originalPrice?: { currency: string; value: number; }; price?: { currency: string; value: number; }; reviews?: { count?: number; criticRatings?: object[]; histogram?: object[]; insights?: object[]; rating?: number; userReviews?: object[]; }; sections?: { body: string; title: string; }[]; sku?: string; }; }",
|
|
74
|
+
markdown: "## details\n\n`client.products.details(link: string, country?: string, mode?: 'async' | 'sync', selectedOptions?: string[], skipCache?: boolean): { refId: string; status: 'pending' | 'processing' | 'complete' | 'failed'; error?: object; result?: object; }`\n\n**post** `/product/details`\n\nFetch detailed information about a product from a given URL. Requests are async by default, or use mode=sync to wait up to 30 seconds for completion.\n\n### Parameters\n\n- `link: string`\n Direct product URL\n\n- `country?: string`\n Country code for the product's location\n\n- `mode?: 'async' | 'sync'`\n Response mode. Use sync to wait up to 30 seconds for the backing worker flow to complete.\n\n- `selectedOptions?: string[]`\n An ordered array of option values to select for the product. Will be selected in the order listed.\n\n- `skipCache?: boolean`\n When true, bypass any cached product details and force a fresh fetch. Fresh results still repopulate the cache.\n\n### Returns\n\n- `{ refId: string; status: 'pending' | 'processing' | 'complete' | 'failed'; error?: object; result?: { host: string; link: string; merchant: string; name: string; availability?: 'in_stock' | 'limited_stock' | 'out_of_stock' | 'preorder' | 'backorder'; description?: string; images?: { url: string; isFeatured?: boolean; }[]; options?: { status: 'found'; values: object[]; label?: string; } | { message: string; status: 'unknown'; }; originalPrice?: { currency: string; value: number; }; price?: { currency: string; value: number; }; reviews?: { count?: number; criticRatings?: object[]; histogram?: object[]; insights?: object[]; rating?: number; userReviews?: object[]; }; sections?: { body: string; title: string; }[]; sku?: string; }; }`\n\n - `refId: string`\n - `status: 'pending' | 'processing' | 'complete' | 'failed'`\n - `error?: object`\n - `result?: { host: string; link: string; merchant: string; name: string; availability?: 'in_stock' | 'limited_stock' | 'out_of_stock' | 'preorder' | 'backorder'; description?: string; images?: { url: string; isFeatured?: boolean; }[]; options?: { status: 'found'; values: { value: string; availability?: 'in_stock' | 'limited_stock' | 'out_of_stock' | 'preorder' | 'backorder'; images?: { url: string; isFeatured?: boolean; }[]; label?: string; link?: string; nextOption?: object; }[]; label?: string; } | { message: string; status: 'unknown'; }; originalPrice?: { currency: string; value: number; }; price?: { currency: string; value: number; }; reviews?: { count?: number; criticRatings?: { name: string; rating: string; link?: string; }[]; histogram?: { count: number; stars: number; }[]; insights?: { snippets: string[]; title: string; }[]; rating?: number; userReviews?: { text: string; author?: string; date?: string; images?: string[]; rating?: number; source?: string; title?: string; }[]; }; sections?: { body: string; title: string; }[]; sku?: string; }`\n\n### Example\n\n```typescript\nimport HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK();\n\nconst response = await client.products.details({ link: 'https://www.nike.com/u/custom-nike-ja-3-by-you-10002205' });\n\nconsole.log(response);\n```",
|
|
69
75
|
perLanguage: {
|
|
70
|
-
|
|
71
|
-
|
|
76
|
+
typescript: {
|
|
77
|
+
method: 'client.products.details',
|
|
78
|
+
example: "import HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK({\n apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.products.details({\n link: 'https://www.nike.com/u/custom-nike-ja-3-by-you-10002205',\n country: 'US',\n mode: 'async',\n});\n\nconsole.log(response.refId);",
|
|
72
79
|
},
|
|
73
80
|
python: {
|
|
74
81
|
method: 'products.details',
|
|
75
82
|
example: 'import os\nfrom henry_sdk import HenrySDK\n\nclient = HenrySDK(\n api_key=os.environ.get("HENRY_SDK_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.products.details(\n link="https://www.nike.com/u/custom-nike-ja-3-by-you-10002205",\n country="US",\n mode="async",\n)\nprint(response.ref_id)',
|
|
76
83
|
},
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
example: "import HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK({\n apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.products.details({\n link: 'https://www.nike.com/u/custom-nike-ja-3-by-you-10002205',\n country: 'US',\n mode: 'async',\n});\n\nconsole.log(response.refId);",
|
|
84
|
+
http: {
|
|
85
|
+
example: 'curl https://api.henrylabs.ai/v1/product/details \\\n -H \'Content-Type: application/json\' \\\n -H "x-api-key: $HENRY_SDK_API_KEY" \\\n -d \'{\n "link": "https://www.nike.com/u/custom-nike-ja-3-by-you-10002205",\n "country": "US",\n "mode": "async",\n "selectedOptions": [\n "regular",\n "black",\n "10-w"\n ],\n "skipCache": false\n }\'',
|
|
80
86
|
},
|
|
81
87
|
},
|
|
82
88
|
},
|
|
@@ -89,19 +95,19 @@ const EMBEDDED_METHODS = [
|
|
|
89
95
|
stainlessPath: '(resource) products > (method) poll_details',
|
|
90
96
|
qualified: 'client.products.pollDetails',
|
|
91
97
|
params: ['refId: string;'],
|
|
92
|
-
response: "{ refId: string; status: 'pending' | 'processing' | 'complete' | 'failed'; error?: object; result?: { host: string; link: string; merchant: string; name: string; availability?: 'in_stock' | 'limited_stock' | 'out_of_stock' | 'preorder' | 'backorder'; description?: string; images?: { url: string; isFeatured?: boolean; }[]; options?: { status: 'found'; values: object[]; label?: string; } | { message: string; status: 'unknown'; }; originalPrice?: { currency:
|
|
93
|
-
markdown: "## poll_details\n\n`client.products.pollDetails(refId: string): { refId: string; status: 'pending' | 'processing' | 'complete' | 'failed'; error?: object; result?: object; }`\n\n**get** `/product/details/status`\n\nCheck the status of a product details retrieval job and get results when ready.\n\n### Parameters\n\n- `refId: string`\n Reference ID used for checking status\n\n### Returns\n\n- `{ refId: string; status: 'pending' | 'processing' | 'complete' | 'failed'; error?: object; result?: { host: string; link: string; merchant: string; name: string; availability?: 'in_stock' | 'limited_stock' | 'out_of_stock' | 'preorder' | 'backorder'; description?: string; images?: { url: string; isFeatured?: boolean; }[]; options?: { status: 'found'; values: object[]; label?: string; } | { message: string; status: 'unknown'; }; originalPrice?: { currency:
|
|
98
|
+
response: "{ refId: string; status: 'pending' | 'processing' | 'complete' | 'failed'; error?: object; result?: { host: string; link: string; merchant: string; name: string; availability?: 'in_stock' | 'limited_stock' | 'out_of_stock' | 'preorder' | 'backorder'; description?: string; images?: { url: string; isFeatured?: boolean; }[]; options?: { status: 'found'; values: object[]; label?: string; } | { message: string; status: 'unknown'; }; originalPrice?: { currency: string; value: number; }; price?: { currency: string; value: number; }; reviews?: { count?: number; criticRatings?: object[]; histogram?: object[]; insights?: object[]; rating?: number; userReviews?: object[]; }; sections?: { body: string; title: string; }[]; sku?: string; }; }",
|
|
99
|
+
markdown: "## poll_details\n\n`client.products.pollDetails(refId: string): { refId: string; status: 'pending' | 'processing' | 'complete' | 'failed'; error?: object; result?: object; }`\n\n**get** `/product/details/status`\n\nCheck the status of a product details retrieval job and get results when ready.\n\n### Parameters\n\n- `refId: string`\n Reference ID used for checking status\n\n### Returns\n\n- `{ refId: string; status: 'pending' | 'processing' | 'complete' | 'failed'; error?: object; result?: { host: string; link: string; merchant: string; name: string; availability?: 'in_stock' | 'limited_stock' | 'out_of_stock' | 'preorder' | 'backorder'; description?: string; images?: { url: string; isFeatured?: boolean; }[]; options?: { status: 'found'; values: object[]; label?: string; } | { message: string; status: 'unknown'; }; originalPrice?: { currency: string; value: number; }; price?: { currency: string; value: number; }; reviews?: { count?: number; criticRatings?: object[]; histogram?: object[]; insights?: object[]; rating?: number; userReviews?: object[]; }; sections?: { body: string; title: string; }[]; sku?: string; }; }`\n\n - `refId: string`\n - `status: 'pending' | 'processing' | 'complete' | 'failed'`\n - `error?: object`\n - `result?: { host: string; link: string; merchant: string; name: string; availability?: 'in_stock' | 'limited_stock' | 'out_of_stock' | 'preorder' | 'backorder'; description?: string; images?: { url: string; isFeatured?: boolean; }[]; options?: { status: 'found'; values: { value: string; availability?: 'in_stock' | 'limited_stock' | 'out_of_stock' | 'preorder' | 'backorder'; images?: { url: string; isFeatured?: boolean; }[]; label?: string; link?: string; nextOption?: object; }[]; label?: string; } | { message: string; status: 'unknown'; }; originalPrice?: { currency: string; value: number; }; price?: { currency: string; value: number; }; reviews?: { count?: number; criticRatings?: { name: string; rating: string; link?: string; }[]; histogram?: { count: number; stars: number; }[]; insights?: { snippets: string[]; title: string; }[]; rating?: number; userReviews?: { text: string; author?: string; date?: string; images?: string[]; rating?: number; source?: string; title?: string; }[]; }; sections?: { body: string; title: string; }[]; sku?: string; }`\n\n### Example\n\n```typescript\nimport HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK();\n\nconst response = await client.products.pollDetails({ refId: 'prd-ref_3fa85f64-5717-4562-b3fc' });\n\nconsole.log(response);\n```",
|
|
94
100
|
perLanguage: {
|
|
95
|
-
|
|
96
|
-
|
|
101
|
+
typescript: {
|
|
102
|
+
method: 'client.products.pollDetails',
|
|
103
|
+
example: "import HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK({\n apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.products.pollDetails({ refId: 'prd-ref_3fa85f64-5717-4562-b3fc' });\n\nconsole.log(response.refId);",
|
|
97
104
|
},
|
|
98
105
|
python: {
|
|
99
106
|
method: 'products.poll_details',
|
|
100
107
|
example: 'import os\nfrom henry_sdk import HenrySDK\n\nclient = HenrySDK(\n api_key=os.environ.get("HENRY_SDK_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.products.poll_details(\n ref_id="prd-ref_3fa85f64-5717-4562-b3fc",\n)\nprint(response.ref_id)',
|
|
101
108
|
},
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
example: "import HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK({\n apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.products.pollDetails({ refId: 'prd-ref_3fa85f64-5717-4562-b3fc' });\n\nconsole.log(response.refId);",
|
|
109
|
+
http: {
|
|
110
|
+
example: 'curl https://api.henrylabs.ai/v1/product/details/status \\\n -H "x-api-key: $HENRY_SDK_API_KEY"',
|
|
105
111
|
},
|
|
106
112
|
},
|
|
107
113
|
},
|
|
@@ -115,22 +121,22 @@ const EMBEDDED_METHODS = [
|
|
|
115
121
|
qualified: 'client.cart.create',
|
|
116
122
|
params: [
|
|
117
123
|
'items: { link: string; affiliateProductLink?: string; coupons?: string[]; metadata?: object; quantity?: number; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }[];',
|
|
118
|
-
"settings?: { commissionFeeFixed?: { value: number; currency?:
|
|
124
|
+
"settings?: { commissionFeeFixed?: { value: number; currency?: string; }; commissionFeePercent?: number; events?: { data: { points: number; type: 'give_points_fixed'; } | { perAmount: { currency: string; value: number; }; points: number; type: 'give_points_per_spent'; } | { points: number; type: 'remove_points_fixed'; } | { perAmount: { currency: string; value: number; }; points: number; type: 'remove_points_per_spent'; } | { tierUUID: string; type: 'give_tier'; } | { type: 'remove_tier'; } | { type: 'send_webhook'; webhookUUID: string; } | { type: 'send_email'; }[]; type: string; conditional?: { operator: 'equals' | 'not_equals'; type: 'tier'; value: string; } | { operator: string; type: 'points'; value: number; }; }[]; options?: { allowPartialPurchase?: boolean; collectBuyerAddress?: 'off' | 'required' | 'optional'; collectBuyerEmail?: 'off' | 'required' | 'optional'; collectBuyerPhone?: 'off' | 'required' | 'optional'; }; };",
|
|
119
125
|
'tags?: object;',
|
|
120
126
|
],
|
|
121
127
|
response: '{ data: { cartId: string; checkoutUrl: string; data: { items: object[]; settings?: object; tags?: object; }; metadata?: object; }; message: string; status: string; success: boolean; }',
|
|
122
|
-
markdown: "## create\n\n`client.cart.create(items: { link: string; affiliateProductLink?: string; coupons?: string[]; metadata?: object; quantity?: number; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }[], settings?: { commissionFeeFixed?: { value: number; currency?:
|
|
128
|
+
markdown: "## create\n\n`client.cart.create(items: { link: string; affiliateProductLink?: string; coupons?: string[]; metadata?: object; quantity?: number; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }[], settings?: { commissionFeeFixed?: { value: number; currency?: string; }; commissionFeePercent?: number; events?: { data: object | object | object | object | object | object | object | object[]; type: string; conditional?: object | object; }[]; options?: { allowPartialPurchase?: boolean; collectBuyerAddress?: 'off' | 'required' | 'optional'; collectBuyerEmail?: 'off' | 'required' | 'optional'; collectBuyerPhone?: 'off' | 'required' | 'optional'; }; }, tags?: object): { data: object; message: string; status: string; success: boolean; }`\n\n**post** `/cart`\n\nCreate a cart with one or more items and get a checkout URL\n\n### Parameters\n\n- `items: { link: string; affiliateProductLink?: string; coupons?: string[]; metadata?: object; quantity?: number; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }[]`\n Items to include in the cart\n\n- `settings?: { commissionFeeFixed?: { value: number; currency?: string; }; commissionFeePercent?: number; events?: { data: { points: number; type: 'give_points_fixed'; } | { perAmount: { currency: string; value: number; }; points: number; type: 'give_points_per_spent'; } | { points: number; type: 'remove_points_fixed'; } | { perAmount: { currency: string; value: number; }; points: number; type: 'remove_points_per_spent'; } | { tierUUID: string; type: 'give_tier'; } | { type: 'remove_tier'; } | { type: 'send_webhook'; webhookUUID: string; } | { type: 'send_email'; }[]; type: string; conditional?: { operator: 'equals' | 'not_equals'; type: 'tier'; value: string; } | { operator: string; type: 'points'; value: number; }; }[]; options?: { allowPartialPurchase?: boolean; collectBuyerAddress?: 'off' | 'required' | 'optional'; collectBuyerEmail?: 'off' | 'required' | 'optional'; collectBuyerPhone?: 'off' | 'required' | 'optional'; }; }`\n - `commissionFeeFixed?: { value: number; currency?: string; }`\n - `commissionFeePercent?: number`\n Commission percentage (0–100)\n - `events?: { data: { points: number; type: 'give_points_fixed'; } | { perAmount: { currency: string; value: number; }; points: number; type: 'give_points_per_spent'; } | { points: number; type: 'remove_points_fixed'; } | { perAmount: { currency: string; value: number; }; points: number; type: 'remove_points_per_spent'; } | { tierUUID: string; type: 'give_tier'; } | { type: 'remove_tier'; } | { type: 'send_webhook'; webhookUUID: string; } | { type: 'send_email'; }[]; type: string; conditional?: { operator: 'equals' | 'not_equals'; type: 'tier'; value: string; } | { operator: string; type: 'points'; value: number; }; }[]`\n List of events to trigger during checkout\n - `options?: { allowPartialPurchase?: boolean; collectBuyerAddress?: 'off' | 'required' | 'optional'; collectBuyerEmail?: 'off' | 'required' | 'optional'; collectBuyerPhone?: 'off' | 'required' | 'optional'; }`\n\n- `tags?: object`\n Key-value tags to associate with the cart\n\n### Returns\n\n- `{ data: { cartId: string; checkoutUrl: string; data: { items: object[]; settings?: object; tags?: object; }; metadata?: object; }; message: string; status: string; success: boolean; }`\n\n - `data: { cartId: string; checkoutUrl: string; data: { items: { link: string; affiliateProductLink?: string; coupons?: string[]; metadata?: object; quantity?: number; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }[]; settings?: { commissionFeeFixed?: { currency: string; value: number; }; commissionFeePercent?: number; events?: { data: object | object | object | object | object | object | object | object[]; type: string; conditional?: object | object; }[]; options?: { allowPartialPurchase?: boolean; collectBuyerAddress?: 'off' | 'required' | 'optional'; collectBuyerEmail?: 'off' | 'required' | 'optional'; collectBuyerPhone?: 'off' | 'required' | 'optional'; }; }; tags?: object; }; metadata?: object; }`\n - `message: string`\n - `status: string`\n - `success: boolean`\n\n### Example\n\n```typescript\nimport HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK();\n\nconst cart = await client.cart.create({ items: [{ link: 'https://www.nike.com/u/custom-nike-ja-3-by-you-10002205' }] });\n\nconsole.log(cart);\n```",
|
|
123
129
|
perLanguage: {
|
|
124
|
-
|
|
125
|
-
|
|
130
|
+
typescript: {
|
|
131
|
+
method: 'client.cart.create',
|
|
132
|
+
example: "import HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK({\n apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted\n});\n\nconst cart = await client.cart.create({\n items: [\n {\n link: 'https://www.nike.com/u/custom-nike-ja-3-by-you-10002205',\n affiliateProductLink:\n 'https://partner.example.com/click?url=https%3A%2F%2Fwww.nike.com%2Fu%2Fcustom-nike-ja-3-by-you-10002205',\n quantity: 2,\n selectedOptions: ['regular', 'black', '10-w'],\n metadata: { creatorSource: 'Frank Herbert' },\n },\n ],\n settings: {\n options: {\n allowPartialPurchase: true,\n collectBuyerEmail: 'required',\n collectBuyerAddress: 'optional',\n collectBuyerPhone: 'off',\n },\n commissionFeeFixed: { value: 1.99, currency: 'USD' },\n commissionFeePercent: 10,\n events: [],\n },\n});\n\nconsole.log(cart.data);",
|
|
126
133
|
},
|
|
127
134
|
python: {
|
|
128
135
|
method: 'cart.create',
|
|
129
136
|
example: 'import os\nfrom henry_sdk import HenrySDK\n\nclient = HenrySDK(\n api_key=os.environ.get("HENRY_SDK_API_KEY"), # This is the default and can be omitted\n)\ncart = client.cart.create(\n items=[{\n "link": "https://www.nike.com/u/custom-nike-ja-3-by-you-10002205",\n "affiliate_product_link": "https://partner.example.com/click?url=https%3A%2F%2Fwww.nike.com%2Fu%2Fcustom-nike-ja-3-by-you-10002205",\n "quantity": 2,\n "selected_options": ["regular", "black", "10-w"],\n "metadata": {\n "creatorSource": "Frank Herbert"\n },\n }],\n settings={\n "options": {\n "allow_partial_purchase": True,\n "collect_buyer_email": "required",\n "collect_buyer_address": "optional",\n "collect_buyer_phone": "off",\n },\n "commission_fee_fixed": {\n "value": 1.99,\n "currency": "USD",\n },\n "commission_fee_percent": 10,\n "events": [],\n },\n)\nprint(cart.data)',
|
|
130
137
|
},
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
example: "import HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK({\n apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted\n});\n\nconst cart = await client.cart.create({\n items: [\n {\n link: 'https://www.nike.com/u/custom-nike-ja-3-by-you-10002205',\n affiliateProductLink:\n 'https://partner.example.com/click?url=https%3A%2F%2Fwww.nike.com%2Fu%2Fcustom-nike-ja-3-by-you-10002205',\n quantity: 2,\n selectedOptions: ['regular', 'black', '10-w'],\n metadata: { creatorSource: 'Frank Herbert' },\n },\n ],\n settings: {\n options: {\n allowPartialPurchase: true,\n collectBuyerEmail: 'required',\n collectBuyerAddress: 'optional',\n collectBuyerPhone: 'off',\n },\n commissionFeeFixed: { value: 1.99, currency: 'USD' },\n commissionFeePercent: 10,\n events: [],\n },\n});\n\nconsole.log(cart.data);",
|
|
138
|
+
http: {
|
|
139
|
+
example: 'curl https://api.henrylabs.ai/v1/cart \\\n -H \'Content-Type: application/json\' \\\n -H "x-api-key: $HENRY_SDK_API_KEY" \\\n -d \'{\n "items": [\n {\n "link": "https://www.nike.com/u/custom-nike-ja-3-by-you-10002205",\n "affiliateProductLink": "https://partner.example.com/click?url=https%3A%2F%2Fwww.nike.com%2Fu%2Fcustom-nike-ja-3-by-you-10002205",\n "metadata": {\n "creatorSource": "bar"\n },\n "quantity": 2,\n "selectedOptions": [\n "regular",\n "black",\n "10-w"\n ]\n }\n ],\n "settings": {\n "commissionFeeFixed": {\n "value": 1.99,\n "currency": "USD"\n },\n "commissionFeePercent": 10,\n "events": [\n {\n "data": [\n {\n "points": 0,\n "type": "give_points_fixed"\n }\n ],\n "type": "order"\n }\n ],\n "options": {\n "allowPartialPurchase": true,\n "collectBuyerAddress": "optional",\n "collectBuyerEmail": "required",\n "collectBuyerPhone": "off"\n }\n },\n "tags": {\n "region": "us-ny"\n }\n }\'',
|
|
134
140
|
},
|
|
135
141
|
},
|
|
136
142
|
},
|
|
@@ -144,18 +150,18 @@ const EMBEDDED_METHODS = [
|
|
|
144
150
|
qualified: 'client.cart.list',
|
|
145
151
|
params: ['cartId?: string;', 'cursor?: string;', 'limit?: number;', 'tags?: object;'],
|
|
146
152
|
response: '{ data: { cartId: string; checkoutUrl: string; data: { items: object[]; settings?: object; tags?: object; }; metadata?: object; }[]; message: string; status: string; success: boolean; }',
|
|
147
|
-
markdown: "## list\n\n`client.cart.list(cartId?: string, cursor?: string, limit?: number, tags?: object): { data: object[]; message: string; status: string; success: boolean; }`\n\n**get** `/cart`\n\nList carts with optional filtering by cart ID or tags.\n\n### Parameters\n\n- `cartId?: string`\n Filter by a specific cart ID\n\n- `cursor?: string`\n Cursor returned from the previous response\n\n- `limit?: number`\n Limit the number of results\n\n- `tags?: object`\n Filter carts by key-value tags\n\n### Returns\n\n- `{ data: { cartId: string; checkoutUrl: string; data: { items: object[]; settings?: object; tags?: object; }; metadata?: object; }[]; message: string; status: string; success: boolean; }`\n\n - `data: { cartId: string; checkoutUrl: string; data: { items: { link: string; affiliateProductLink?: string; coupons?: string[]; metadata?: object; quantity?: number; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }[]; settings?: { commissionFeeFixed?: { currency:
|
|
153
|
+
markdown: "## list\n\n`client.cart.list(cartId?: string, cursor?: string, limit?: number, tags?: object): { data: object[]; message: string; status: string; success: boolean; }`\n\n**get** `/cart`\n\nList carts with optional filtering by cart ID or tags.\n\n### Parameters\n\n- `cartId?: string`\n Filter by a specific cart ID\n\n- `cursor?: string`\n Cursor returned from the previous response\n\n- `limit?: number`\n Limit the number of results\n\n- `tags?: object`\n Filter carts by key-value tags\n\n### Returns\n\n- `{ data: { cartId: string; checkoutUrl: string; data: { items: object[]; settings?: object; tags?: object; }; metadata?: object; }[]; message: string; status: string; success: boolean; }`\n\n - `data: { cartId: string; checkoutUrl: string; data: { items: { link: string; affiliateProductLink?: string; coupons?: string[]; metadata?: object; quantity?: number; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }[]; settings?: { commissionFeeFixed?: { currency: string; value: number; }; commissionFeePercent?: number; events?: { data: object | object | object | object | object | object | object | object[]; type: string; conditional?: object | object; }[]; options?: { allowPartialPurchase?: boolean; collectBuyerAddress?: 'off' | 'required' | 'optional'; collectBuyerEmail?: 'off' | 'required' | 'optional'; collectBuyerPhone?: 'off' | 'required' | 'optional'; }; }; tags?: object; }; metadata?: object; }[]`\n - `message: string`\n - `status: string`\n - `success: boolean`\n\n### Example\n\n```typescript\nimport HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK();\n\nconst carts = await client.cart.list();\n\nconsole.log(carts);\n```",
|
|
148
154
|
perLanguage: {
|
|
149
|
-
|
|
150
|
-
|
|
155
|
+
typescript: {
|
|
156
|
+
method: 'client.cart.list',
|
|
157
|
+
example: "import HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK({\n apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted\n});\n\nconst carts = await client.cart.list();\n\nconsole.log(carts.data);",
|
|
151
158
|
},
|
|
152
159
|
python: {
|
|
153
160
|
method: 'cart.list',
|
|
154
161
|
example: 'import os\nfrom henry_sdk import HenrySDK\n\nclient = HenrySDK(\n api_key=os.environ.get("HENRY_SDK_API_KEY"), # This is the default and can be omitted\n)\ncarts = client.cart.list()\nprint(carts.data)',
|
|
155
162
|
},
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
example: "import HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK({\n apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted\n});\n\nconst carts = await client.cart.list();\n\nconsole.log(carts.data);",
|
|
163
|
+
http: {
|
|
164
|
+
example: 'curl https://api.henrylabs.ai/v1/cart \\\n -H "x-api-key: $HENRY_SDK_API_KEY"',
|
|
159
165
|
},
|
|
160
166
|
},
|
|
161
167
|
},
|
|
@@ -172,18 +178,18 @@ const EMBEDDED_METHODS = [
|
|
|
172
178
|
'buyer?: { email?: string; name?: { firstName: string; lastName: string; middleName?: string; }; phone?: string; shippingAddress?: { city: string; countryCode: string; line1: string; postalCode: string; province: string; line2?: string; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; }; };',
|
|
173
179
|
],
|
|
174
180
|
response: '{ data: { cartId: string; checkoutUrl: string; data: { items: object[]; settings?: object; tags?: object; }; metadata?: object; }; message: string; status: string; success: boolean; }',
|
|
175
|
-
markdown: "## fetch\n\n`client.cart.fetch(cartId: string, buyer?: { email?: string; name?: { firstName: string; lastName: string; middleName?: string; }; phone?: string; shippingAddress?: { city: string; countryCode: string; line1: string; postalCode: string; province: string; line2?: string; phone?: object; }; }): { data: object; message: string; status: string; success: boolean; }`\n\n**post** `/cart/{cartId}`\n\nFetch a single cart by ID and optionally prefill buyer details in the returned checkout URL.\n\n### Parameters\n\n- `cartId: string`\n Unique identifier for the cart\n\n- `buyer?: { email?: string; name?: { firstName: string; lastName: string; middleName?: string; }; phone?: string; shippingAddress?: { city: string; countryCode: string; line1: string; postalCode: string; province: string; line2?: string; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; }; }`\n Optional buyer details to prefill at checkout. When provided, the returned checkoutUrl will include these as query params.\n - `email?: string`\n Buyer's email to prefill at checkout\n - `name?: { firstName: string; lastName: string; middleName?: string; }`\n Buyer's name to prefill at checkout\n - `phone?: string`\n Buyer's phone number (E.164 format) to prefill at checkout\n - `shippingAddress?: { city: string; countryCode: string; line1: string; postalCode: string; province: string; line2?: string; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; }`\n Buyer's shipping address to prefill at checkout\n\n### Returns\n\n- `{ data: { cartId: string; checkoutUrl: string; data: { items: object[]; settings?: object; tags?: object; }; metadata?: object; }; message: string; status: string; success: boolean; }`\n\n - `data: { cartId: string; checkoutUrl: string; data: { items: { link: string; affiliateProductLink?: string; coupons?: string[]; metadata?: object; quantity?: number; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }[]; settings?: { commissionFeeFixed?: { currency:
|
|
181
|
+
markdown: "## fetch\n\n`client.cart.fetch(cartId: string, buyer?: { email?: string; name?: { firstName: string; lastName: string; middleName?: string; }; phone?: string; shippingAddress?: { city: string; countryCode: string; line1: string; postalCode: string; province: string; line2?: string; phone?: object; }; }): { data: object; message: string; status: string; success: boolean; }`\n\n**post** `/cart/{cartId}`\n\nFetch a single cart by ID and optionally prefill buyer details in the returned checkout URL.\n\n### Parameters\n\n- `cartId: string`\n Unique identifier for the cart\n\n- `buyer?: { email?: string; name?: { firstName: string; lastName: string; middleName?: string; }; phone?: string; shippingAddress?: { city: string; countryCode: string; line1: string; postalCode: string; province: string; line2?: string; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; }; }`\n Optional buyer details to prefill at checkout. When provided, the returned checkoutUrl will include these as query params.\n - `email?: string`\n Buyer's email to prefill at checkout\n - `name?: { firstName: string; lastName: string; middleName?: string; }`\n Buyer's name to prefill at checkout\n - `phone?: string`\n Buyer's phone number (E.164 format) to prefill at checkout\n - `shippingAddress?: { city: string; countryCode: string; line1: string; postalCode: string; province: string; line2?: string; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; }`\n Buyer's shipping address to prefill at checkout\n\n### Returns\n\n- `{ data: { cartId: string; checkoutUrl: string; data: { items: object[]; settings?: object; tags?: object; }; metadata?: object; }; message: string; status: string; success: boolean; }`\n\n - `data: { cartId: string; checkoutUrl: string; data: { items: { link: string; affiliateProductLink?: string; coupons?: string[]; metadata?: object; quantity?: number; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }[]; settings?: { commissionFeeFixed?: { currency: string; value: number; }; commissionFeePercent?: number; events?: { data: object | object | object | object | object | object | object | object[]; type: string; conditional?: object | object; }[]; options?: { allowPartialPurchase?: boolean; collectBuyerAddress?: 'off' | 'required' | 'optional'; collectBuyerEmail?: 'off' | 'required' | 'optional'; collectBuyerPhone?: 'off' | 'required' | 'optional'; }; }; tags?: object; }; metadata?: object; }`\n - `message: string`\n - `status: string`\n - `success: boolean`\n\n### Example\n\n```typescript\nimport HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK();\n\nconst response = await client.cart.fetch('crt_sa2aEsCz9PRM');\n\nconsole.log(response);\n```",
|
|
176
182
|
perLanguage: {
|
|
177
|
-
|
|
178
|
-
|
|
183
|
+
typescript: {
|
|
184
|
+
method: 'client.cart.fetch',
|
|
185
|
+
example: "import HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK({\n apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.cart.fetch('crt_sa2aEsCz9PRM', {\n buyer: {\n name: { firstName: 'John', lastName: 'Doe' },\n email: 'john@example.com',\n phone: '+15551234567',\n shippingAddress: {\n line1: '123 Main St',\n city: 'New York',\n province: 'NY',\n postalCode: '10001',\n countryCode: 'US',\n },\n },\n});\n\nconsole.log(response.data);",
|
|
179
186
|
},
|
|
180
187
|
python: {
|
|
181
188
|
method: 'cart.fetch',
|
|
182
189
|
example: 'import os\nfrom henry_sdk import HenrySDK\n\nclient = HenrySDK(\n api_key=os.environ.get("HENRY_SDK_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.cart.fetch(\n cart_id="crt_sa2aEsCz9PRM",\n buyer={\n "name": {\n "first_name": "John",\n "last_name": "Doe",\n },\n "email": "john@example.com",\n "phone": "+15551234567",\n "shipping_address": {\n "line1": "123 Main St",\n "city": "New York",\n "province": "NY",\n "postal_code": "10001",\n "country_code": "US",\n },\n },\n)\nprint(response.data)',
|
|
183
190
|
},
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
example: "import HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK({\n apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.cart.fetch('crt_sa2aEsCz9PRM', {\n buyer: {\n name: { firstName: 'John', lastName: 'Doe' },\n email: 'john@example.com',\n phone: '+15551234567',\n shippingAddress: {\n line1: '123 Main St',\n city: 'New York',\n province: 'NY',\n postalCode: '10001',\n countryCode: 'US',\n },\n },\n});\n\nconsole.log(response.data);",
|
|
191
|
+
http: {
|
|
192
|
+
example: 'curl https://api.henrylabs.ai/v1/cart/$CART_ID \\\n -X POST \\\n -H "x-api-key: $HENRY_SDK_API_KEY"',
|
|
187
193
|
},
|
|
188
194
|
},
|
|
189
195
|
},
|
|
@@ -197,18 +203,18 @@ const EMBEDDED_METHODS = [
|
|
|
197
203
|
qualified: 'client.cart.delete',
|
|
198
204
|
params: ['cartId: string;'],
|
|
199
205
|
response: '{ data: { cartId: string; checkoutUrl: string; data: { items: object[]; settings?: object; tags?: object; }; metadata?: object; }; message: string; status: string; success: boolean; }',
|
|
200
|
-
markdown: "## delete\n\n`client.cart.delete(cartId: string): { data: object; message: string; status: string; success: boolean; }`\n\n**delete** `/cart/{cartId}`\n\nDelete a cart by its unique identifier\n\n### Parameters\n\n- `cartId: string`\n Unique identifier for the cart\n\n### Returns\n\n- `{ data: { cartId: string; checkoutUrl: string; data: { items: object[]; settings?: object; tags?: object; }; metadata?: object; }; message: string; status: string; success: boolean; }`\n\n - `data: { cartId: string; checkoutUrl: string; data: { items: { link: string; affiliateProductLink?: string; coupons?: string[]; metadata?: object; quantity?: number; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }[]; settings?: { commissionFeeFixed?: { currency:
|
|
206
|
+
markdown: "## delete\n\n`client.cart.delete(cartId: string): { data: object; message: string; status: string; success: boolean; }`\n\n**delete** `/cart/{cartId}`\n\nDelete a cart by its unique identifier\n\n### Parameters\n\n- `cartId: string`\n Unique identifier for the cart\n\n### Returns\n\n- `{ data: { cartId: string; checkoutUrl: string; data: { items: object[]; settings?: object; tags?: object; }; metadata?: object; }; message: string; status: string; success: boolean; }`\n\n - `data: { cartId: string; checkoutUrl: string; data: { items: { link: string; affiliateProductLink?: string; coupons?: string[]; metadata?: object; quantity?: number; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }[]; settings?: { commissionFeeFixed?: { currency: string; value: number; }; commissionFeePercent?: number; events?: { data: object | object | object | object | object | object | object | object[]; type: string; conditional?: object | object; }[]; options?: { allowPartialPurchase?: boolean; collectBuyerAddress?: 'off' | 'required' | 'optional'; collectBuyerEmail?: 'off' | 'required' | 'optional'; collectBuyerPhone?: 'off' | 'required' | 'optional'; }; }; tags?: object; }; metadata?: object; }`\n - `message: string`\n - `status: string`\n - `success: boolean`\n\n### Example\n\n```typescript\nimport HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK();\n\nconst cart = await client.cart.delete('crt_sa2aEsCz9PRM');\n\nconsole.log(cart);\n```",
|
|
201
207
|
perLanguage: {
|
|
202
|
-
|
|
203
|
-
|
|
208
|
+
typescript: {
|
|
209
|
+
method: 'client.cart.delete',
|
|
210
|
+
example: "import HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK({\n apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted\n});\n\nconst cart = await client.cart.delete('crt_sa2aEsCz9PRM');\n\nconsole.log(cart.data);",
|
|
204
211
|
},
|
|
205
212
|
python: {
|
|
206
213
|
method: 'cart.delete',
|
|
207
214
|
example: 'import os\nfrom henry_sdk import HenrySDK\n\nclient = HenrySDK(\n api_key=os.environ.get("HENRY_SDK_API_KEY"), # This is the default and can be omitted\n)\ncart = client.cart.delete(\n "crt_sa2aEsCz9PRM",\n)\nprint(cart.data)',
|
|
208
215
|
},
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
example: "import HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK({\n apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted\n});\n\nconst cart = await client.cart.delete('crt_sa2aEsCz9PRM');\n\nconsole.log(cart.data);",
|
|
216
|
+
http: {
|
|
217
|
+
example: 'curl https://api.henrylabs.ai/v1/cart/$CART_ID \\\n -X DELETE \\\n -H "x-api-key: $HENRY_SDK_API_KEY"',
|
|
212
218
|
},
|
|
213
219
|
},
|
|
214
220
|
},
|
|
@@ -225,18 +231,18 @@ const EMBEDDED_METHODS = [
|
|
|
225
231
|
'item: { link: string; affiliateProductLink?: string; coupons?: string[]; metadata?: object; quantity?: number; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; };',
|
|
226
232
|
],
|
|
227
233
|
response: '{ data: { cartId: string; checkoutUrl: string; data: { items: object[]; settings?: object; tags?: object; }; metadata?: object; }; message: string; status: string; success: boolean; }',
|
|
228
|
-
markdown: "## add\n\n`client.cart.item.add(cartId: string, item: { link: string; affiliateProductLink?: string; coupons?: string[]; metadata?: object; quantity?: number; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }): { data: object; message: string; status: string; success: boolean; }`\n\n**post** `/cart/{cartId}/item`\n\nAdd an item to an existing cart.\n\n### Parameters\n\n- `cartId: string`\n Unique identifier for the cart\n\n- `item: { link: string; affiliateProductLink?: string; coupons?: string[]; metadata?: object; quantity?: number; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }`\n Item to add to the cart (can be object or stringified JSON)\n - `link: string`\n Direct product URL\n - `affiliateProductLink?: string`\n Optional affiliate or redirect URL used for fulfillment. If omitted, link is used.\n - `coupons?: string[]`\n List of coupon codes applied to this cart item\n - `metadata?: object`\n Misc metadata associated with this cart item\n - `quantity?: number`\n Quantity of this item\n - `selectedOptions?: string[]`\n An ordered array of option values to select for the product. Will be selected in the order listed.\n - `selectedShipping?: { id?: string; value?: string; }`\n Shipping option selected for this cart item\n\n### Returns\n\n- `{ data: { cartId: string; checkoutUrl: string; data: { items: object[]; settings?: object; tags?: object; }; metadata?: object; }; message: string; status: string; success: boolean; }`\n\n - `data: { cartId: string; checkoutUrl: string; data: { items: { link: string; affiliateProductLink?: string; coupons?: string[]; metadata?: object; quantity?: number; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }[]; settings?: { commissionFeeFixed?: { currency:
|
|
234
|
+
markdown: "## add\n\n`client.cart.item.add(cartId: string, item: { link: string; affiliateProductLink?: string; coupons?: string[]; metadata?: object; quantity?: number; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }): { data: object; message: string; status: string; success: boolean; }`\n\n**post** `/cart/{cartId}/item`\n\nAdd an item to an existing cart.\n\n### Parameters\n\n- `cartId: string`\n Unique identifier for the cart\n\n- `item: { link: string; affiliateProductLink?: string; coupons?: string[]; metadata?: object; quantity?: number; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }`\n Item to add to the cart (can be object or stringified JSON)\n - `link: string`\n Direct product URL\n - `affiliateProductLink?: string`\n Optional affiliate or redirect URL used for fulfillment. If omitted, link is used.\n - `coupons?: string[]`\n List of coupon codes applied to this cart item\n - `metadata?: object`\n Misc metadata associated with this cart item\n - `quantity?: number`\n Quantity of this item\n - `selectedOptions?: string[]`\n An ordered array of option values to select for the product. Will be selected in the order listed.\n - `selectedShipping?: { id?: string; value?: string; }`\n Shipping option selected for this cart item\n\n### Returns\n\n- `{ data: { cartId: string; checkoutUrl: string; data: { items: object[]; settings?: object; tags?: object; }; metadata?: object; }; message: string; status: string; success: boolean; }`\n\n - `data: { cartId: string; checkoutUrl: string; data: { items: { link: string; affiliateProductLink?: string; coupons?: string[]; metadata?: object; quantity?: number; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }[]; settings?: { commissionFeeFixed?: { currency: string; value: number; }; commissionFeePercent?: number; events?: { data: object | object | object | object | object | object | object | object[]; type: string; conditional?: object | object; }[]; options?: { allowPartialPurchase?: boolean; collectBuyerAddress?: 'off' | 'required' | 'optional'; collectBuyerEmail?: 'off' | 'required' | 'optional'; collectBuyerPhone?: 'off' | 'required' | 'optional'; }; }; tags?: object; }; metadata?: object; }`\n - `message: string`\n - `status: string`\n - `success: boolean`\n\n### Example\n\n```typescript\nimport HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK();\n\nconst response = await client.cart.item.add('crt_sa2aEsCz9PRM', { item: { link: 'https://www.nike.com/u/custom-nike-ja-3-by-you-10002205' } });\n\nconsole.log(response);\n```",
|
|
229
235
|
perLanguage: {
|
|
230
|
-
|
|
231
|
-
|
|
236
|
+
typescript: {
|
|
237
|
+
method: 'client.cart.item.add',
|
|
238
|
+
example: "import HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK({\n apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.cart.item.add('crt_sa2aEsCz9PRM', {\n item: {\n link: 'https://www.nike.com/u/custom-nike-ja-3-by-you-10002205',\n affiliateProductLink:\n 'https://partner.example.com/click?url=https%3A%2F%2Fwww.nike.com%2Fu%2Fcustom-nike-ja-3-by-you-10002205',\n quantity: 1,\n selectedOptions: ['regular', 'black', '10-w'],\n metadata: { creatorSource: 'Frank Herbert' },\n },\n});\n\nconsole.log(response.data);",
|
|
232
239
|
},
|
|
233
240
|
python: {
|
|
234
241
|
method: 'cart.item.add',
|
|
235
242
|
example: 'import os\nfrom henry_sdk import HenrySDK\n\nclient = HenrySDK(\n api_key=os.environ.get("HENRY_SDK_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.cart.item.add(\n cart_id="crt_sa2aEsCz9PRM",\n item={\n "link": "https://www.nike.com/u/custom-nike-ja-3-by-you-10002205",\n "affiliate_product_link": "https://partner.example.com/click?url=https%3A%2F%2Fwww.nike.com%2Fu%2Fcustom-nike-ja-3-by-you-10002205",\n "quantity": 1,\n "selected_options": ["regular", "black", "10-w"],\n "metadata": {\n "creatorSource": "Frank Herbert"\n },\n },\n)\nprint(response.data)',
|
|
236
243
|
},
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
example: "import HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK({\n apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.cart.item.add('crt_sa2aEsCz9PRM', {\n item: {\n link: 'https://www.nike.com/u/custom-nike-ja-3-by-you-10002205',\n affiliateProductLink:\n 'https://partner.example.com/click?url=https%3A%2F%2Fwww.nike.com%2Fu%2Fcustom-nike-ja-3-by-you-10002205',\n quantity: 1,\n selectedOptions: ['regular', 'black', '10-w'],\n metadata: { creatorSource: 'Frank Herbert' },\n },\n});\n\nconsole.log(response.data);",
|
|
244
|
+
http: {
|
|
245
|
+
example: 'curl https://api.henrylabs.ai/v1/cart/$CART_ID/item \\\n -H \'Content-Type: application/json\' \\\n -H "x-api-key: $HENRY_SDK_API_KEY" \\\n -d \'{\n "item": {\n "link": "https://www.nike.com/u/custom-nike-ja-3-by-you-10002205",\n "affiliateProductLink": "https://partner.example.com/click?url=https%3A%2F%2Fwww.nike.com%2Fu%2Fcustom-nike-ja-3-by-you-10002205",\n "metadata": {\n "creatorSource": "bar"\n },\n "quantity": 1,\n "selectedOptions": [\n "regular",\n "black",\n "10-w"\n ]\n }\n }\'',
|
|
240
246
|
},
|
|
241
247
|
},
|
|
242
248
|
},
|
|
@@ -253,18 +259,18 @@ const EMBEDDED_METHODS = [
|
|
|
253
259
|
'item: { link: string; affiliateProductLink?: string; coupons?: string[]; metadata?: object; quantity?: number; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; };',
|
|
254
260
|
],
|
|
255
261
|
response: '{ data: { cartId: string; checkoutUrl: string; data: { items: object[]; settings?: object; tags?: object; }; metadata?: object; }; message: string; status: string; success: boolean; }',
|
|
256
|
-
markdown: "## update\n\n`client.cart.item.update(cartId: string, item: { link: string; affiliateProductLink?: string; coupons?: string[]; metadata?: object; quantity?: number; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }): { data: object; message: string; status: string; success: boolean; }`\n\n**put** `/cart/{cartId}/item`\n\nUpdate an item in an existing cart.\n\n### Parameters\n\n- `cartId: string`\n Unique identifier for the cart\n\n- `item: { link: string; affiliateProductLink?: string; coupons?: string[]; metadata?: object; quantity?: number; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }`\n Item to update (can be object or stringified JSON)\n - `link: string`\n Direct product URL\n - `affiliateProductLink?: string`\n Optional affiliate or redirect URL used for fulfillment. If omitted, link is used.\n - `coupons?: string[]`\n List of coupon codes applied to this cart item\n - `metadata?: object`\n Misc metadata associated with this cart item\n - `quantity?: number`\n Quantity of this item\n - `selectedOptions?: string[]`\n An ordered array of option values to select for the product. Will be selected in the order listed.\n - `selectedShipping?: { id?: string; value?: string; }`\n Shipping option selected for this cart item\n\n### Returns\n\n- `{ data: { cartId: string; checkoutUrl: string; data: { items: object[]; settings?: object; tags?: object; }; metadata?: object; }; message: string; status: string; success: boolean; }`\n\n - `data: { cartId: string; checkoutUrl: string; data: { items: { link: string; affiliateProductLink?: string; coupons?: string[]; metadata?: object; quantity?: number; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }[]; settings?: { commissionFeeFixed?: { currency:
|
|
262
|
+
markdown: "## update\n\n`client.cart.item.update(cartId: string, item: { link: string; affiliateProductLink?: string; coupons?: string[]; metadata?: object; quantity?: number; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }): { data: object; message: string; status: string; success: boolean; }`\n\n**put** `/cart/{cartId}/item`\n\nUpdate an item in an existing cart.\n\n### Parameters\n\n- `cartId: string`\n Unique identifier for the cart\n\n- `item: { link: string; affiliateProductLink?: string; coupons?: string[]; metadata?: object; quantity?: number; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }`\n Item to update (can be object or stringified JSON)\n - `link: string`\n Direct product URL\n - `affiliateProductLink?: string`\n Optional affiliate or redirect URL used for fulfillment. If omitted, link is used.\n - `coupons?: string[]`\n List of coupon codes applied to this cart item\n - `metadata?: object`\n Misc metadata associated with this cart item\n - `quantity?: number`\n Quantity of this item\n - `selectedOptions?: string[]`\n An ordered array of option values to select for the product. Will be selected in the order listed.\n - `selectedShipping?: { id?: string; value?: string; }`\n Shipping option selected for this cart item\n\n### Returns\n\n- `{ data: { cartId: string; checkoutUrl: string; data: { items: object[]; settings?: object; tags?: object; }; metadata?: object; }; message: string; status: string; success: boolean; }`\n\n - `data: { cartId: string; checkoutUrl: string; data: { items: { link: string; affiliateProductLink?: string; coupons?: string[]; metadata?: object; quantity?: number; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }[]; settings?: { commissionFeeFixed?: { currency: string; value: number; }; commissionFeePercent?: number; events?: { data: object | object | object | object | object | object | object | object[]; type: string; conditional?: object | object; }[]; options?: { allowPartialPurchase?: boolean; collectBuyerAddress?: 'off' | 'required' | 'optional'; collectBuyerEmail?: 'off' | 'required' | 'optional'; collectBuyerPhone?: 'off' | 'required' | 'optional'; }; }; tags?: object; }; metadata?: object; }`\n - `message: string`\n - `status: string`\n - `success: boolean`\n\n### Example\n\n```typescript\nimport HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK();\n\nconst item = await client.cart.item.update('crt_sa2aEsCz9PRM', { item: { link: 'https://www.nike.com/u/custom-nike-ja-3-by-you-10002205' } });\n\nconsole.log(item);\n```",
|
|
257
263
|
perLanguage: {
|
|
258
|
-
|
|
259
|
-
|
|
264
|
+
typescript: {
|
|
265
|
+
method: 'client.cart.item.update',
|
|
266
|
+
example: "import HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK({\n apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted\n});\n\nconst item = await client.cart.item.update('crt_sa2aEsCz9PRM', {\n item: {\n link: 'https://www.nike.com/u/custom-nike-ja-3-by-you-10002205',\n affiliateProductLink:\n 'https://partner.example.com/click?url=https%3A%2F%2Fwww.nike.com%2Fu%2Fcustom-nike-ja-3-by-you-10002205',\n quantity: 1,\n selectedOptions: ['regular', 'black', '10-w'],\n metadata: { creatorSource: 'Frank Herbert' },\n },\n});\n\nconsole.log(item.data);",
|
|
260
267
|
},
|
|
261
268
|
python: {
|
|
262
269
|
method: 'cart.item.update',
|
|
263
270
|
example: 'import os\nfrom henry_sdk import HenrySDK\n\nclient = HenrySDK(\n api_key=os.environ.get("HENRY_SDK_API_KEY"), # This is the default and can be omitted\n)\nitem = client.cart.item.update(\n cart_id="crt_sa2aEsCz9PRM",\n item={\n "link": "https://www.nike.com/u/custom-nike-ja-3-by-you-10002205",\n "affiliate_product_link": "https://partner.example.com/click?url=https%3A%2F%2Fwww.nike.com%2Fu%2Fcustom-nike-ja-3-by-you-10002205",\n "quantity": 1,\n "selected_options": ["regular", "black", "10-w"],\n "metadata": {\n "creatorSource": "Frank Herbert"\n },\n },\n)\nprint(item.data)',
|
|
264
271
|
},
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
example: "import HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK({\n apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted\n});\n\nconst item = await client.cart.item.update('crt_sa2aEsCz9PRM', {\n item: {\n link: 'https://www.nike.com/u/custom-nike-ja-3-by-you-10002205',\n affiliateProductLink:\n 'https://partner.example.com/click?url=https%3A%2F%2Fwww.nike.com%2Fu%2Fcustom-nike-ja-3-by-you-10002205',\n quantity: 1,\n selectedOptions: ['regular', 'black', '10-w'],\n metadata: { creatorSource: 'Frank Herbert' },\n },\n});\n\nconsole.log(item.data);",
|
|
272
|
+
http: {
|
|
273
|
+
example: 'curl https://api.henrylabs.ai/v1/cart/$CART_ID/item \\\n -X PUT \\\n -H \'Content-Type: application/json\' \\\n -H "x-api-key: $HENRY_SDK_API_KEY" \\\n -d \'{\n "item": {\n "link": "https://www.nike.com/u/custom-nike-ja-3-by-you-10002205",\n "affiliateProductLink": "https://partner.example.com/click?url=https%3A%2F%2Fwww.nike.com%2Fu%2Fcustom-nike-ja-3-by-you-10002205",\n "metadata": {\n "creatorSource": "bar"\n },\n "quantity": 1,\n "selectedOptions": [\n "regular",\n "black",\n "10-w"\n ]\n }\n }\'',
|
|
268
274
|
},
|
|
269
275
|
},
|
|
270
276
|
},
|
|
@@ -278,18 +284,18 @@ const EMBEDDED_METHODS = [
|
|
|
278
284
|
qualified: 'client.cart.item.remove',
|
|
279
285
|
params: ['cartId: string;', 'link: string;'],
|
|
280
286
|
response: '{ data: { cartId: string; checkoutUrl: string; data: { items: object[]; settings?: object; tags?: object; }; metadata?: object; }; message: string; status: string; success: boolean; }',
|
|
281
|
-
markdown: "## remove\n\n`client.cart.item.remove(cartId: string, link: string): { data: object; message: string; status: string; success: boolean; }`\n\n**delete** `/cart/{cartId}/item`\n\nRemove an item from a cart by its unique identifier\n\n### Parameters\n\n- `cartId: string`\n Unique identifier for the cart\n\n- `link: string`\n Direct product URL\n\n### Returns\n\n- `{ data: { cartId: string; checkoutUrl: string; data: { items: object[]; settings?: object; tags?: object; }; metadata?: object; }; message: string; status: string; success: boolean; }`\n\n - `data: { cartId: string; checkoutUrl: string; data: { items: { link: string; affiliateProductLink?: string; coupons?: string[]; metadata?: object; quantity?: number; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }[]; settings?: { commissionFeeFixed?: { currency:
|
|
287
|
+
markdown: "## remove\n\n`client.cart.item.remove(cartId: string, link: string): { data: object; message: string; status: string; success: boolean; }`\n\n**delete** `/cart/{cartId}/item`\n\nRemove an item from a cart by its unique identifier\n\n### Parameters\n\n- `cartId: string`\n Unique identifier for the cart\n\n- `link: string`\n Direct product URL\n\n### Returns\n\n- `{ data: { cartId: string; checkoutUrl: string; data: { items: object[]; settings?: object; tags?: object; }; metadata?: object; }; message: string; status: string; success: boolean; }`\n\n - `data: { cartId: string; checkoutUrl: string; data: { items: { link: string; affiliateProductLink?: string; coupons?: string[]; metadata?: object; quantity?: number; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }[]; settings?: { commissionFeeFixed?: { currency: string; value: number; }; commissionFeePercent?: number; events?: { data: object | object | object | object | object | object | object | object[]; type: string; conditional?: object | object; }[]; options?: { allowPartialPurchase?: boolean; collectBuyerAddress?: 'off' | 'required' | 'optional'; collectBuyerEmail?: 'off' | 'required' | 'optional'; collectBuyerPhone?: 'off' | 'required' | 'optional'; }; }; tags?: object; }; metadata?: object; }`\n - `message: string`\n - `status: string`\n - `success: boolean`\n\n### Example\n\n```typescript\nimport HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK();\n\nconst item = await client.cart.item.remove('crt_sa2aEsCz9PRM', { link: 'https://www.nike.com/u/custom-nike-ja-3-by-you-10002205' });\n\nconsole.log(item);\n```",
|
|
282
288
|
perLanguage: {
|
|
283
|
-
|
|
284
|
-
|
|
289
|
+
typescript: {
|
|
290
|
+
method: 'client.cart.item.remove',
|
|
291
|
+
example: "import HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK({\n apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted\n});\n\nconst item = await client.cart.item.remove('crt_sa2aEsCz9PRM', {\n link: 'https://www.nike.com/u/custom-nike-ja-3-by-you-10002205',\n});\n\nconsole.log(item.data);",
|
|
285
292
|
},
|
|
286
293
|
python: {
|
|
287
294
|
method: 'cart.item.remove',
|
|
288
295
|
example: 'import os\nfrom henry_sdk import HenrySDK\n\nclient = HenrySDK(\n api_key=os.environ.get("HENRY_SDK_API_KEY"), # This is the default and can be omitted\n)\nitem = client.cart.item.remove(\n cart_id="crt_sa2aEsCz9PRM",\n link="https://www.nike.com/u/custom-nike-ja-3-by-you-10002205",\n)\nprint(item.data)',
|
|
289
296
|
},
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
example: "import HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK({\n apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted\n});\n\nconst item = await client.cart.item.remove('crt_sa2aEsCz9PRM', {\n link: 'https://www.nike.com/u/custom-nike-ja-3-by-you-10002205',\n});\n\nconsole.log(item.data);",
|
|
297
|
+
http: {
|
|
298
|
+
example: 'curl https://api.henrylabs.ai/v1/cart/$CART_ID/item \\\n -X DELETE \\\n -H "x-api-key: $HENRY_SDK_API_KEY"',
|
|
293
299
|
},
|
|
294
300
|
},
|
|
295
301
|
},
|
|
@@ -307,20 +313,21 @@ const EMBEDDED_METHODS = [
|
|
|
307
313
|
'coupons?: string[];',
|
|
308
314
|
'metadata?: { botAuth?: { forterToken?: string; }; userData?: { ipAddress?: string; userAgent?: string; }; };',
|
|
309
315
|
"mode?: 'async' | 'sync';",
|
|
316
|
+
'overrideProducts?: object;',
|
|
310
317
|
],
|
|
311
318
|
response: "{ data: { jobs: { refId: string; status: 'pending' | 'processing' | 'complete' | 'failed'; error?: object; result?: object; }[]; metadata?: object; }; message: string; status: string; success: boolean; }",
|
|
312
|
-
markdown: "## details\n\n`client.cart.checkout.details(cartId: string, buyer: { shippingAddress: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: object; phone?: object; }; }, coupons?: string[], metadata?: { botAuth?: { forterToken?: string; }; userData?: { ipAddress?: string; userAgent?: string; }; }, mode?: 'async' | 'sync'): { data: object; message: string; status: string; success: boolean; }`\n\n**post** `/cart/{cartId}/details`\n\nRetrieve detailed information about a cart. Requests are async by default, or use mode=sync to wait up to 30 seconds for completion.\n\n### Parameters\n\n- `cartId: string`\n Unique identifier for the cart\n\n- `buyer: { shippingAddress: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: { firstName: string; lastName: string; middleName?: string; }; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; }; }`\n - `shippingAddress: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: { firstName: string; lastName: string; middleName?: string; }; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; }`\n Shipping address for the cart\n\n- `coupons?: string[]`\n List of coupon codes applied to the cart\n\n- `metadata?: { botAuth?: { forterToken?: string; }; userData?: { ipAddress?: string; userAgent?: string; }; }`\n Additional metadata for the request\n - `botAuth?: { forterToken?: string; }`\n Bot authentication credentials\n - `userData?: { ipAddress?: string; userAgent?: string; }`\n User identity and device information\n\n- `mode?: 'async' | 'sync'`\n Response mode. Use sync to wait up to 30 seconds for the backing worker flow to complete.\n\n### Returns\n\n- `{ data: { jobs: { refId: string; status: 'pending' | 'processing' | 'complete' | 'failed'; error?: object; result?: object; }[]; metadata?: object; }; message: string; status: string; success: boolean; }`\n\n - `data: { jobs: { refId: string; status: 'pending' | 'processing' | 'complete' | 'failed'; error?: object; result?: { items: { costs: object; shippingOptions: object[]; coupons?: object[]; }[]; }; }[]; metadata?: object; }`\n - `message: string`\n - `status: string`\n - `success: boolean`\n\n### Example\n\n```typescript\nimport HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK();\n\nconst response = await client.cart.checkout.details('crt_sa2aEsCz9PRM', { buyer: { shippingAddress: {\n city: 'Anytown',\n countryCode: 'US',\n line1: '123 Main St',\n postalCode: '12345',\n province: 'CA',\n} } });\n\nconsole.log(response);\n```",
|
|
319
|
+
markdown: "## details\n\n`client.cart.checkout.details(cartId: string, buyer: { shippingAddress: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: object; phone?: object; }; }, coupons?: string[], metadata?: { botAuth?: { forterToken?: string; }; userData?: { ipAddress?: string; userAgent?: string; }; }, mode?: 'async' | 'sync', overrideProducts?: object): { data: object; message: string; status: string; success: boolean; }`\n\n**post** `/cart/{cartId}/details`\n\nRetrieve detailed information about a cart. Requests are async by default, or use mode=sync to wait up to 30 seconds for completion.\n\n### Parameters\n\n- `cartId: string`\n Unique identifier for the cart\n\n- `buyer: { shippingAddress: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: { firstName: string; lastName: string; middleName?: string; }; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; }; }`\n - `shippingAddress: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: { firstName: string; lastName: string; middleName?: string; }; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; }`\n Shipping address for the cart\n\n- `coupons?: string[]`\n List of coupon codes applied to the cart\n\n- `metadata?: { botAuth?: { forterToken?: string; }; userData?: { ipAddress?: string; userAgent?: string; }; }`\n Additional metadata for the request\n - `botAuth?: { forterToken?: string; }`\n Bot authentication credentials\n - `userData?: { ipAddress?: string; userAgent?: string; }`\n User identity and device information\n\n- `mode?: 'async' | 'sync'`\n Response mode. Use sync to wait up to 30 seconds for the backing worker flow to complete.\n\n- `overrideProducts?: object`\n Per-product overrides keyed by product URL. Items with quantity null or 0 are excluded.\n\n### Returns\n\n- `{ data: { jobs: { refId: string; status: 'pending' | 'processing' | 'complete' | 'failed'; error?: object; result?: object; }[]; metadata?: object; }; message: string; status: string; success: boolean; }`\n\n - `data: { jobs: { refId: string; status: 'pending' | 'processing' | 'complete' | 'failed'; error?: object; result?: { items: { costs: object; shippingOptions: object[]; coupons?: object[]; }[]; data?: { costs: object; shippingOptions: object[]; coupons?: object[]; }; }; }[]; metadata?: object; }`\n - `message: string`\n - `status: string`\n - `success: boolean`\n\n### Example\n\n```typescript\nimport HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK();\n\nconst response = await client.cart.checkout.details('crt_sa2aEsCz9PRM', { buyer: { shippingAddress: {\n city: 'Anytown',\n countryCode: 'US',\n line1: '123 Main St',\n postalCode: '12345',\n province: 'CA',\n} } });\n\nconsole.log(response);\n```",
|
|
313
320
|
perLanguage: {
|
|
314
|
-
|
|
315
|
-
|
|
321
|
+
typescript: {
|
|
322
|
+
method: 'client.cart.checkout.details',
|
|
323
|
+
example: "import HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK({\n apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.cart.checkout.details('crt_sa2aEsCz9PRM', {\n buyer: {\n shippingAddress: {\n line1: '123 Main St',\n line2: 'Apt 4B',\n city: 'Anytown',\n province: 'CA',\n postalCode: '12345',\n countryCode: 'US',\n },\n },\n coupons: ['SUMMER21', 'FREESHIP'],\n mode: 'async',\n});\n\nconsole.log(response.data);",
|
|
316
324
|
},
|
|
317
325
|
python: {
|
|
318
326
|
method: 'cart.checkout.details',
|
|
319
327
|
example: 'import os\nfrom henry_sdk import HenrySDK\n\nclient = HenrySDK(\n api_key=os.environ.get("HENRY_SDK_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.cart.checkout.details(\n cart_id="crt_sa2aEsCz9PRM",\n buyer={\n "shipping_address": {\n "line1": "123 Main St",\n "line2": "Apt 4B",\n "city": "Anytown",\n "province": "CA",\n "postal_code": "12345",\n "country_code": "US",\n }\n },\n coupons=["SUMMER21", "FREESHIP"],\n mode="async",\n)\nprint(response.data)',
|
|
320
328
|
},
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
example: "import HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK({\n apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.cart.checkout.details('crt_sa2aEsCz9PRM', {\n buyer: {\n shippingAddress: {\n line1: '123 Main St',\n line2: 'Apt 4B',\n city: 'Anytown',\n province: 'CA',\n postalCode: '12345',\n countryCode: 'US',\n },\n },\n coupons: ['SUMMER21', 'FREESHIP'],\n mode: 'async',\n});\n\nconsole.log(response.data);",
|
|
329
|
+
http: {
|
|
330
|
+
example: 'curl https://api.henrylabs.ai/v1/cart/$CART_ID/details \\\n -H \'Content-Type: application/json\' \\\n -H "x-api-key: $HENRY_SDK_API_KEY" \\\n -d \'{\n "buyer": {\n "shippingAddress": {\n "city": "Anytown",\n "countryCode": "US",\n "line1": "123 Main St",\n "postalCode": "12345",\n "province": "CA",\n "line2": "Apt 4B"\n }\n },\n "coupons": [\n "SUMMER21",\n "FREESHIP"\n ],\n "mode": "async",\n "overrideProducts": {\n "https://www.nike.com/u/custom-nike-ja-3-by-you-10002205": {\n "quantity": 2\n }\n }\n }\'',
|
|
324
331
|
},
|
|
325
332
|
},
|
|
326
333
|
},
|
|
@@ -333,19 +340,19 @@ const EMBEDDED_METHODS = [
|
|
|
333
340
|
stainlessPath: '(resource) cart.checkout > (method) poll_details',
|
|
334
341
|
qualified: 'client.cart.checkout.pollDetails',
|
|
335
342
|
params: ['refId: string;'],
|
|
336
|
-
response: "{ refId: string; status: 'pending' | 'processing' | 'complete' | 'failed'; error?: object; result?: { items: { costs: object; shippingOptions: object[]; coupons?: object[]; }[]; }; }",
|
|
337
|
-
markdown: "## poll_details\n\n`client.cart.checkout.pollDetails(refId: string): { refId: string; status: 'pending' | 'processing' | 'complete' | 'failed'; error?: object; result?: object; }`\n\n**get** `/cart/checkout/status`\n\nCheck the status of a cart details retrieval job and get results when ready.\n\n### Parameters\n\n- `refId: string`\n Reference ID used for checking status\n\n### Returns\n\n- `{ refId: string; status: 'pending' | 'processing' | 'complete' | 'failed'; error?: object; result?: { items: { costs: object; shippingOptions: object[]; coupons?: object[]; }[]; }; }`\n\n - `refId: string`\n - `status: 'pending' | 'processing' | 'complete' | 'failed'`\n - `error?: object`\n - `result?: { items: { costs: { subtotal: { currency:
|
|
343
|
+
response: "{ refId: string; status: 'pending' | 'processing' | 'complete' | 'failed'; error?: object; result?: { items: { costs: object; shippingOptions: object[]; coupons?: object[]; }[]; data?: { costs: object; shippingOptions: object[]; coupons?: object[]; }; }; }",
|
|
344
|
+
markdown: "## poll_details\n\n`client.cart.checkout.pollDetails(refId: string): { refId: string; status: 'pending' | 'processing' | 'complete' | 'failed'; error?: object; result?: object; }`\n\n**get** `/cart/checkout/status`\n\nCheck the status of a cart details retrieval job and get results when ready.\n\n### Parameters\n\n- `refId: string`\n Reference ID used for checking status\n\n### Returns\n\n- `{ refId: string; status: 'pending' | 'processing' | 'complete' | 'failed'; error?: object; result?: { items: { costs: object; shippingOptions: object[]; coupons?: object[]; }[]; data?: { costs: object; shippingOptions: object[]; coupons?: object[]; }; }; }`\n\n - `refId: string`\n - `status: 'pending' | 'processing' | 'complete' | 'failed'`\n - `error?: object`\n - `result?: { items: { costs: { subtotal: { currency: string; value: number; }; total: { currency: string; value: number; }; discount?: { currency: string; value: number; }; shipping?: { currency: string; value: number; }; tax?: { currency: string; value: number; }; }; shippingOptions: { id: string; cost: { currency: string; value: number; }; name: string; maxDate?: string; minDate?: string; timeEstimate?: string; }[]; coupons?: { available: boolean; code: string; savedAmount?: { currency: string; value: number; }; }[]; }[]; data?: { costs: { subtotal: { currency: string; value: number; }; total: { currency: string; value: number; }; discount?: { currency: string; value: number; }; shipping?: { currency: string; value: number; }; tax?: { currency: string; value: number; }; }; shippingOptions: { id: string; cost: { currency: string; value: number; }; name: string; maxDate?: string; minDate?: string; timeEstimate?: string; }[]; coupons?: { available: boolean; code: string; savedAmount?: { currency: string; value: number; }; }[]; }; }`\n\n### Example\n\n```typescript\nimport HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK();\n\nconst response = await client.cart.checkout.pollDetails({ refId: 'ckd-ref_3fa85f64-5717-4562-b3fc' });\n\nconsole.log(response);\n```",
|
|
338
345
|
perLanguage: {
|
|
339
|
-
|
|
340
|
-
|
|
346
|
+
typescript: {
|
|
347
|
+
method: 'client.cart.checkout.pollDetails',
|
|
348
|
+
example: "import HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK({\n apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.cart.checkout.pollDetails({\n refId: 'ckd-ref_3fa85f64-5717-4562-b3fc',\n});\n\nconsole.log(response.refId);",
|
|
341
349
|
},
|
|
342
350
|
python: {
|
|
343
351
|
method: 'cart.checkout.poll_details',
|
|
344
352
|
example: 'import os\nfrom henry_sdk import HenrySDK\n\nclient = HenrySDK(\n api_key=os.environ.get("HENRY_SDK_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.cart.checkout.poll_details(\n ref_id="ckd-ref_3fa85f64-5717-4562-b3fc",\n)\nprint(response.ref_id)',
|
|
345
353
|
},
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
example: "import HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK({\n apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.cart.checkout.pollDetails({\n refId: 'ckd-ref_3fa85f64-5717-4562-b3fc',\n});\n\nconsole.log(response.refId);",
|
|
354
|
+
http: {
|
|
355
|
+
example: 'curl https://api.henrylabs.ai/v1/cart/checkout/status \\\n -H "x-api-key: $HENRY_SDK_API_KEY"',
|
|
349
356
|
},
|
|
350
357
|
},
|
|
351
358
|
},
|
|
@@ -365,19 +372,19 @@ const EMBEDDED_METHODS = [
|
|
|
365
372
|
'overrideProducts?: object;',
|
|
366
373
|
'settings?: { collectAddress?: boolean; collectEmail?: boolean; collectPhone?: boolean; };',
|
|
367
374
|
],
|
|
368
|
-
response: "{ details: { card: { details: object; nameOnCard: object; billingAddress?: object; }; hasAccount: boolean; name: { firstName: string; lastName: string; middleName?: string; }; email?: string; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; settings?: { collectAddress?: boolean; collectEmail?: boolean; collectPhone?: boolean; }; shippingAddress?: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: object; phone?: object; }; }; products: { host: string; link: string; merchant: string; quantity: number; status: 'pending' | 'processing' | 'complete' | 'failed'; affiliateProductLink?: string; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }[]; refId: string; status: 'pending' | 'processing' | 'complete' | 'cancelled'; error?: object; result?: { costs: { commissionFee: object; subtotal: object; total: object; }; items: { confirmationNumber: string; costs: object; productLink: string; appliedCoupon?: object; metadata?: object; shipping?: object; }[]; }; }",
|
|
369
|
-
markdown: "## purchase\n\n`client.cart.checkout.purchase(cartId: string, buyer: { card: { details: object; billingAddress?: object; nameOnCard?: object; }; email: string; name: { firstName: string; lastName: string; middleName?: string; }; shippingAddress: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: object; phone?: object; }; phone?: string; }, metadata?: { botAuth?: { forterToken?: string; }; userData?: { ipAddress?: string; userAgent?: string; }; }, mode?: 'async' | 'sync', overrideProducts?: object, settings?: { collectAddress?: boolean; collectEmail?: boolean; collectPhone?: boolean; }): { details: object; products: object[]; refId: string; status: 'pending' | 'processing' | 'complete' | 'cancelled'; error?: object; result?: object; }`\n\n**post** `/cart/{cartId}/purchase`\n\nInitiate the purchase process for a cart. Requests are async by default, or use mode=sync to wait up to 30 seconds for completion.\n\n### Parameters\n\n- `cartId: string`\n Unique identifier for the cart\n\n- `buyer: { card: { details: { cardToken: string; }; billingAddress?: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: { firstName: string; lastName: string; middleName?: string; }; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; }; nameOnCard?: { firstName: string; lastName: string; middleName?: string; }; }; email: string; name: { firstName: string; lastName: string; middleName?: string; }; shippingAddress: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: { firstName: string; lastName: string; middleName?: string; }; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; }; phone?: string; }`\n - `card: { details: { cardToken: string; }; billingAddress?: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: { firstName: string; lastName: string; middleName?: string; }; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; }; nameOnCard?: { firstName: string; lastName: string; middleName?: string; }; }`\n - `email: string`\n Buyer's email address\n - `name: { firstName: string; lastName: string; middleName?: string; }`\n Buyer's full name\n - `shippingAddress: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: { firstName: string; lastName: string; middleName?: string; }; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; }`\n Shipping address for the cart\n - `phone?: string`\n Buyer's phone number\n\n- `metadata?: { botAuth?: { forterToken?: string; }; userData?: { ipAddress?: string; userAgent?: string; }; }`\n Additional metadata for the request\n - `botAuth?: { forterToken?: string; }`\n Bot authentication credentials\n - `userData?: { ipAddress?: string; userAgent?: string; }`\n User identity and device information\n\n- `mode?: 'async' | 'sync'`\n Response mode. Use sync to wait up to 30 seconds for the backing worker flow to complete.\n\n- `overrideProducts?: object`\n
|
|
375
|
+
response: "{ details: { card: { details: object; nameOnCard: object; billingAddress?: object; }; hasAccount: boolean; name: { firstName: string; lastName: string; middleName?: string; }; email?: string; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; settings?: { collectAddress?: boolean; collectEmail?: boolean; collectPhone?: boolean; }; shippingAddress?: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: object; phone?: object; }; }; products: { host: string; link: string; merchant: string; quantity: number; status: 'pending' | 'processing' | 'complete' | 'failed'; affiliateProductLink?: string; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }[]; refId: string; status: 'pending' | 'processing' | 'complete' | 'cancelled'; error?: object; result?: { costs: { commissionFee: object; subtotal: object; total: object; }; items: { confirmationNumber: string; costs: object; productLink: string; quantity: number; appliedCoupon?: object; metadata?: object; shipping?: object; }[]; }; }",
|
|
376
|
+
markdown: "## purchase\n\n`client.cart.checkout.purchase(cartId: string, buyer: { card: { details: object; billingAddress?: object; nameOnCard?: object; }; email: string; name: { firstName: string; lastName: string; middleName?: string; }; shippingAddress: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: object; phone?: object; }; phone?: string; }, metadata?: { botAuth?: { forterToken?: string; }; userData?: { ipAddress?: string; userAgent?: string; }; }, mode?: 'async' | 'sync', overrideProducts?: object, settings?: { collectAddress?: boolean; collectEmail?: boolean; collectPhone?: boolean; }): { details: object; products: object[]; refId: string; status: 'pending' | 'processing' | 'complete' | 'cancelled'; error?: object; result?: object; }`\n\n**post** `/cart/{cartId}/purchase`\n\nInitiate the purchase process for a cart. Requests are async by default, or use mode=sync to wait up to 30 seconds for completion.\n\n### Parameters\n\n- `cartId: string`\n Unique identifier for the cart\n\n- `buyer: { card: { details: { cardToken: string; }; billingAddress?: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: { firstName: string; lastName: string; middleName?: string; }; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; }; nameOnCard?: { firstName: string; lastName: string; middleName?: string; }; }; email: string; name: { firstName: string; lastName: string; middleName?: string; }; shippingAddress: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: { firstName: string; lastName: string; middleName?: string; }; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; }; phone?: string; }`\n - `card: { details: { cardToken: string; }; billingAddress?: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: { firstName: string; lastName: string; middleName?: string; }; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; }; nameOnCard?: { firstName: string; lastName: string; middleName?: string; }; }`\n - `email: string`\n Buyer's email address\n - `name: { firstName: string; lastName: string; middleName?: string; }`\n Buyer's full name\n - `shippingAddress: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: { firstName: string; lastName: string; middleName?: string; }; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; }`\n Shipping address for the cart\n - `phone?: string`\n Buyer's phone number\n\n- `metadata?: { botAuth?: { forterToken?: string; }; userData?: { ipAddress?: string; userAgent?: string; }; }`\n Additional metadata for the request\n - `botAuth?: { forterToken?: string; }`\n Bot authentication credentials\n - `userData?: { ipAddress?: string; userAgent?: string; }`\n User identity and device information\n\n- `mode?: 'async' | 'sync'`\n Response mode. Use sync to wait up to 30 seconds for the backing worker flow to complete.\n\n- `overrideProducts?: object`\n Per-product overrides keyed by product URL. Items with quantity null or 0 are excluded.\n\n- `settings?: { collectAddress?: boolean; collectEmail?: boolean; collectPhone?: boolean; }`\n Settings for what information to collect\n - `collectAddress?: boolean`\n Whether to collect the buyer's shipping address\n - `collectEmail?: boolean`\n Whether to collect the buyer's email address\n - `collectPhone?: boolean`\n Whether to collect the buyer's phone number\n\n### Returns\n\n- `{ details: { card: { details: object; nameOnCard: object; billingAddress?: object; }; hasAccount: boolean; name: { firstName: string; lastName: string; middleName?: string; }; email?: string; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; settings?: { collectAddress?: boolean; collectEmail?: boolean; collectPhone?: boolean; }; shippingAddress?: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: object; phone?: object; }; }; products: { host: string; link: string; merchant: string; quantity: number; status: 'pending' | 'processing' | 'complete' | 'failed'; affiliateProductLink?: string; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }[]; refId: string; status: 'pending' | 'processing' | 'complete' | 'cancelled'; error?: object; result?: { costs: { commissionFee: object; subtotal: object; total: object; }; items: { confirmationNumber: string; costs: object; productLink: string; quantity: number; appliedCoupon?: object; metadata?: object; shipping?: object; }[]; }; }`\n\n - `details: { card: { details: object; nameOnCard: { firstName: string; lastName: string; middleName?: string; }; billingAddress?: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: { firstName: string; lastName: string; middleName?: string; }; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; }; }; hasAccount: boolean; name: { firstName: string; lastName: string; middleName?: string; }; email?: string; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; settings?: { collectAddress?: boolean; collectEmail?: boolean; collectPhone?: boolean; }; shippingAddress?: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: { firstName: string; lastName: string; middleName?: string; }; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; }; }`\n - `products: { host: string; link: string; merchant: string; quantity: number; status: 'pending' | 'processing' | 'complete' | 'failed'; affiliateProductLink?: string; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }[]`\n - `refId: string`\n - `status: 'pending' | 'processing' | 'complete' | 'cancelled'`\n - `error?: object`\n - `result?: { costs: { commissionFee: { currency: string; value: number; }; subtotal: { currency: string; value: number; }; total: { currency: string; value: number; }; }; items: { confirmationNumber: string; costs: { total: { currency: string; value: number; }; discount?: { currency: string; value: number; }; shipping?: { currency: string; value: number; }; subtotal?: { currency: string; value: number; }; tax?: { currency: string; value: number; }; }; productLink: string; quantity: number; appliedCoupon?: { code: string; savedAmount?: { currency: string; value: number; }; }; metadata?: object; shipping?: { id: string; cost: { currency: string; value: number; }; name: string; maxDate?: string; minDate?: string; timeEstimate?: string; }; }[]; }`\n\n### Example\n\n```typescript\nimport HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK();\n\nconst response = await client.cart.checkout.purchase('crt_sa2aEsCz9PRM', { buyer: {\n card: { details: { cardToken: 'card_live_SimDpKU9cmU7tvdUXHzOeLudtgfadQVnbof' } },\n email: 'johnadoe@example.com',\n name: { firstName: 'John', lastName: 'Doe' },\n shippingAddress: {\n city: 'Anytown',\n countryCode: 'US',\n line1: '123 Main St',\n postalCode: '12345',\n province: 'CA',\n},\n} });\n\nconsole.log(response);\n```",
|
|
370
377
|
perLanguage: {
|
|
371
|
-
|
|
372
|
-
|
|
378
|
+
typescript: {
|
|
379
|
+
method: 'client.cart.checkout.purchase',
|
|
380
|
+
example: "import HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK({\n apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.cart.checkout.purchase('crt_sa2aEsCz9PRM', {\n buyer: {\n name: {\n firstName: 'John',\n middleName: 'A.',\n lastName: 'Doe',\n },\n email: 'johnadoe@example.com',\n phone: '+1234567890',\n shippingAddress: {\n line1: '123 Main St',\n line2: 'Apt 4B',\n city: 'Anytown',\n province: 'CA',\n postalCode: '12345',\n countryCode: 'US',\n },\n card: {\n nameOnCard: {\n firstName: 'John',\n middleName: 'A.',\n lastName: 'Doe',\n },\n details: { cardToken: 'card_live_SimDpKU9cmU7tvdUXHzOeLudtgfadQVnbof' },\n billingAddress: {\n line1: '123 Main St',\n line2: 'Apt 4B',\n city: 'Anytown',\n province: 'CA',\n postalCode: '12345',\n countryCode: 'US',\n },\n },\n },\n mode: 'async',\n});\n\nconsole.log(response.details);",
|
|
373
381
|
},
|
|
374
382
|
python: {
|
|
375
383
|
method: 'cart.checkout.purchase',
|
|
376
384
|
example: 'import os\nfrom henry_sdk import HenrySDK\n\nclient = HenrySDK(\n api_key=os.environ.get("HENRY_SDK_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.cart.checkout.purchase(\n cart_id="crt_sa2aEsCz9PRM",\n buyer={\n "name": {\n "first_name": "John",\n "middle_name": "A.",\n "last_name": "Doe",\n },\n "email": "johnadoe@example.com",\n "phone": "+1234567890",\n "shipping_address": {\n "line1": "123 Main St",\n "line2": "Apt 4B",\n "city": "Anytown",\n "province": "CA",\n "postal_code": "12345",\n "country_code": "US",\n },\n "card": {\n "name_on_card": {\n "first_name": "John",\n "middle_name": "A.",\n "last_name": "Doe",\n },\n "details": {\n "card_token": "card_live_SimDpKU9cmU7tvdUXHzOeLudtgfadQVnbof"\n },\n "billing_address": {\n "line1": "123 Main St",\n "line2": "Apt 4B",\n "city": "Anytown",\n "province": "CA",\n "postal_code": "12345",\n "country_code": "US",\n },\n },\n },\n mode="async",\n)\nprint(response.details)',
|
|
377
385
|
},
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
example: "import HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK({\n apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.cart.checkout.purchase('crt_sa2aEsCz9PRM', {\n buyer: {\n name: {\n firstName: 'John',\n middleName: 'A.',\n lastName: 'Doe',\n },\n email: 'johnadoe@example.com',\n phone: '+1234567890',\n shippingAddress: {\n line1: '123 Main St',\n line2: 'Apt 4B',\n city: 'Anytown',\n province: 'CA',\n postalCode: '12345',\n countryCode: 'US',\n },\n card: {\n nameOnCard: {\n firstName: 'John',\n middleName: 'A.',\n lastName: 'Doe',\n },\n details: { cardToken: 'card_live_SimDpKU9cmU7tvdUXHzOeLudtgfadQVnbof' },\n billingAddress: {\n line1: '123 Main St',\n line2: 'Apt 4B',\n city: 'Anytown',\n province: 'CA',\n postalCode: '12345',\n countryCode: 'US',\n },\n },\n },\n mode: 'async',\n});\n\nconsole.log(response.details);",
|
|
386
|
+
http: {
|
|
387
|
+
example: 'curl https://api.henrylabs.ai/v1/cart/$CART_ID/purchase \\\n -H \'Content-Type: application/json\' \\\n -H "x-api-key: $HENRY_SDK_API_KEY" \\\n -d \'{\n "buyer": {\n "card": {\n "details": {\n "cardToken": "card_live_SimDpKU9cmU7tvdUXHzOeLudtgfadQVnbof"\n },\n "billingAddress": {\n "city": "Anytown",\n "countryCode": "US",\n "line1": "123 Main St",\n "postalCode": "12345",\n "province": "CA",\n "line2": "Apt 4B"\n },\n "nameOnCard": {\n "firstName": "John",\n "lastName": "Doe",\n "middleName": "A."\n }\n },\n "email": "johnadoe@example.com",\n "name": {\n "firstName": "John",\n "lastName": "Doe",\n "middleName": "A."\n },\n "shippingAddress": {\n "city": "Anytown",\n "countryCode": "US",\n "line1": "123 Main St",\n "postalCode": "12345",\n "province": "CA",\n "line2": "Apt 4B"\n },\n "phone": "+1234567890"\n },\n "mode": "async",\n "overrideProducts": {\n "https://www.nike.com/u/custom-nike-ja-3-by-you-10002205": {\n "quantity": 2\n }\n }\n }\'',
|
|
381
388
|
},
|
|
382
389
|
},
|
|
383
390
|
},
|
|
@@ -390,19 +397,19 @@ const EMBEDDED_METHODS = [
|
|
|
390
397
|
stainlessPath: '(resource) cart.checkout > (method) poll_purchase',
|
|
391
398
|
qualified: 'client.cart.checkout.pollPurchase',
|
|
392
399
|
params: ['refId: string;'],
|
|
393
|
-
response: "{ details: { card: { details: object; nameOnCard: object; billingAddress?: object; }; hasAccount: boolean; name: { firstName: string; lastName: string; middleName?: string; }; email?: string; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; settings?: { collectAddress?: boolean; collectEmail?: boolean; collectPhone?: boolean; }; shippingAddress?: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: object; phone?: object; }; }; products: { host: string; link: string; merchant: string; quantity: number; status: 'pending' | 'processing' | 'complete' | 'failed'; affiliateProductLink?: string; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }[]; refId: string; status: 'pending' | 'processing' | 'complete' | 'cancelled'; error?: object; result?: { costs: { commissionFee: object; subtotal: object; total: object; }; items: { confirmationNumber: string; costs: object; productLink: string; appliedCoupon?: object; metadata?: object; shipping?: object; }[]; }; }",
|
|
394
|
-
markdown: "## poll_purchase\n\n`client.cart.checkout.pollPurchase(refId: string): { details: object; products: object[]; refId: string; status: 'pending' | 'processing' | 'complete' | 'cancelled'; error?: object; result?: object; }`\n\n**get** `/cart/purchase/status`\n\nCheck the status of a cart purchase job and get results when ready.\n\n### Parameters\n\n- `refId: string`\n Reference ID used for checking status\n\n### Returns\n\n- `{ details: { card: { details: object; nameOnCard: object; billingAddress?: object; }; hasAccount: boolean; name: { firstName: string; lastName: string; middleName?: string; }; email?: string; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; settings?: { collectAddress?: boolean; collectEmail?: boolean; collectPhone?: boolean; }; shippingAddress?: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: object; phone?: object; }; }; products: { host: string; link: string; merchant: string; quantity: number; status: 'pending' | 'processing' | 'complete' | 'failed'; affiliateProductLink?: string; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }[]; refId: string; status: 'pending' | 'processing' | 'complete' | 'cancelled'; error?: object; result?: { costs: { commissionFee: object; subtotal: object; total: object; }; items: { confirmationNumber: string; costs: object; productLink: string; appliedCoupon?: object; metadata?: object; shipping?: object; }[]; }; }`\n\n - `details: { card: { details: object; nameOnCard: { firstName: string; lastName: string; middleName?: string; }; billingAddress?: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: { firstName: string; lastName: string; middleName?: string; }; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; }; }; hasAccount: boolean; name: { firstName: string; lastName: string; middleName?: string; }; email?: string; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; settings?: { collectAddress?: boolean; collectEmail?: boolean; collectPhone?: boolean; }; shippingAddress?: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: { firstName: string; lastName: string; middleName?: string; }; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; }; }`\n - `products: { host: string; link: string; merchant: string; quantity: number; status: 'pending' | 'processing' | 'complete' | 'failed'; affiliateProductLink?: string; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }[]`\n - `refId: string`\n - `status: 'pending' | 'processing' | 'complete' | 'cancelled'`\n - `error?: object`\n - `result?: { costs: { commissionFee: { currency:
|
|
400
|
+
response: "{ details: { card: { details: object; nameOnCard: object; billingAddress?: object; }; hasAccount: boolean; name: { firstName: string; lastName: string; middleName?: string; }; email?: string; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; settings?: { collectAddress?: boolean; collectEmail?: boolean; collectPhone?: boolean; }; shippingAddress?: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: object; phone?: object; }; }; products: { host: string; link: string; merchant: string; quantity: number; status: 'pending' | 'processing' | 'complete' | 'failed'; affiliateProductLink?: string; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }[]; refId: string; status: 'pending' | 'processing' | 'complete' | 'cancelled'; error?: object; result?: { costs: { commissionFee: object; subtotal: object; total: object; }; items: { confirmationNumber: string; costs: object; productLink: string; quantity: number; appliedCoupon?: object; metadata?: object; shipping?: object; }[]; }; }",
|
|
401
|
+
markdown: "## poll_purchase\n\n`client.cart.checkout.pollPurchase(refId: string): { details: object; products: object[]; refId: string; status: 'pending' | 'processing' | 'complete' | 'cancelled'; error?: object; result?: object; }`\n\n**get** `/cart/purchase/status`\n\nCheck the status of a cart purchase job and get results when ready.\n\n### Parameters\n\n- `refId: string`\n Reference ID used for checking status\n\n### Returns\n\n- `{ details: { card: { details: object; nameOnCard: object; billingAddress?: object; }; hasAccount: boolean; name: { firstName: string; lastName: string; middleName?: string; }; email?: string; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; settings?: { collectAddress?: boolean; collectEmail?: boolean; collectPhone?: boolean; }; shippingAddress?: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: object; phone?: object; }; }; products: { host: string; link: string; merchant: string; quantity: number; status: 'pending' | 'processing' | 'complete' | 'failed'; affiliateProductLink?: string; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }[]; refId: string; status: 'pending' | 'processing' | 'complete' | 'cancelled'; error?: object; result?: { costs: { commissionFee: object; subtotal: object; total: object; }; items: { confirmationNumber: string; costs: object; productLink: string; quantity: number; appliedCoupon?: object; metadata?: object; shipping?: object; }[]; }; }`\n\n - `details: { card: { details: object; nameOnCard: { firstName: string; lastName: string; middleName?: string; }; billingAddress?: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: { firstName: string; lastName: string; middleName?: string; }; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; }; }; hasAccount: boolean; name: { firstName: string; lastName: string; middleName?: string; }; email?: string; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; settings?: { collectAddress?: boolean; collectEmail?: boolean; collectPhone?: boolean; }; shippingAddress?: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: { firstName: string; lastName: string; middleName?: string; }; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; }; }`\n - `products: { host: string; link: string; merchant: string; quantity: number; status: 'pending' | 'processing' | 'complete' | 'failed'; affiliateProductLink?: string; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }[]`\n - `refId: string`\n - `status: 'pending' | 'processing' | 'complete' | 'cancelled'`\n - `error?: object`\n - `result?: { costs: { commissionFee: { currency: string; value: number; }; subtotal: { currency: string; value: number; }; total: { currency: string; value: number; }; }; items: { confirmationNumber: string; costs: { total: { currency: string; value: number; }; discount?: { currency: string; value: number; }; shipping?: { currency: string; value: number; }; subtotal?: { currency: string; value: number; }; tax?: { currency: string; value: number; }; }; productLink: string; quantity: number; appliedCoupon?: { code: string; savedAmount?: { currency: string; value: number; }; }; metadata?: object; shipping?: { id: string; cost: { currency: string; value: number; }; name: string; maxDate?: string; minDate?: string; timeEstimate?: string; }; }[]; }`\n\n### Example\n\n```typescript\nimport HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK();\n\nconst response = await client.cart.checkout.pollPurchase({ refId: 'ckp-ref_3fa85f64-5717-4562-b3fc' });\n\nconsole.log(response);\n```",
|
|
395
402
|
perLanguage: {
|
|
396
|
-
|
|
397
|
-
|
|
403
|
+
typescript: {
|
|
404
|
+
method: 'client.cart.checkout.pollPurchase',
|
|
405
|
+
example: "import HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK({\n apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.cart.checkout.pollPurchase({\n refId: 'ckp-ref_3fa85f64-5717-4562-b3fc',\n});\n\nconsole.log(response.details);",
|
|
398
406
|
},
|
|
399
407
|
python: {
|
|
400
408
|
method: 'cart.checkout.poll_purchase',
|
|
401
409
|
example: 'import os\nfrom henry_sdk import HenrySDK\n\nclient = HenrySDK(\n api_key=os.environ.get("HENRY_SDK_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.cart.checkout.poll_purchase(\n ref_id="ckp-ref_3fa85f64-5717-4562-b3fc",\n)\nprint(response.details)',
|
|
402
410
|
},
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
example: "import HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK({\n apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.cart.checkout.pollPurchase({\n refId: 'ckp-ref_3fa85f64-5717-4562-b3fc',\n});\n\nconsole.log(response.details);",
|
|
411
|
+
http: {
|
|
412
|
+
example: 'curl https://api.henrylabs.ai/v1/cart/purchase/status \\\n -H "x-api-key: $HENRY_SDK_API_KEY"',
|
|
406
413
|
},
|
|
407
414
|
},
|
|
408
415
|
},
|
|
@@ -421,18 +428,18 @@ const EMBEDDED_METHODS = [
|
|
|
421
428
|
"status?: 'pending' | 'processing' | 'complete' | 'cancelled';",
|
|
422
429
|
],
|
|
423
430
|
response: "{ data: { details: { card: object; hasAccount: boolean; name: object; email?: string; phone?: object; settings?: object; shippingAddress?: object; }; products: { host: string; link: string; merchant: string; quantity: number; status: 'pending' | 'processing' | 'complete' | 'failed'; affiliateProductLink?: string; selectedOptions?: string[]; selectedShipping?: object; }[]; refId: string; status: 'pending' | 'processing' | 'complete' | 'cancelled'; error?: object; result?: { costs: object; items: object[]; }; }[]; message: string; status: string; success: boolean; }",
|
|
424
|
-
markdown: "## list\n\n`client.orders.list(cartId?: string, cursor?: string, limit?: number, status?: 'pending' | 'processing' | 'complete' | 'cancelled'): { data: object[]; message: string; status: string; success: boolean; }`\n\n**get** `/orders`\n\nFetch a list of orders with optional filtering and pagination.\n\n### Parameters\n\n- `cartId?: string`\n Filter orders by cart ID\n\n- `cursor?: string`\n Cursor returned from the previous response\n\n- `limit?: number`\n Limit the number of results\n\n- `status?: 'pending' | 'processing' | 'complete' | 'cancelled'`\n Filter orders by status\n\n### Returns\n\n- `{ data: { details: { card: object; hasAccount: boolean; name: object; email?: string; phone?: object; settings?: object; shippingAddress?: object; }; products: { host: string; link: string; merchant: string; quantity: number; status: 'pending' | 'processing' | 'complete' | 'failed'; affiliateProductLink?: string; selectedOptions?: string[]; selectedShipping?: object; }[]; refId: string; status: 'pending' | 'processing' | 'complete' | 'cancelled'; error?: object; result?: { costs: object; items: object[]; }; }[]; message: string; status: string; success: boolean; }`\n\n - `data: { details: { card: { details: object; nameOnCard: { firstName: string; lastName: string; middleName?: string; }; billingAddress?: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: object; phone?: object; }; }; hasAccount: boolean; name: { firstName: string; lastName: string; middleName?: string; }; email?: string; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; settings?: { collectAddress?: boolean; collectEmail?: boolean; collectPhone?: boolean; }; shippingAddress?: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: { firstName: string; lastName: string; middleName?: string; }; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; }; }; products: { host: string; link: string; merchant: string; quantity: number; status: 'pending' | 'processing' | 'complete' | 'failed'; affiliateProductLink?: string; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }[]; refId: string; status: 'pending' | 'processing' | 'complete' | 'cancelled'; error?: object; result?: { costs: { commissionFee: { currency:
|
|
431
|
+
markdown: "## list\n\n`client.orders.list(cartId?: string, cursor?: string, limit?: number, status?: 'pending' | 'processing' | 'complete' | 'cancelled'): { data: object[]; message: string; status: string; success: boolean; }`\n\n**get** `/orders`\n\nFetch a list of orders with optional filtering and pagination.\n\n### Parameters\n\n- `cartId?: string`\n Filter orders by cart ID\n\n- `cursor?: string`\n Cursor returned from the previous response\n\n- `limit?: number`\n Limit the number of results\n\n- `status?: 'pending' | 'processing' | 'complete' | 'cancelled'`\n Filter orders by status\n\n### Returns\n\n- `{ data: { details: { card: object; hasAccount: boolean; name: object; email?: string; phone?: object; settings?: object; shippingAddress?: object; }; products: { host: string; link: string; merchant: string; quantity: number; status: 'pending' | 'processing' | 'complete' | 'failed'; affiliateProductLink?: string; selectedOptions?: string[]; selectedShipping?: object; }[]; refId: string; status: 'pending' | 'processing' | 'complete' | 'cancelled'; error?: object; result?: { costs: object; items: object[]; }; }[]; message: string; status: string; success: boolean; }`\n\n - `data: { details: { card: { details: object; nameOnCard: { firstName: string; lastName: string; middleName?: string; }; billingAddress?: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: object; phone?: object; }; }; hasAccount: boolean; name: { firstName: string; lastName: string; middleName?: string; }; email?: string; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; settings?: { collectAddress?: boolean; collectEmail?: boolean; collectPhone?: boolean; }; shippingAddress?: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: { firstName: string; lastName: string; middleName?: string; }; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; }; }; products: { host: string; link: string; merchant: string; quantity: number; status: 'pending' | 'processing' | 'complete' | 'failed'; affiliateProductLink?: string; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }[]; refId: string; status: 'pending' | 'processing' | 'complete' | 'cancelled'; error?: object; result?: { costs: { commissionFee: { currency: string; value: number; }; subtotal: { currency: string; value: number; }; total: { currency: string; value: number; }; }; items: { confirmationNumber: string; costs: { total: object; discount?: object; shipping?: object; subtotal?: object; tax?: object; }; productLink: string; quantity: number; appliedCoupon?: { code: string; savedAmount?: object; }; metadata?: object; shipping?: { id: string; cost: object; name: string; maxDate?: string; minDate?: string; timeEstimate?: string; }; }[]; }; }[]`\n - `message: string`\n - `status: string`\n - `success: boolean`\n\n### Example\n\n```typescript\nimport HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK();\n\nconst orders = await client.orders.list();\n\nconsole.log(orders);\n```",
|
|
425
432
|
perLanguage: {
|
|
426
|
-
|
|
427
|
-
|
|
433
|
+
typescript: {
|
|
434
|
+
method: 'client.orders.list',
|
|
435
|
+
example: "import HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK({\n apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted\n});\n\nconst orders = await client.orders.list();\n\nconsole.log(orders.data);",
|
|
428
436
|
},
|
|
429
437
|
python: {
|
|
430
438
|
method: 'orders.list',
|
|
431
439
|
example: 'import os\nfrom henry_sdk import HenrySDK\n\nclient = HenrySDK(\n api_key=os.environ.get("HENRY_SDK_API_KEY"), # This is the default and can be omitted\n)\norders = client.orders.list()\nprint(orders.data)',
|
|
432
440
|
},
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
example: "import HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK({\n apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted\n});\n\nconst orders = await client.orders.list();\n\nconsole.log(orders.data);",
|
|
441
|
+
http: {
|
|
442
|
+
example: 'curl https://api.henrylabs.ai/v1/orders \\\n -H "x-api-key: $HENRY_SDK_API_KEY"',
|
|
436
443
|
},
|
|
437
444
|
},
|
|
438
445
|
},
|
|
@@ -441,29 +448,30 @@ const EMBEDDED_METHODS = [
|
|
|
441
448
|
endpoint: '/merchants',
|
|
442
449
|
httpMethod: 'get',
|
|
443
450
|
summary: 'Merchants List',
|
|
444
|
-
description: 'Fetch a list of merchants with
|
|
451
|
+
description: 'Fetch a paginated list of merchants with their lifetime success rates (checkout, checkoutDetails, productDetails, productSearch), coverage status, and checkout latency. Rates are computed over real traffic only; a rate is null (N/A) when there are no attempts yet.',
|
|
445
452
|
stainlessPath: '(resource) merchants > (method) list',
|
|
446
453
|
qualified: 'client.merchants.list',
|
|
447
454
|
params: [
|
|
448
455
|
'categories?: string[];',
|
|
456
|
+
"coverageStatus?: 'supported' | 'testing' | 'unsupported';",
|
|
449
457
|
'cursor?: string;',
|
|
450
458
|
'host?: string;',
|
|
451
459
|
'limit?: number;',
|
|
452
460
|
'name?: string;',
|
|
453
461
|
],
|
|
454
|
-
response:
|
|
455
|
-
markdown: "## list\n\n`client.merchants.list(categories?: string[], cursor?: string, host?: string, limit?: number, name?: string): { data: object[]; message: string; status: string; success: boolean; }`\n\n**get** `/merchants`\n\nFetch a list of merchants with
|
|
462
|
+
response: "{ data: { categories: string[]; coverageStatus: 'supported' | 'testing' | 'unsupported'; description: string; host: string; latencyMs: { checkout: object; checkoutDetails: object; productDetails: object; productSearch: object; }; logo: { urls: object[]; }; name: string; rates: { checkout: object; checkoutDetails: object; productDetails: object; productSearch: object; }; website: { urls: object[]; }; }[]; message: string; pagination: { nextCursor: string; }; status: string; success: boolean; }",
|
|
463
|
+
markdown: "## list\n\n`client.merchants.list(categories?: string[], coverageStatus?: 'supported' | 'testing' | 'unsupported', cursor?: string, host?: string, limit?: number, name?: string): { data: object[]; message: string; pagination: object; status: string; success: boolean; }`\n\n**get** `/merchants`\n\nFetch a paginated list of merchants with their lifetime success rates (checkout, checkoutDetails, productDetails, productSearch), coverage status, and checkout latency. Rates are computed over real traffic only; a rate is null (N/A) when there are no attempts yet.\n\n### Parameters\n\n- `categories?: string[]`\n\n- `coverageStatus?: 'supported' | 'testing' | 'unsupported'`\n Filter merchants by coverage status (supported, testing, or unsupported).\n\n- `cursor?: string`\n Opaque cursor returned from the previous response; pass back to fetch the next page.\n\n- `host?: string`\n Filter merchants by host\n\n- `limit?: number`\n Limit the number of results\n\n- `name?: string`\n Filter merchants by name (partial match)\n\n### Returns\n\n- `{ data: { categories: string[]; coverageStatus: 'supported' | 'testing' | 'unsupported'; description: string; host: string; latencyMs: { checkout: object; checkoutDetails: object; productDetails: object; productSearch: object; }; logo: { urls: object[]; }; name: string; rates: { checkout: object; checkoutDetails: object; productDetails: object; productSearch: object; }; website: { urls: object[]; }; }[]; message: string; pagination: { nextCursor: string; }; status: string; success: boolean; }`\n\n - `data: { categories: string[]; coverageStatus: 'supported' | 'testing' | 'unsupported'; description: string; host: string; latencyMs: { checkout: { p50: number; p95: number; }; checkoutDetails: { p50: number; p95: number; }; productDetails: { p50: number; p95: number; }; productSearch: { p50: number; p95: number; }; }; logo: { urls: { value: string; }[]; }; name: string; rates: { checkout: { rate: number; }; checkoutDetails: { rate: number; }; productDetails: { rate: number; }; productSearch: { rate: number; }; }; website: { urls: { value: string; type?: 'landing' | 'checkout'; }[]; }; }[]`\n - `message: string`\n - `pagination: { nextCursor: string; }`\n - `status: string`\n - `success: boolean`\n\n### Example\n\n```typescript\nimport HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK();\n\nconst merchants = await client.merchants.list();\n\nconsole.log(merchants);\n```",
|
|
456
464
|
perLanguage: {
|
|
457
|
-
|
|
458
|
-
|
|
465
|
+
typescript: {
|
|
466
|
+
method: 'client.merchants.list',
|
|
467
|
+
example: "import HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK({\n apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted\n});\n\nconst merchants = await client.merchants.list();\n\nconsole.log(merchants.data);",
|
|
459
468
|
},
|
|
460
469
|
python: {
|
|
461
470
|
method: 'merchants.list',
|
|
462
471
|
example: 'import os\nfrom henry_sdk import HenrySDK\n\nclient = HenrySDK(\n api_key=os.environ.get("HENRY_SDK_API_KEY"), # This is the default and can be omitted\n)\nmerchants = client.merchants.list()\nprint(merchants.data)',
|
|
463
472
|
},
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
example: "import HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK({\n apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted\n});\n\nconst merchants = await client.merchants.list();\n\nconsole.log(merchants.data);",
|
|
473
|
+
http: {
|
|
474
|
+
example: 'curl https://api.henrylabs.ai/v1/merchants \\\n -H "x-api-key: $HENRY_SDK_API_KEY"',
|
|
467
475
|
},
|
|
468
476
|
},
|
|
469
477
|
},
|