@omni-commerce/sdk 0.1.1 → 0.2.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/dist/index.cjs +214 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3005 -287
- package/dist/index.d.ts +3005 -287
- package/dist/index.js +214 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -231,6 +231,68 @@ interface paths {
|
|
|
231
231
|
patch?: never;
|
|
232
232
|
trace?: never;
|
|
233
233
|
};
|
|
234
|
+
"/api/v1/agents/general/invoke": {
|
|
235
|
+
parameters: {
|
|
236
|
+
query?: never;
|
|
237
|
+
header?: never;
|
|
238
|
+
path?: never;
|
|
239
|
+
cookie?: never;
|
|
240
|
+
};
|
|
241
|
+
get?: never;
|
|
242
|
+
put?: never;
|
|
243
|
+
/**
|
|
244
|
+
* Invoke the Omni agent
|
|
245
|
+
* @description Run the general Omni agent and wait until it completes, pauses for approval, or fails. Requires `agents:invoke`.
|
|
246
|
+
*
|
|
247
|
+
* A waiting call can take several minutes; raise the client timeout. Send `decisions` with the same `thread_id` to approve or reject a paused run. Omit `config.enabled_tools` to use the organization's agent tools. Attach images on the latest user message as `{ type: "image", url }` HTTP(S) URLs.
|
|
248
|
+
*/
|
|
249
|
+
post: operations["post_v1_agents_general_invoke"];
|
|
250
|
+
delete?: never;
|
|
251
|
+
options?: never;
|
|
252
|
+
head?: never;
|
|
253
|
+
patch?: never;
|
|
254
|
+
trace?: never;
|
|
255
|
+
};
|
|
256
|
+
"/api/v1/agents/general/runs": {
|
|
257
|
+
parameters: {
|
|
258
|
+
query?: never;
|
|
259
|
+
header?: never;
|
|
260
|
+
path?: never;
|
|
261
|
+
cookie?: never;
|
|
262
|
+
};
|
|
263
|
+
get?: never;
|
|
264
|
+
put?: never;
|
|
265
|
+
/**
|
|
266
|
+
* Start an Omni agent run
|
|
267
|
+
* @description Queue the general Omni agent and return immediately with the run in `queued` state. Poll the URL in the `Location` header (`GET /api/v1/agents/general/runs/{runId}`), honoring `Retry-After`. Requires `agents:invoke`. The request body matches invoke.
|
|
268
|
+
*/
|
|
269
|
+
post: operations["post_v1_agents_general_runs"];
|
|
270
|
+
delete?: never;
|
|
271
|
+
options?: never;
|
|
272
|
+
head?: never;
|
|
273
|
+
patch?: never;
|
|
274
|
+
trace?: never;
|
|
275
|
+
};
|
|
276
|
+
"/api/v1/agents/general/runs/{runId}": {
|
|
277
|
+
parameters: {
|
|
278
|
+
query?: never;
|
|
279
|
+
header?: never;
|
|
280
|
+
path?: never;
|
|
281
|
+
cookie?: never;
|
|
282
|
+
};
|
|
283
|
+
/**
|
|
284
|
+
* Get an Omni agent run
|
|
285
|
+
* @description Read a queued, running, completed, paused, or failed Omni agent run. Requires `agents:invoke`.
|
|
286
|
+
*/
|
|
287
|
+
get: operations["get_v1_agents_general_runs_by_runid"];
|
|
288
|
+
put?: never;
|
|
289
|
+
post?: never;
|
|
290
|
+
delete?: never;
|
|
291
|
+
options?: never;
|
|
292
|
+
head?: never;
|
|
293
|
+
patch?: never;
|
|
294
|
+
trace?: never;
|
|
295
|
+
};
|
|
234
296
|
"/api/v1/aop/{aopId}/config": {
|
|
235
297
|
parameters: {
|
|
236
298
|
query?: never;
|
|
@@ -315,6 +377,134 @@ interface paths {
|
|
|
315
377
|
patch?: never;
|
|
316
378
|
trace?: never;
|
|
317
379
|
};
|
|
380
|
+
"/api/v1/campaigns": {
|
|
381
|
+
parameters: {
|
|
382
|
+
query?: never;
|
|
383
|
+
header?: never;
|
|
384
|
+
path?: never;
|
|
385
|
+
cookie?: never;
|
|
386
|
+
};
|
|
387
|
+
/**
|
|
388
|
+
* List Campaigns
|
|
389
|
+
* @description List campaigns for the authenticated organization. `stage=all` is the workspace working set: draft and running. Requires `promotions:read`.
|
|
390
|
+
*/
|
|
391
|
+
get: operations["get_v1_campaigns"];
|
|
392
|
+
put?: never;
|
|
393
|
+
/**
|
|
394
|
+
* Create Campaign
|
|
395
|
+
* @description Create a draft campaign. `ownerId` and `approverId` must be members of the organization, and every store must already be connected. Requires `promotions:write`.
|
|
396
|
+
*/
|
|
397
|
+
post: operations["post_v1_campaigns"];
|
|
398
|
+
delete?: never;
|
|
399
|
+
options?: never;
|
|
400
|
+
head?: never;
|
|
401
|
+
patch?: never;
|
|
402
|
+
trace?: never;
|
|
403
|
+
};
|
|
404
|
+
"/api/v1/campaigns/{campaignId}": {
|
|
405
|
+
parameters: {
|
|
406
|
+
query?: never;
|
|
407
|
+
header?: never;
|
|
408
|
+
path?: never;
|
|
409
|
+
cookie?: never;
|
|
410
|
+
};
|
|
411
|
+
/**
|
|
412
|
+
* Get Campaign
|
|
413
|
+
* @description Read one campaign, including its plan, executions, audit, schedule, and progress. Requires `promotions:read`.
|
|
414
|
+
*/
|
|
415
|
+
get: operations["get_v1_campaigns_by_campaignid"];
|
|
416
|
+
/**
|
|
417
|
+
* Update Campaign
|
|
418
|
+
* @description Replace a draft or approved plan, or propose one change to a running plan. Send `expectedRevision` from the last read. Requires `promotions:write`.
|
|
419
|
+
*/
|
|
420
|
+
put: operations["put_v1_campaigns_by_campaignid"];
|
|
421
|
+
post?: never;
|
|
422
|
+
delete?: never;
|
|
423
|
+
options?: never;
|
|
424
|
+
head?: never;
|
|
425
|
+
patch?: never;
|
|
426
|
+
trace?: never;
|
|
427
|
+
};
|
|
428
|
+
"/api/v1/campaigns/{campaignId}/actions": {
|
|
429
|
+
parameters: {
|
|
430
|
+
query?: never;
|
|
431
|
+
header?: never;
|
|
432
|
+
path?: never;
|
|
433
|
+
cookie?: never;
|
|
434
|
+
};
|
|
435
|
+
get?: never;
|
|
436
|
+
put?: never;
|
|
437
|
+
/**
|
|
438
|
+
* Act on Campaign
|
|
439
|
+
* @description Approve, start, end, resume, retry, or decide a proposed live change. Approve, run, resume, and approving a change must be called by the named approver. Requires `promotions:write`.
|
|
440
|
+
*/
|
|
441
|
+
post: operations["post_v1_campaigns_by_campaignid_actions"];
|
|
442
|
+
delete?: never;
|
|
443
|
+
options?: never;
|
|
444
|
+
head?: never;
|
|
445
|
+
patch?: never;
|
|
446
|
+
trace?: never;
|
|
447
|
+
};
|
|
448
|
+
"/api/v1/campaigns/archive": {
|
|
449
|
+
parameters: {
|
|
450
|
+
query?: never;
|
|
451
|
+
header?: never;
|
|
452
|
+
path?: never;
|
|
453
|
+
cookie?: never;
|
|
454
|
+
};
|
|
455
|
+
get?: never;
|
|
456
|
+
put?: never;
|
|
457
|
+
/**
|
|
458
|
+
* Archive Campaigns
|
|
459
|
+
* @description Archive campaigns, or restore archived campaigns by id or by the current archived list filters. Requires `promotions:write`.
|
|
460
|
+
*/
|
|
461
|
+
post: operations["post_v1_campaigns_archive"];
|
|
462
|
+
delete?: never;
|
|
463
|
+
options?: never;
|
|
464
|
+
head?: never;
|
|
465
|
+
patch?: never;
|
|
466
|
+
trace?: never;
|
|
467
|
+
};
|
|
468
|
+
"/api/v1/campaigns/delete": {
|
|
469
|
+
parameters: {
|
|
470
|
+
query?: never;
|
|
471
|
+
header?: never;
|
|
472
|
+
path?: never;
|
|
473
|
+
cookie?: never;
|
|
474
|
+
};
|
|
475
|
+
get?: never;
|
|
476
|
+
put?: never;
|
|
477
|
+
/**
|
|
478
|
+
* Delete Campaigns
|
|
479
|
+
* @description Permanently delete archived campaigns by explicit id or by archived list filters. Requires `promotions:write`.
|
|
480
|
+
*/
|
|
481
|
+
post: operations["post_v1_campaigns_delete"];
|
|
482
|
+
delete?: never;
|
|
483
|
+
options?: never;
|
|
484
|
+
head?: never;
|
|
485
|
+
patch?: never;
|
|
486
|
+
trace?: never;
|
|
487
|
+
};
|
|
488
|
+
"/api/v1/campaigns/options": {
|
|
489
|
+
parameters: {
|
|
490
|
+
query?: never;
|
|
491
|
+
header?: never;
|
|
492
|
+
path?: never;
|
|
493
|
+
cookie?: never;
|
|
494
|
+
};
|
|
495
|
+
/**
|
|
496
|
+
* Get Campaign Options
|
|
497
|
+
* @description List the organization members and connected stores a campaign plan can name. Use a member `id` for `ownerId` and `approverId`. Requires `promotions:write`.
|
|
498
|
+
*/
|
|
499
|
+
get: operations["get_v1_campaigns_options"];
|
|
500
|
+
put?: never;
|
|
501
|
+
post?: never;
|
|
502
|
+
delete?: never;
|
|
503
|
+
options?: never;
|
|
504
|
+
head?: never;
|
|
505
|
+
patch?: never;
|
|
506
|
+
trace?: never;
|
|
507
|
+
};
|
|
318
508
|
"/api/v1/catalog/items": {
|
|
319
509
|
parameters: {
|
|
320
510
|
query?: never;
|
|
@@ -1998,94 +2188,342 @@ interface components {
|
|
|
1998
2188
|
| "za"
|
|
1999
2189
|
| "zm"
|
|
2000
2190
|
| "zw";
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2191
|
+
CampaignPlan: {
|
|
2192
|
+
brief: {
|
|
2193
|
+
name: string;
|
|
2194
|
+
/** @default */
|
|
2195
|
+
objective: string;
|
|
2196
|
+
/** @default */
|
|
2197
|
+
brand: string;
|
|
2198
|
+
ownerId: string;
|
|
2199
|
+
approverId: string;
|
|
2200
|
+
timezone: string;
|
|
2201
|
+
/** @default [] */
|
|
2202
|
+
stores: {
|
|
2203
|
+
/** @enum {string} */
|
|
2204
|
+
marketplace:
|
|
2205
|
+
| "shopee"
|
|
2206
|
+
| "lazada"
|
|
2207
|
+
| "tiktok"
|
|
2208
|
+
| "shopify"
|
|
2209
|
+
| "whatsapp"
|
|
2210
|
+
| "zalora"
|
|
2211
|
+
| "amazon"
|
|
2212
|
+
| "ebay";
|
|
2213
|
+
country: string;
|
|
2214
|
+
storeId: string;
|
|
2215
|
+
}[];
|
|
2216
|
+
/** @default */
|
|
2217
|
+
serviceRequest: string;
|
|
2218
|
+
/**
|
|
2219
|
+
* @default standard
|
|
2220
|
+
* @enum {string}
|
|
2221
|
+
*/
|
|
2222
|
+
priority: "standard" | "priority" | "super_priority";
|
|
2223
|
+
/** @default [] */
|
|
2224
|
+
documentIds: string[];
|
|
2225
|
+
/** @default null */
|
|
2226
|
+
reviewDueAt: string | null;
|
|
2227
|
+
sourceCurrency?: string;
|
|
2228
|
+
/** @enum {string} */
|
|
2229
|
+
sourceMarketplace?:
|
|
2230
|
+
| "shopee"
|
|
2231
|
+
| "lazada"
|
|
2232
|
+
| "tiktok"
|
|
2233
|
+
| "shopify"
|
|
2234
|
+
| "whatsapp"
|
|
2235
|
+
| "zalora"
|
|
2236
|
+
| "amazon"
|
|
2237
|
+
| "ebay";
|
|
2238
|
+
sourceCountry?: string;
|
|
2239
|
+
/** @default */
|
|
2240
|
+
cleanupNotes: string;
|
|
2241
|
+
};
|
|
2242
|
+
/** @default [] */
|
|
2243
|
+
windows: {
|
|
2244
|
+
id: string;
|
|
2245
|
+
name: string;
|
|
2246
|
+
/**
|
|
2247
|
+
* @description Preparation time: publish promotions with the future live start/end. Must be at or before startsAt.
|
|
2248
|
+
* @default null
|
|
2249
|
+
*/
|
|
2250
|
+
preparesAt: string | null;
|
|
2251
|
+
startsAt: string | null;
|
|
2252
|
+
endsAt: string | null;
|
|
2253
|
+
/** @default */
|
|
2254
|
+
reviewNotes: string;
|
|
2050
2255
|
}[];
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2256
|
+
offers?: {
|
|
2257
|
+
id: string;
|
|
2258
|
+
windowId: string;
|
|
2259
|
+
/**
|
|
2260
|
+
* Format: uuid
|
|
2261
|
+
* @description Existing draft promotion attached to this window; the campaign controls its live dates.
|
|
2262
|
+
*/
|
|
2263
|
+
promotionId?: string;
|
|
2264
|
+
promotion: {
|
|
2265
|
+
name?: string;
|
|
2266
|
+
description?: string | null;
|
|
2267
|
+
/**
|
|
2268
|
+
* @description Canonical OmniCommerce promotion mechanic: product discount, flash sale, voucher, gift with purchase, Buy-X-Get-Y, bundle deal, or Lazada-only free shipping and early bird price.
|
|
2269
|
+
* @enum {string}
|
|
2270
|
+
*/
|
|
2271
|
+
kind?:
|
|
2272
|
+
| "product_discount"
|
|
2273
|
+
| "flash_sale"
|
|
2274
|
+
| "voucher"
|
|
2275
|
+
| "gift_with_purchase"
|
|
2276
|
+
| "buy_x_get_y"
|
|
2277
|
+
| "bundle_deal"
|
|
2278
|
+
| "free_shipping"
|
|
2279
|
+
| "early_bird_price";
|
|
2280
|
+
salesChannels?: ("pdp" | "live")[];
|
|
2281
|
+
/** @enum {string} */
|
|
2282
|
+
discountType?: "percentage" | "fixed_amount";
|
|
2283
|
+
discountValue?: number;
|
|
2284
|
+
/** @description Patch discount terms for exact target store keys; unnamed stores remain unchanged. Null discountValue restores shared campaign terms for that store. */
|
|
2285
|
+
storeDiscounts?: {
|
|
2286
|
+
storeKey: string;
|
|
2287
|
+
/** @enum {string} */
|
|
2288
|
+
discountType: "percentage" | "fixed_amount";
|
|
2289
|
+
discountValue: number | null;
|
|
2290
|
+
}[];
|
|
2291
|
+
/** @description Up to 100 connected stores for create (required) or update. Copy marketplace, country, and storeId from get_promotions targetStores or find_products marketplaceDetails. Do not concatenate a storeKeys string. */
|
|
2292
|
+
targetStores?: {
|
|
2293
|
+
/** @enum {string} */
|
|
2294
|
+
marketplace:
|
|
2295
|
+
| "lazada"
|
|
2296
|
+
| "shopee"
|
|
2297
|
+
| "tiktok"
|
|
2298
|
+
| "shopify"
|
|
2299
|
+
| "amazon"
|
|
2300
|
+
| "zalora"
|
|
2301
|
+
| "ebay";
|
|
2302
|
+
country: string;
|
|
2303
|
+
storeId: string;
|
|
2304
|
+
}[];
|
|
2305
|
+
minSalePrice?: number | null;
|
|
2306
|
+
maxDiscountAmount?: number | null;
|
|
2307
|
+
minSpend?: number | null;
|
|
2308
|
+
voucherCode?: string | null;
|
|
2309
|
+
claimStartsAt?: string | null;
|
|
2310
|
+
totalUsageLimit?: number | null;
|
|
2311
|
+
perBuyerLimit?: number | null;
|
|
2312
|
+
mechanicConfig?: {
|
|
2313
|
+
/** @description Voucher subtype from get_promotions capabilities.voucherTypes. Browser AOP types (delivery=browser_aop) are writable Seller Center vouchers. Omit browserAutomation.aopId to use the built-in marketplace AOP. */
|
|
2314
|
+
voucherType?:
|
|
2315
|
+
| (
|
|
2316
|
+
| "shopee_shop"
|
|
2317
|
+
| "shopee_product"
|
|
2318
|
+
| "shopee_private"
|
|
2319
|
+
| "shopee_live"
|
|
2320
|
+
| "shopee_video"
|
|
2321
|
+
| "shopee_new_buyer"
|
|
2322
|
+
| "shopee_repeat_buyer"
|
|
2323
|
+
| "shopee_follow_prize"
|
|
2324
|
+
| "shopee_exclusive_streamer"
|
|
2325
|
+
| "shopee_welcome"
|
|
2326
|
+
| "shopee_member_repeat_buyer"
|
|
2327
|
+
| "shopee_exclusive"
|
|
2328
|
+
| "shopee_redemption"
|
|
2329
|
+
| "shopee_exclusive_creator"
|
|
2330
|
+
| "lazada_store_follower"
|
|
2331
|
+
| "lazada_regular"
|
|
2332
|
+
| "lazada_store_new_buyer"
|
|
2333
|
+
| "lazada_live"
|
|
2334
|
+
| "lazada_offline"
|
|
2335
|
+
| "lazada_co_funded"
|
|
2336
|
+
| "lazada_welcome"
|
|
2337
|
+
| "lazada_linked_member"
|
|
2338
|
+
| "lazada_new_member"
|
|
2339
|
+
| "lazada_member_exclusive"
|
|
2340
|
+
| "lazada_points_redeemable"
|
|
2341
|
+
| "tiktok_seller_coupon"
|
|
2342
|
+
| "shopify_discount_code"
|
|
2343
|
+
| "amazon_promotion_code"
|
|
2344
|
+
| "zalora_seller_voucher"
|
|
2345
|
+
| "ebay_coded_coupon"
|
|
2346
|
+
)
|
|
2347
|
+
| null;
|
|
2348
|
+
browserAutomation?: {
|
|
2349
|
+
aopId?: string;
|
|
2350
|
+
variableValues?: {
|
|
2351
|
+
[key: string]: string;
|
|
2352
|
+
};
|
|
2353
|
+
instructions?: string;
|
|
2354
|
+
} | null;
|
|
2355
|
+
/**
|
|
2356
|
+
* @description shop = all products, products = selected assigned products. Repeat Buyer defaults to shop.
|
|
2357
|
+
* @enum {string}
|
|
2358
|
+
*/
|
|
2359
|
+
voucherScope?: "products" | "shop";
|
|
2360
|
+
/**
|
|
2361
|
+
* @description Seller Center reward type. coins_cashback is a percentage greater than 3 and does not reduce salePrice.
|
|
2362
|
+
* @enum {string}
|
|
2363
|
+
*/
|
|
2364
|
+
voucherReward?: "discount" | "coins_cashback";
|
|
2365
|
+
/** @enum {string} */
|
|
2366
|
+
voucherAudience?: "general" | "shop_follow";
|
|
2367
|
+
/** @description Shopee Repeat Buyer: minimum completed shop orders, 1 or 2. Required for shopee_repeat_buyer. */
|
|
2368
|
+
repeatPurchaseMinCount?: number;
|
|
2369
|
+
/** @description Shopee Repeat Buyer: lookback window in days, one of 30, 90, 180 or 365. Required for shopee_repeat_buyer. */
|
|
2370
|
+
repeatPurchaseLookbackDays?: number;
|
|
2371
|
+
/** @description Shopee Smart Voucher toggle. Used by New Buyer and similar portal types. */
|
|
2372
|
+
smartVoucher?: boolean;
|
|
2373
|
+
/** @description Shopee Follow Prize: days after claim until expiry. Seller Center is 7. */
|
|
2374
|
+
followPrizeExpiryDays?: number;
|
|
2375
|
+
/**
|
|
2376
|
+
* @description Shopee Video display: shopee_video = all Shopee Video; creator_video = targeted creator videos only.
|
|
2377
|
+
* @enum {string}
|
|
2378
|
+
*/
|
|
2379
|
+
videoDisplayMode?: "shopee_video" | "creator_video";
|
|
2380
|
+
/** @description Exclusive Creator Voucher: up to 15 Shopee usernames. */
|
|
2381
|
+
exclusiveCreatorUsernames?: string[];
|
|
2382
|
+
/** @description Exclusive Streamer Voucher: up to 15 Shopee usernames. */
|
|
2383
|
+
exclusiveStreamerUsernames?: string[];
|
|
2384
|
+
/** @description Shopee display setting. ["all"] = display on all pages; [] = hidden/share by code. */
|
|
2385
|
+
voucherDisplayChannels?: (
|
|
2386
|
+
| "all"
|
|
2387
|
+
| "feed"
|
|
2388
|
+
| "live"
|
|
2389
|
+
| "order_page"
|
|
2390
|
+
| "followers"
|
|
2391
|
+
| "offline"
|
|
2392
|
+
)[];
|
|
2393
|
+
/** @enum {string} */
|
|
2394
|
+
bundlePriceType?: "discount" | "fixed_price";
|
|
2395
|
+
bundleTiers?: {
|
|
2396
|
+
minimumQuantity: number;
|
|
2397
|
+
discountValue: number;
|
|
2398
|
+
}[];
|
|
2399
|
+
/** @enum {string} */
|
|
2400
|
+
thresholdType?: "item_quantity" | "order_amount";
|
|
2401
|
+
thresholdValue?: number;
|
|
2402
|
+
/** @enum {string} */
|
|
2403
|
+
giftType?: "gift" | "sample";
|
|
2404
|
+
giftQuantity?: number;
|
|
2405
|
+
gifts?: {
|
|
2406
|
+
/** Format: uuid */
|
|
2407
|
+
productId: string;
|
|
2408
|
+
variantId?: string | null;
|
|
2409
|
+
totalClaimLimit: number;
|
|
2410
|
+
}[];
|
|
2411
|
+
buyQuantity?: number;
|
|
2412
|
+
getQuantity?: number;
|
|
2413
|
+
benefitProductIds?: string[];
|
|
2414
|
+
/** @enum {string} */
|
|
2415
|
+
benefitType?: "free" | "percentage" | "fixed_amount";
|
|
2416
|
+
benefitValue?: number;
|
|
2417
|
+
maxApplicationsPerOrder?: number;
|
|
2418
|
+
bundleMinimumQuantity?: number;
|
|
2419
|
+
/** @description Free shipping delivery option. Lazada: STANDARD (default), ECONOMY, EXPRESS, SELLER_OWN_FLEET or P2P, as offered by the store. */
|
|
2420
|
+
shippingDeliveryOption?: string;
|
|
2421
|
+
/** @description Free shipping: total shipping subsidy budget in the store currency. Omit for an unlimited budget. */
|
|
2422
|
+
shippingBudget?: number;
|
|
2423
|
+
};
|
|
2424
|
+
};
|
|
2425
|
+
/** @default [] */
|
|
2426
|
+
productIds: string[];
|
|
2427
|
+
/** @default */
|
|
2428
|
+
reviewNotes: string;
|
|
2429
|
+
/** @default */
|
|
2430
|
+
excludedReason: string;
|
|
2431
|
+
source?: {
|
|
2432
|
+
sheet: string;
|
|
2433
|
+
rows: number[];
|
|
2434
|
+
headers: string[];
|
|
2435
|
+
values: string[][];
|
|
2436
|
+
};
|
|
2437
|
+
}[];
|
|
2438
|
+
};
|
|
2439
|
+
ProductEnrichmentWebhookSnapshot: {
|
|
2440
|
+
jobId: string;
|
|
2441
|
+
batchId: string | null;
|
|
2442
|
+
/** @enum {string} */
|
|
2443
|
+
workflow: "listing_copy" | "marketplace_taxonomy";
|
|
2444
|
+
marketplace: string | null;
|
|
2445
|
+
/** @enum {string} */
|
|
2446
|
+
status: "running" | "pending_review" | "applied";
|
|
2447
|
+
};
|
|
2448
|
+
ProductWebhookSnapshot: {
|
|
2449
|
+
id: string;
|
|
2450
|
+
parentId: string | null;
|
|
2451
|
+
/** @enum {string} */
|
|
2452
|
+
type: "product" | "variant";
|
|
2453
|
+
productFamilyId: string;
|
|
2454
|
+
productFamilyName: string | null;
|
|
2455
|
+
name: string | null;
|
|
2456
|
+
description: string | null;
|
|
2457
|
+
sku: string | null;
|
|
2458
|
+
brand: string | null;
|
|
2459
|
+
status: string | null;
|
|
2460
|
+
/** @description Catalog price in the legacy product event contract. Use currency with this value. */
|
|
2461
|
+
price: number | null;
|
|
2462
|
+
/** @description Optional catalog sale price in the legacy product event contract. */
|
|
2463
|
+
salePrice: number | null;
|
|
2464
|
+
compareAtPrice: number | null;
|
|
2465
|
+
costPrice: number | null;
|
|
2466
|
+
costPriceCurrency: string | null;
|
|
2467
|
+
mapPrice: number | null;
|
|
2468
|
+
msrpPrice: number | null;
|
|
2469
|
+
currency: string | null;
|
|
2470
|
+
upc: string | null;
|
|
2471
|
+
category: string | null;
|
|
2472
|
+
tags: string[];
|
|
2473
|
+
inventory: {
|
|
2474
|
+
quantity?: number | null;
|
|
2475
|
+
} & {
|
|
2476
|
+
[key: string]: unknown;
|
|
2477
|
+
};
|
|
2478
|
+
images: unknown[];
|
|
2479
|
+
variants: unknown[];
|
|
2480
|
+
variationSchema: {
|
|
2481
|
+
[key: string]: unknown;
|
|
2482
|
+
};
|
|
2483
|
+
marketplaces: {
|
|
2484
|
+
[key: string]: unknown;
|
|
2485
|
+
};
|
|
2486
|
+
promotions: {
|
|
2487
|
+
[key: string]: unknown;
|
|
2488
|
+
}[];
|
|
2489
|
+
/** Format: date-time */
|
|
2490
|
+
updatedAt: string | null;
|
|
2491
|
+
/** Format: date-time */
|
|
2492
|
+
createdAt: string | null;
|
|
2493
|
+
} & {
|
|
2494
|
+
[key: string]: unknown;
|
|
2495
|
+
};
|
|
2496
|
+
LookProductWebhookSnapshot: {
|
|
2497
|
+
id: string;
|
|
2498
|
+
name: string;
|
|
2499
|
+
sku: string | null;
|
|
2500
|
+
brand: string | null;
|
|
2501
|
+
price: number | null;
|
|
2502
|
+
currency: string | null;
|
|
2503
|
+
imageUrl: string | null;
|
|
2504
|
+
} & {
|
|
2505
|
+
[key: string]: unknown;
|
|
2506
|
+
};
|
|
2507
|
+
LookWebhookSnapshot: {
|
|
2508
|
+
id: string;
|
|
2509
|
+
organizationId: string;
|
|
2510
|
+
title: string | null;
|
|
2511
|
+
/** @enum {string} */
|
|
2512
|
+
status: "draft" | "published";
|
|
2513
|
+
subject: string | null;
|
|
2514
|
+
style: string | null;
|
|
2515
|
+
season: string | null;
|
|
2516
|
+
timeOfDay: string | null;
|
|
2517
|
+
city: string | null;
|
|
2518
|
+
additionalNotes: string | null;
|
|
2519
|
+
stylePrompt: string | null;
|
|
2520
|
+
heroImageTagId: string | null;
|
|
2521
|
+
heroImageUrl: string | null;
|
|
2522
|
+
createdBy: string | null;
|
|
2523
|
+
/** Format: date-time */
|
|
2524
|
+
createdAt: string;
|
|
2525
|
+
/** Format: date-time */
|
|
2526
|
+
updatedAt: string;
|
|
2089
2527
|
/** Format: date-time */
|
|
2090
2528
|
publishedAt: string | null;
|
|
2091
2529
|
productCount: number;
|
|
@@ -3005,56 +3443,119 @@ interface operations {
|
|
|
3005
3443
|
};
|
|
3006
3444
|
};
|
|
3007
3445
|
};
|
|
3008
|
-
|
|
3446
|
+
post_v1_agents_general_invoke: {
|
|
3009
3447
|
parameters: {
|
|
3010
|
-
query?:
|
|
3011
|
-
organizationId?: string;
|
|
3012
|
-
};
|
|
3448
|
+
query?: never;
|
|
3013
3449
|
header?: never;
|
|
3014
|
-
path
|
|
3015
|
-
aopId: string;
|
|
3016
|
-
};
|
|
3450
|
+
path?: never;
|
|
3017
3451
|
cookie?: never;
|
|
3018
3452
|
};
|
|
3019
|
-
requestBody
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3453
|
+
requestBody: {
|
|
3454
|
+
content: {
|
|
3455
|
+
/**
|
|
3456
|
+
* @example {
|
|
3457
|
+
* "messages": [
|
|
3458
|
+
* {
|
|
3459
|
+
* "role": "user",
|
|
3460
|
+
* "content": "How many products are missing a price?"
|
|
3461
|
+
* }
|
|
3462
|
+
* ]
|
|
3463
|
+
* }
|
|
3464
|
+
*/
|
|
3465
|
+
"application/json": {
|
|
3466
|
+
organizationId?: string;
|
|
3467
|
+
thread_id?: string | null;
|
|
3468
|
+
channel?: string;
|
|
3469
|
+
messages?: {
|
|
3470
|
+
/** @enum {string} */
|
|
3471
|
+
role?: "user" | "assistant" | "system";
|
|
3472
|
+
content:
|
|
3473
|
+
| string
|
|
3474
|
+
| (
|
|
3475
|
+
| {
|
|
3476
|
+
/** @constant */
|
|
3477
|
+
type: "text";
|
|
3478
|
+
text: string;
|
|
3479
|
+
}
|
|
3480
|
+
| {
|
|
3481
|
+
/** @constant */
|
|
3482
|
+
type: "image";
|
|
3483
|
+
url: string;
|
|
3484
|
+
filename?: string;
|
|
3485
|
+
}
|
|
3486
|
+
)[];
|
|
3487
|
+
id?: string;
|
|
3488
|
+
name?: string;
|
|
3489
|
+
}[];
|
|
3490
|
+
config?: {
|
|
3491
|
+
enabled_tools?: string[];
|
|
3492
|
+
model?: string | null;
|
|
3493
|
+
system_prompt?: string;
|
|
3036
3494
|
structured_output?: {
|
|
3037
3495
|
[key: string]: unknown;
|
|
3038
3496
|
} | null;
|
|
3039
|
-
/** @description Computed JSON Schema for user_inputs, derived from [[ placeholder ]] tokens and declared variables. */
|
|
3040
|
-
structured_inputs?: {
|
|
3041
|
-
[key: string]: unknown;
|
|
3042
|
-
} | null;
|
|
3043
|
-
agent_config?: {
|
|
3044
|
-
[key: string]: unknown;
|
|
3045
|
-
} | null;
|
|
3046
|
-
user_notification_configs?: {
|
|
3047
|
-
[key: string]: unknown;
|
|
3048
|
-
} | null;
|
|
3049
3497
|
};
|
|
3498
|
+
decisions?: {
|
|
3499
|
+
/** @enum {string} */
|
|
3500
|
+
action: "approve" | "reject";
|
|
3501
|
+
reason?: string;
|
|
3502
|
+
}[];
|
|
3050
3503
|
};
|
|
3051
3504
|
};
|
|
3052
|
-
|
|
3053
|
-
|
|
3505
|
+
};
|
|
3506
|
+
responses: {
|
|
3507
|
+
/** @description The agent finished or is waiting for approval. */
|
|
3508
|
+
200: {
|
|
3054
3509
|
headers: {
|
|
3055
3510
|
[name: string]: unknown;
|
|
3056
3511
|
};
|
|
3057
|
-
content
|
|
3512
|
+
content: {
|
|
3513
|
+
"application/json": {
|
|
3514
|
+
run_id: string;
|
|
3515
|
+
thread_id: string;
|
|
3516
|
+
/** @enum {string} */
|
|
3517
|
+
status:
|
|
3518
|
+
| "queued"
|
|
3519
|
+
| "running"
|
|
3520
|
+
| "completed"
|
|
3521
|
+
| "awaiting_approval"
|
|
3522
|
+
| "failed";
|
|
3523
|
+
messages: {
|
|
3524
|
+
/** @enum {string} */
|
|
3525
|
+
type: "human" | "ai" | "tool" | "system";
|
|
3526
|
+
/** @enum {string} */
|
|
3527
|
+
role: "user" | "assistant" | "tool" | "system";
|
|
3528
|
+
content: string;
|
|
3529
|
+
id?: string;
|
|
3530
|
+
name?: string;
|
|
3531
|
+
tool_calls?: {
|
|
3532
|
+
id?: string;
|
|
3533
|
+
name: string;
|
|
3534
|
+
args: unknown;
|
|
3535
|
+
}[];
|
|
3536
|
+
tool_call_id?: string;
|
|
3537
|
+
}[];
|
|
3538
|
+
structured_output: {
|
|
3539
|
+
[key: string]: unknown;
|
|
3540
|
+
} | null;
|
|
3541
|
+
approvals:
|
|
3542
|
+
| {
|
|
3543
|
+
interrupt_instance_id: string;
|
|
3544
|
+
tool_name: string | null;
|
|
3545
|
+
tool_args: unknown;
|
|
3546
|
+
message: string;
|
|
3547
|
+
}[]
|
|
3548
|
+
| null;
|
|
3549
|
+
error: string | null;
|
|
3550
|
+
};
|
|
3551
|
+
};
|
|
3552
|
+
};
|
|
3553
|
+
/** @description Invalid agent request, unknown tool or model, or a decision count that does not match the pending approvals */
|
|
3554
|
+
400: {
|
|
3555
|
+
headers: {
|
|
3556
|
+
[name: string]: unknown;
|
|
3557
|
+
};
|
|
3558
|
+
content?: never;
|
|
3058
3559
|
};
|
|
3059
3560
|
/** @description Unauthorized */
|
|
3060
3561
|
401: {
|
|
@@ -3070,76 +3571,148 @@ interface operations {
|
|
|
3070
3571
|
};
|
|
3071
3572
|
content?: never;
|
|
3072
3573
|
};
|
|
3073
|
-
/** @description
|
|
3574
|
+
/** @description Missing agents:invoke scope or Assistant access */
|
|
3074
3575
|
403: {
|
|
3075
3576
|
headers: {
|
|
3076
3577
|
[name: string]: unknown;
|
|
3077
3578
|
};
|
|
3078
3579
|
content?: never;
|
|
3079
3580
|
};
|
|
3080
|
-
/** @description
|
|
3081
|
-
|
|
3581
|
+
/** @description The thread already has an active run, or decisions were sent for a thread with no run awaiting approval */
|
|
3582
|
+
409: {
|
|
3082
3583
|
headers: {
|
|
3083
3584
|
[name: string]: unknown;
|
|
3084
3585
|
};
|
|
3085
3586
|
content?: never;
|
|
3086
3587
|
};
|
|
3087
|
-
/** @description
|
|
3588
|
+
/** @description The agent run failed. `data.run_id` identifies the stored run */
|
|
3088
3589
|
500: {
|
|
3089
3590
|
headers: {
|
|
3090
3591
|
[name: string]: unknown;
|
|
3091
3592
|
};
|
|
3092
3593
|
content?: never;
|
|
3093
3594
|
};
|
|
3595
|
+
/** @description The agent run timed out. `data.run_id` identifies the stored run */
|
|
3596
|
+
504: {
|
|
3597
|
+
headers: {
|
|
3598
|
+
[name: string]: unknown;
|
|
3599
|
+
};
|
|
3600
|
+
content?: never;
|
|
3601
|
+
};
|
|
3094
3602
|
};
|
|
3095
3603
|
};
|
|
3096
|
-
|
|
3604
|
+
post_v1_agents_general_runs: {
|
|
3097
3605
|
parameters: {
|
|
3098
3606
|
query?: never;
|
|
3099
3607
|
header?: never;
|
|
3100
|
-
path
|
|
3101
|
-
aopId: string;
|
|
3102
|
-
};
|
|
3608
|
+
path?: never;
|
|
3103
3609
|
cookie?: never;
|
|
3104
3610
|
};
|
|
3105
3611
|
requestBody: {
|
|
3106
3612
|
content: {
|
|
3613
|
+
/**
|
|
3614
|
+
* @example {
|
|
3615
|
+
* "messages": [
|
|
3616
|
+
* {
|
|
3617
|
+
* "role": "user",
|
|
3618
|
+
* "content": "Summarize orders placed today."
|
|
3619
|
+
* }
|
|
3620
|
+
* ]
|
|
3621
|
+
* }
|
|
3622
|
+
*/
|
|
3107
3623
|
"application/json": {
|
|
3108
|
-
prompt?: string | null;
|
|
3109
|
-
description?: string | null;
|
|
3110
|
-
agentId?: string | null;
|
|
3111
|
-
agent_config?: {
|
|
3112
|
-
[key: string]: unknown;
|
|
3113
|
-
} | null;
|
|
3114
|
-
icon?: string | null;
|
|
3115
|
-
section?: string | null;
|
|
3116
|
-
structured_output?: {
|
|
3117
|
-
[key: string]: unknown;
|
|
3118
|
-
} | null;
|
|
3119
|
-
user_notification_configs?: {
|
|
3120
|
-
[key: string]: unknown;
|
|
3121
|
-
} | null;
|
|
3122
|
-
/** @description Required for session auth. Optional for API keys. */
|
|
3123
3624
|
organizationId?: string;
|
|
3625
|
+
thread_id?: string | null;
|
|
3626
|
+
channel?: string;
|
|
3627
|
+
messages?: {
|
|
3628
|
+
/** @enum {string} */
|
|
3629
|
+
role?: "user" | "assistant" | "system";
|
|
3630
|
+
content:
|
|
3631
|
+
| string
|
|
3632
|
+
| (
|
|
3633
|
+
| {
|
|
3634
|
+
/** @constant */
|
|
3635
|
+
type: "text";
|
|
3636
|
+
text: string;
|
|
3637
|
+
}
|
|
3638
|
+
| {
|
|
3639
|
+
/** @constant */
|
|
3640
|
+
type: "image";
|
|
3641
|
+
url: string;
|
|
3642
|
+
filename?: string;
|
|
3643
|
+
}
|
|
3644
|
+
)[];
|
|
3645
|
+
id?: string;
|
|
3646
|
+
name?: string;
|
|
3647
|
+
}[];
|
|
3648
|
+
config?: {
|
|
3649
|
+
enabled_tools?: string[];
|
|
3650
|
+
model?: string | null;
|
|
3651
|
+
system_prompt?: string;
|
|
3652
|
+
structured_output?: {
|
|
3653
|
+
[key: string]: unknown;
|
|
3654
|
+
} | null;
|
|
3655
|
+
};
|
|
3656
|
+
decisions?: {
|
|
3657
|
+
/** @enum {string} */
|
|
3658
|
+
action: "approve" | "reject";
|
|
3659
|
+
reason?: string;
|
|
3660
|
+
}[];
|
|
3124
3661
|
};
|
|
3125
3662
|
};
|
|
3126
3663
|
};
|
|
3127
3664
|
responses: {
|
|
3128
|
-
/** @description
|
|
3129
|
-
|
|
3665
|
+
/** @description The agent run was queued. */
|
|
3666
|
+
202: {
|
|
3130
3667
|
headers: {
|
|
3668
|
+
/** @description The run to poll. */
|
|
3669
|
+
Location?: string;
|
|
3670
|
+
/** @description Seconds to wait before polling again. Sent while the run is queued or running. */
|
|
3671
|
+
"Retry-After"?: number;
|
|
3131
3672
|
[name: string]: unknown;
|
|
3132
3673
|
};
|
|
3133
3674
|
content: {
|
|
3134
3675
|
"application/json": {
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3676
|
+
run_id: string;
|
|
3677
|
+
thread_id: string;
|
|
3678
|
+
/** @enum {string} */
|
|
3679
|
+
status:
|
|
3680
|
+
| "queued"
|
|
3681
|
+
| "running"
|
|
3682
|
+
| "completed"
|
|
3683
|
+
| "awaiting_approval"
|
|
3684
|
+
| "failed";
|
|
3685
|
+
messages: {
|
|
3686
|
+
/** @enum {string} */
|
|
3687
|
+
type: "human" | "ai" | "tool" | "system";
|
|
3688
|
+
/** @enum {string} */
|
|
3689
|
+
role: "user" | "assistant" | "tool" | "system";
|
|
3690
|
+
content: string;
|
|
3691
|
+
id?: string;
|
|
3692
|
+
name?: string;
|
|
3693
|
+
tool_calls?: {
|
|
3694
|
+
id?: string;
|
|
3695
|
+
name: string;
|
|
3696
|
+
args: unknown;
|
|
3697
|
+
}[];
|
|
3698
|
+
tool_call_id?: string;
|
|
3699
|
+
}[];
|
|
3700
|
+
structured_output: {
|
|
3701
|
+
[key: string]: unknown;
|
|
3702
|
+
} | null;
|
|
3703
|
+
approvals:
|
|
3704
|
+
| {
|
|
3705
|
+
interrupt_instance_id: string;
|
|
3706
|
+
tool_name: string | null;
|
|
3707
|
+
tool_args: unknown;
|
|
3708
|
+
message: string;
|
|
3709
|
+
}[]
|
|
3710
|
+
| null;
|
|
3711
|
+
error: string | null;
|
|
3139
3712
|
};
|
|
3140
3713
|
};
|
|
3141
3714
|
};
|
|
3142
|
-
/** @description Invalid
|
|
3715
|
+
/** @description Invalid agent request, unknown tool or model, or a decision count that does not match the pending approvals */
|
|
3143
3716
|
400: {
|
|
3144
3717
|
headers: {
|
|
3145
3718
|
[name: string]: unknown;
|
|
@@ -3160,21 +3733,21 @@ interface operations {
|
|
|
3160
3733
|
};
|
|
3161
3734
|
content?: never;
|
|
3162
3735
|
};
|
|
3163
|
-
/** @description
|
|
3736
|
+
/** @description Missing agents:invoke scope or Assistant access */
|
|
3164
3737
|
403: {
|
|
3165
3738
|
headers: {
|
|
3166
3739
|
[name: string]: unknown;
|
|
3167
3740
|
};
|
|
3168
3741
|
content?: never;
|
|
3169
3742
|
};
|
|
3170
|
-
/** @description
|
|
3171
|
-
|
|
3743
|
+
/** @description The thread already has an active run, or decisions were sent for a thread with no run awaiting approval */
|
|
3744
|
+
409: {
|
|
3172
3745
|
headers: {
|
|
3173
3746
|
[name: string]: unknown;
|
|
3174
3747
|
};
|
|
3175
3748
|
content?: never;
|
|
3176
3749
|
};
|
|
3177
|
-
/** @description
|
|
3750
|
+
/** @description The agent run failed. `data.run_id` identifies the stored run */
|
|
3178
3751
|
500: {
|
|
3179
3752
|
headers: {
|
|
3180
3753
|
[name: string]: unknown;
|
|
@@ -3183,40 +3756,110 @@ interface operations {
|
|
|
3183
3756
|
};
|
|
3184
3757
|
};
|
|
3185
3758
|
};
|
|
3186
|
-
|
|
3759
|
+
get_v1_agents_general_runs_by_runid: {
|
|
3187
3760
|
parameters: {
|
|
3188
|
-
query?:
|
|
3761
|
+
query?: {
|
|
3762
|
+
/** @description Required for session auth. Optional for API keys, which already belong to one organization. */
|
|
3763
|
+
organizationId?: string;
|
|
3764
|
+
};
|
|
3189
3765
|
header?: never;
|
|
3190
3766
|
path: {
|
|
3191
|
-
|
|
3767
|
+
runId: string;
|
|
3192
3768
|
};
|
|
3193
3769
|
cookie?: never;
|
|
3194
3770
|
};
|
|
3195
|
-
requestBody?:
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3771
|
+
requestBody?: never;
|
|
3772
|
+
responses: {
|
|
3773
|
+
/** @description The agent run. */
|
|
3774
|
+
200: {
|
|
3775
|
+
headers: {
|
|
3776
|
+
/** @description Seconds to wait before polling again. Sent while the run is queued or running. */
|
|
3777
|
+
"Retry-After"?: number;
|
|
3778
|
+
[name: string]: unknown;
|
|
3779
|
+
};
|
|
3780
|
+
content: {
|
|
3781
|
+
"application/json": {
|
|
3782
|
+
run_id: string;
|
|
3783
|
+
thread_id: string;
|
|
3784
|
+
/** @enum {string} */
|
|
3785
|
+
status:
|
|
3786
|
+
| "queued"
|
|
3787
|
+
| "running"
|
|
3788
|
+
| "completed"
|
|
3789
|
+
| "awaiting_approval"
|
|
3790
|
+
| "failed";
|
|
3791
|
+
messages: {
|
|
3792
|
+
/** @enum {string} */
|
|
3793
|
+
type: "human" | "ai" | "tool" | "system";
|
|
3794
|
+
/** @enum {string} */
|
|
3795
|
+
role: "user" | "assistant" | "tool" | "system";
|
|
3796
|
+
content: string;
|
|
3797
|
+
id?: string;
|
|
3798
|
+
name?: string;
|
|
3799
|
+
tool_calls?: {
|
|
3800
|
+
id?: string;
|
|
3801
|
+
name: string;
|
|
3802
|
+
args: unknown;
|
|
3803
|
+
}[];
|
|
3804
|
+
tool_call_id?: string;
|
|
3805
|
+
}[];
|
|
3806
|
+
structured_output: {
|
|
3807
|
+
[key: string]: unknown;
|
|
3808
|
+
} | null;
|
|
3809
|
+
approvals:
|
|
3810
|
+
| {
|
|
3811
|
+
interrupt_instance_id: string;
|
|
3812
|
+
tool_name: string | null;
|
|
3813
|
+
tool_args: unknown;
|
|
3814
|
+
message: string;
|
|
3815
|
+
}[]
|
|
3816
|
+
| null;
|
|
3817
|
+
error: string | null;
|
|
3818
|
+
};
|
|
3819
|
+
};
|
|
3820
|
+
};
|
|
3821
|
+
/** @description Invalid agent request, unknown tool or model, or a decision count that does not match the pending approvals */
|
|
3822
|
+
400: {
|
|
3823
|
+
headers: {
|
|
3824
|
+
[name: string]: unknown;
|
|
3825
|
+
};
|
|
3826
|
+
content?: never;
|
|
3827
|
+
};
|
|
3828
|
+
/** @description Unauthorized */
|
|
3829
|
+
401: {
|
|
3830
|
+
headers: {
|
|
3831
|
+
[name: string]: unknown;
|
|
3217
3832
|
};
|
|
3833
|
+
content?: never;
|
|
3834
|
+
};
|
|
3835
|
+
/** @description Missing agents:invoke scope or Assistant access */
|
|
3836
|
+
403: {
|
|
3837
|
+
headers: {
|
|
3838
|
+
[name: string]: unknown;
|
|
3839
|
+
};
|
|
3840
|
+
content?: never;
|
|
3841
|
+
};
|
|
3842
|
+
/** @description Agent run not found */
|
|
3843
|
+
404: {
|
|
3844
|
+
headers: {
|
|
3845
|
+
[name: string]: unknown;
|
|
3846
|
+
};
|
|
3847
|
+
content?: never;
|
|
3848
|
+
};
|
|
3849
|
+
};
|
|
3850
|
+
};
|
|
3851
|
+
get_v1_aop_by_aopid_config: {
|
|
3852
|
+
parameters: {
|
|
3853
|
+
query?: {
|
|
3854
|
+
organizationId?: string;
|
|
3855
|
+
};
|
|
3856
|
+
header?: never;
|
|
3857
|
+
path: {
|
|
3858
|
+
aopId: string;
|
|
3218
3859
|
};
|
|
3860
|
+
cookie?: never;
|
|
3219
3861
|
};
|
|
3862
|
+
requestBody?: never;
|
|
3220
3863
|
responses: {
|
|
3221
3864
|
/** @description Success */
|
|
3222
3865
|
200: {
|
|
@@ -3224,42 +3867,1878 @@ interface operations {
|
|
|
3224
3867
|
[name: string]: unknown;
|
|
3225
3868
|
};
|
|
3226
3869
|
content: {
|
|
3227
|
-
/**
|
|
3228
|
-
* @example {
|
|
3229
|
-
* "status": "started",
|
|
3230
|
-
* "thread_id": "agent-aop-run_1",
|
|
3231
|
-
* "trigger_type": "api",
|
|
3232
|
-
* "message": "Task execution started successfully. Use the thread_id to track progress.",
|
|
3233
|
-
* "aop_id": "aop_1",
|
|
3234
|
-
* "aop_title": "Market Research Report Generator",
|
|
3235
|
-
* "base_prompt": "Generate a comprehensive market research report",
|
|
3236
|
-
* "final_prompt": "Generate a comprehensive market research report\n\n--- User Inputs ---\ncompany: Acme Corp\n",
|
|
3237
|
-
* "aop_config": {
|
|
3238
|
-
* "agentId": "research"
|
|
3239
|
-
* }
|
|
3240
|
-
* }
|
|
3241
|
-
*/
|
|
3242
3870
|
"application/json": {
|
|
3243
|
-
/** @example started */
|
|
3244
|
-
status: string;
|
|
3245
|
-
thread_id: string;
|
|
3246
|
-
/** @constant */
|
|
3247
|
-
trigger_type: "api";
|
|
3248
|
-
message?: string;
|
|
3249
3871
|
aop_id: string;
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3872
|
+
title?: string | null;
|
|
3873
|
+
prompt?: string;
|
|
3874
|
+
description?: string;
|
|
3875
|
+
agentId?: string | null;
|
|
3876
|
+
/** @default ListTodo */
|
|
3877
|
+
icon: string;
|
|
3878
|
+
section?: string;
|
|
3879
|
+
structured_output?: {
|
|
3880
|
+
[key: string]: unknown;
|
|
3881
|
+
} | null;
|
|
3882
|
+
/** @description Computed JSON Schema for user_inputs, derived from [[ placeholder ]] tokens and declared variables. */
|
|
3883
|
+
structured_inputs?: {
|
|
3884
|
+
[key: string]: unknown;
|
|
3885
|
+
} | null;
|
|
3886
|
+
agent_config?: {
|
|
3887
|
+
[key: string]: unknown;
|
|
3888
|
+
} | null;
|
|
3889
|
+
user_notification_configs?: {
|
|
3254
3890
|
[key: string]: unknown;
|
|
3891
|
+
} | null;
|
|
3892
|
+
};
|
|
3893
|
+
};
|
|
3894
|
+
};
|
|
3895
|
+
/** @description Invalid AOP configuration or request */
|
|
3896
|
+
400: {
|
|
3897
|
+
headers: {
|
|
3898
|
+
[name: string]: unknown;
|
|
3899
|
+
};
|
|
3900
|
+
content?: never;
|
|
3901
|
+
};
|
|
3902
|
+
/** @description Unauthorized */
|
|
3903
|
+
401: {
|
|
3904
|
+
headers: {
|
|
3905
|
+
[name: string]: unknown;
|
|
3906
|
+
};
|
|
3907
|
+
content?: never;
|
|
3908
|
+
};
|
|
3909
|
+
/** @description Insufficient AI credits */
|
|
3910
|
+
402: {
|
|
3911
|
+
headers: {
|
|
3912
|
+
[name: string]: unknown;
|
|
3913
|
+
};
|
|
3914
|
+
content?: never;
|
|
3915
|
+
};
|
|
3916
|
+
/** @description Forbidden. Missing OAuth scope. */
|
|
3917
|
+
403: {
|
|
3918
|
+
headers: {
|
|
3919
|
+
[name: string]: unknown;
|
|
3920
|
+
};
|
|
3921
|
+
content?: never;
|
|
3922
|
+
};
|
|
3923
|
+
/** @description AOP or thread not found */
|
|
3924
|
+
404: {
|
|
3925
|
+
headers: {
|
|
3926
|
+
[name: string]: unknown;
|
|
3927
|
+
};
|
|
3928
|
+
content?: never;
|
|
3929
|
+
};
|
|
3930
|
+
/** @description Internal server error */
|
|
3931
|
+
500: {
|
|
3932
|
+
headers: {
|
|
3933
|
+
[name: string]: unknown;
|
|
3934
|
+
};
|
|
3935
|
+
content?: never;
|
|
3936
|
+
};
|
|
3937
|
+
};
|
|
3938
|
+
};
|
|
3939
|
+
put_v1_aop_by_aopid_config: {
|
|
3940
|
+
parameters: {
|
|
3941
|
+
query?: never;
|
|
3942
|
+
header?: never;
|
|
3943
|
+
path: {
|
|
3944
|
+
aopId: string;
|
|
3945
|
+
};
|
|
3946
|
+
cookie?: never;
|
|
3947
|
+
};
|
|
3948
|
+
requestBody: {
|
|
3949
|
+
content: {
|
|
3950
|
+
"application/json": {
|
|
3951
|
+
prompt?: string | null;
|
|
3952
|
+
description?: string | null;
|
|
3953
|
+
agentId?: string | null;
|
|
3954
|
+
agent_config?: {
|
|
3955
|
+
[key: string]: unknown;
|
|
3956
|
+
} | null;
|
|
3957
|
+
icon?: string | null;
|
|
3958
|
+
section?: string | null;
|
|
3959
|
+
structured_output?: {
|
|
3960
|
+
[key: string]: unknown;
|
|
3961
|
+
} | null;
|
|
3962
|
+
user_notification_configs?: {
|
|
3963
|
+
[key: string]: unknown;
|
|
3964
|
+
} | null;
|
|
3965
|
+
/** @description Required for session auth. Optional for API keys. */
|
|
3966
|
+
organizationId?: string;
|
|
3967
|
+
};
|
|
3968
|
+
};
|
|
3969
|
+
};
|
|
3970
|
+
responses: {
|
|
3971
|
+
/** @description Success */
|
|
3972
|
+
200: {
|
|
3973
|
+
headers: {
|
|
3974
|
+
[name: string]: unknown;
|
|
3975
|
+
};
|
|
3976
|
+
content: {
|
|
3977
|
+
"application/json": {
|
|
3978
|
+
aop_id: string;
|
|
3979
|
+
/** @default updated */
|
|
3980
|
+
status: string;
|
|
3981
|
+
message?: string;
|
|
3982
|
+
};
|
|
3983
|
+
};
|
|
3984
|
+
};
|
|
3985
|
+
/** @description Invalid AOP configuration or request */
|
|
3986
|
+
400: {
|
|
3987
|
+
headers: {
|
|
3988
|
+
[name: string]: unknown;
|
|
3989
|
+
};
|
|
3990
|
+
content?: never;
|
|
3991
|
+
};
|
|
3992
|
+
/** @description Unauthorized */
|
|
3993
|
+
401: {
|
|
3994
|
+
headers: {
|
|
3995
|
+
[name: string]: unknown;
|
|
3996
|
+
};
|
|
3997
|
+
content?: never;
|
|
3998
|
+
};
|
|
3999
|
+
/** @description Insufficient AI credits */
|
|
4000
|
+
402: {
|
|
4001
|
+
headers: {
|
|
4002
|
+
[name: string]: unknown;
|
|
4003
|
+
};
|
|
4004
|
+
content?: never;
|
|
4005
|
+
};
|
|
4006
|
+
/** @description Forbidden. Missing OAuth scope. */
|
|
4007
|
+
403: {
|
|
4008
|
+
headers: {
|
|
4009
|
+
[name: string]: unknown;
|
|
4010
|
+
};
|
|
4011
|
+
content?: never;
|
|
4012
|
+
};
|
|
4013
|
+
/** @description AOP or thread not found */
|
|
4014
|
+
404: {
|
|
4015
|
+
headers: {
|
|
4016
|
+
[name: string]: unknown;
|
|
4017
|
+
};
|
|
4018
|
+
content?: never;
|
|
4019
|
+
};
|
|
4020
|
+
/** @description Internal server error */
|
|
4021
|
+
500: {
|
|
4022
|
+
headers: {
|
|
4023
|
+
[name: string]: unknown;
|
|
4024
|
+
};
|
|
4025
|
+
content?: never;
|
|
4026
|
+
};
|
|
4027
|
+
};
|
|
4028
|
+
};
|
|
4029
|
+
post_v1_aop_by_aopid_execute: {
|
|
4030
|
+
parameters: {
|
|
4031
|
+
query?: never;
|
|
4032
|
+
header?: never;
|
|
4033
|
+
path: {
|
|
4034
|
+
aopId: string;
|
|
4035
|
+
};
|
|
4036
|
+
cookie?: never;
|
|
4037
|
+
};
|
|
4038
|
+
requestBody?: {
|
|
4039
|
+
content: {
|
|
4040
|
+
/**
|
|
4041
|
+
* @example {
|
|
4042
|
+
* "user_inputs": {
|
|
4043
|
+
* "company": "Acme Corp",
|
|
4044
|
+
* "quarter": "Q1 2024"
|
|
4045
|
+
* }
|
|
4046
|
+
* }
|
|
4047
|
+
*/
|
|
4048
|
+
"application/json": {
|
|
4049
|
+
/**
|
|
4050
|
+
* @description Execute as a Test run: the agent uses its real prompt, config, and read-only tools, but side-effectful tool calls are captured instead of executed.
|
|
4051
|
+
* @default false
|
|
4052
|
+
*/
|
|
4053
|
+
dry_run?: boolean;
|
|
4054
|
+
/** @description Optional user inputs appended to the AOP prompt as key-value pairs. */
|
|
4055
|
+
user_inputs?: {
|
|
4056
|
+
[key: string]: string | number | boolean;
|
|
4057
|
+
} | null;
|
|
4058
|
+
/** @description Required for session auth. Optional for API keys. */
|
|
4059
|
+
organizationId?: string;
|
|
4060
|
+
};
|
|
4061
|
+
};
|
|
4062
|
+
};
|
|
4063
|
+
responses: {
|
|
4064
|
+
/** @description Success */
|
|
4065
|
+
200: {
|
|
4066
|
+
headers: {
|
|
4067
|
+
[name: string]: unknown;
|
|
4068
|
+
};
|
|
4069
|
+
content: {
|
|
4070
|
+
/**
|
|
4071
|
+
* @example {
|
|
4072
|
+
* "status": "started",
|
|
4073
|
+
* "thread_id": "agent-aop-run_1",
|
|
4074
|
+
* "trigger_type": "api",
|
|
4075
|
+
* "message": "Task execution started successfully. Use the thread_id to track progress.",
|
|
4076
|
+
* "aop_id": "aop_1",
|
|
4077
|
+
* "aop_title": "Market Research Report Generator",
|
|
4078
|
+
* "base_prompt": "Generate a comprehensive market research report",
|
|
4079
|
+
* "final_prompt": "Generate a comprehensive market research report\n\n--- User Inputs ---\ncompany: Acme Corp\n",
|
|
4080
|
+
* "aop_config": {
|
|
4081
|
+
* "agentId": "research"
|
|
4082
|
+
* }
|
|
4083
|
+
* }
|
|
4084
|
+
*/
|
|
4085
|
+
"application/json": {
|
|
4086
|
+
/** @example started */
|
|
4087
|
+
status: string;
|
|
4088
|
+
thread_id: string;
|
|
4089
|
+
/** @constant */
|
|
4090
|
+
trigger_type: "api";
|
|
4091
|
+
message?: string;
|
|
4092
|
+
aop_id: string;
|
|
4093
|
+
aop_title: string;
|
|
4094
|
+
base_prompt: string;
|
|
4095
|
+
final_prompt: string;
|
|
4096
|
+
aop_config: {
|
|
4097
|
+
[key: string]: unknown;
|
|
4098
|
+
};
|
|
4099
|
+
conversation?: {
|
|
4100
|
+
[key: string]: unknown;
|
|
4101
|
+
};
|
|
4102
|
+
};
|
|
4103
|
+
};
|
|
4104
|
+
};
|
|
4105
|
+
/** @description Invalid AOP configuration or request */
|
|
4106
|
+
400: {
|
|
4107
|
+
headers: {
|
|
4108
|
+
[name: string]: unknown;
|
|
4109
|
+
};
|
|
4110
|
+
content?: never;
|
|
4111
|
+
};
|
|
4112
|
+
/** @description Unauthorized */
|
|
4113
|
+
401: {
|
|
4114
|
+
headers: {
|
|
4115
|
+
[name: string]: unknown;
|
|
4116
|
+
};
|
|
4117
|
+
content?: never;
|
|
4118
|
+
};
|
|
4119
|
+
/** @description Insufficient AI credits */
|
|
4120
|
+
402: {
|
|
4121
|
+
headers: {
|
|
4122
|
+
[name: string]: unknown;
|
|
4123
|
+
};
|
|
4124
|
+
content?: never;
|
|
4125
|
+
};
|
|
4126
|
+
/** @description Forbidden. Missing OAuth scope. */
|
|
4127
|
+
403: {
|
|
4128
|
+
headers: {
|
|
4129
|
+
[name: string]: unknown;
|
|
4130
|
+
};
|
|
4131
|
+
content?: never;
|
|
4132
|
+
};
|
|
4133
|
+
/** @description AOP or thread not found */
|
|
4134
|
+
404: {
|
|
4135
|
+
headers: {
|
|
4136
|
+
[name: string]: unknown;
|
|
4137
|
+
};
|
|
4138
|
+
content?: never;
|
|
4139
|
+
};
|
|
4140
|
+
/** @description Internal server error */
|
|
4141
|
+
500: {
|
|
4142
|
+
headers: {
|
|
4143
|
+
[name: string]: unknown;
|
|
4144
|
+
};
|
|
4145
|
+
content?: never;
|
|
4146
|
+
};
|
|
4147
|
+
};
|
|
4148
|
+
};
|
|
4149
|
+
post_v1_aop_create: {
|
|
4150
|
+
parameters: {
|
|
4151
|
+
query?: never;
|
|
4152
|
+
header?: never;
|
|
4153
|
+
path?: never;
|
|
4154
|
+
cookie?: never;
|
|
4155
|
+
};
|
|
4156
|
+
requestBody: {
|
|
4157
|
+
content: {
|
|
4158
|
+
/**
|
|
4159
|
+
* @example {
|
|
4160
|
+
* "title": "Market Research Report",
|
|
4161
|
+
* "prompt": "Generate a comprehensive market research report for [[ company ]]",
|
|
4162
|
+
* "agentId": "research"
|
|
4163
|
+
* }
|
|
4164
|
+
*/
|
|
4165
|
+
"application/json": {
|
|
4166
|
+
title?: string | null;
|
|
4167
|
+
prompt?: string | null;
|
|
4168
|
+
description?: string | null;
|
|
4169
|
+
agentId?: string | null;
|
|
4170
|
+
agent_config?: {
|
|
4171
|
+
[key: string]: unknown;
|
|
4172
|
+
} | null;
|
|
4173
|
+
icon?: string | null;
|
|
4174
|
+
section?: string | null;
|
|
4175
|
+
structured_output?: {
|
|
4176
|
+
[key: string]: unknown;
|
|
4177
|
+
} | null;
|
|
4178
|
+
user_notification_configs?: {
|
|
4179
|
+
[key: string]: unknown;
|
|
4180
|
+
} | null;
|
|
4181
|
+
/** @description Optional workstream ID. */
|
|
4182
|
+
parent_folder_id?: string | null;
|
|
4183
|
+
/** @description Required for session auth. Optional for API keys. */
|
|
4184
|
+
organizationId?: string;
|
|
4185
|
+
};
|
|
4186
|
+
};
|
|
4187
|
+
};
|
|
4188
|
+
responses: {
|
|
4189
|
+
/** @description Success */
|
|
4190
|
+
200: {
|
|
4191
|
+
headers: {
|
|
4192
|
+
[name: string]: unknown;
|
|
4193
|
+
};
|
|
4194
|
+
content: {
|
|
4195
|
+
"application/json": {
|
|
4196
|
+
aop_id: string;
|
|
4197
|
+
title: string;
|
|
4198
|
+
/** @default created */
|
|
4199
|
+
status: string;
|
|
4200
|
+
message?: string;
|
|
4201
|
+
parent_folder_id?: string | null;
|
|
4202
|
+
};
|
|
4203
|
+
};
|
|
4204
|
+
};
|
|
4205
|
+
/** @description Invalid AOP configuration or request */
|
|
4206
|
+
400: {
|
|
4207
|
+
headers: {
|
|
4208
|
+
[name: string]: unknown;
|
|
4209
|
+
};
|
|
4210
|
+
content?: never;
|
|
4211
|
+
};
|
|
4212
|
+
/** @description Unauthorized */
|
|
4213
|
+
401: {
|
|
4214
|
+
headers: {
|
|
4215
|
+
[name: string]: unknown;
|
|
4216
|
+
};
|
|
4217
|
+
content?: never;
|
|
4218
|
+
};
|
|
4219
|
+
/** @description Insufficient AI credits */
|
|
4220
|
+
402: {
|
|
4221
|
+
headers: {
|
|
4222
|
+
[name: string]: unknown;
|
|
4223
|
+
};
|
|
4224
|
+
content?: never;
|
|
4225
|
+
};
|
|
4226
|
+
/** @description Forbidden. Missing OAuth scope. */
|
|
4227
|
+
403: {
|
|
4228
|
+
headers: {
|
|
4229
|
+
[name: string]: unknown;
|
|
4230
|
+
};
|
|
4231
|
+
content?: never;
|
|
4232
|
+
};
|
|
4233
|
+
/** @description AOP or thread not found */
|
|
4234
|
+
404: {
|
|
4235
|
+
headers: {
|
|
4236
|
+
[name: string]: unknown;
|
|
4237
|
+
};
|
|
4238
|
+
content?: never;
|
|
4239
|
+
};
|
|
4240
|
+
/** @description Internal server error */
|
|
4241
|
+
500: {
|
|
4242
|
+
headers: {
|
|
4243
|
+
[name: string]: unknown;
|
|
4244
|
+
};
|
|
4245
|
+
content?: never;
|
|
4246
|
+
};
|
|
4247
|
+
};
|
|
4248
|
+
};
|
|
4249
|
+
post_v1_aop_retry: {
|
|
4250
|
+
parameters: {
|
|
4251
|
+
query?: never;
|
|
4252
|
+
header?: never;
|
|
4253
|
+
path?: never;
|
|
4254
|
+
cookie?: never;
|
|
4255
|
+
};
|
|
4256
|
+
requestBody: {
|
|
4257
|
+
content: {
|
|
4258
|
+
"application/json": {
|
|
4259
|
+
/** @description Thread ID of the failed AOP execution to retry. */
|
|
4260
|
+
thread_id: string;
|
|
4261
|
+
/** @description Optional user inputs appended to the AOP prompt as key-value pairs. */
|
|
4262
|
+
user_inputs?: {
|
|
4263
|
+
[key: string]: string | number | boolean;
|
|
4264
|
+
} | null;
|
|
4265
|
+
/** @description Required for session auth. Optional for API keys. */
|
|
4266
|
+
organizationId?: string;
|
|
4267
|
+
};
|
|
4268
|
+
};
|
|
4269
|
+
};
|
|
4270
|
+
responses: {
|
|
4271
|
+
/** @description Success */
|
|
4272
|
+
200: {
|
|
4273
|
+
headers: {
|
|
4274
|
+
[name: string]: unknown;
|
|
4275
|
+
};
|
|
4276
|
+
content: {
|
|
4277
|
+
"application/json": {
|
|
4278
|
+
/** @constant */
|
|
4279
|
+
status: "started";
|
|
4280
|
+
new_thread_id: string;
|
|
4281
|
+
message: string;
|
|
4282
|
+
};
|
|
4283
|
+
};
|
|
4284
|
+
};
|
|
4285
|
+
/** @description Invalid AOP configuration or request */
|
|
4286
|
+
400: {
|
|
4287
|
+
headers: {
|
|
4288
|
+
[name: string]: unknown;
|
|
4289
|
+
};
|
|
4290
|
+
content?: never;
|
|
4291
|
+
};
|
|
4292
|
+
/** @description Unauthorized */
|
|
4293
|
+
401: {
|
|
4294
|
+
headers: {
|
|
4295
|
+
[name: string]: unknown;
|
|
4296
|
+
};
|
|
4297
|
+
content?: never;
|
|
4298
|
+
};
|
|
4299
|
+
/** @description Insufficient AI credits */
|
|
4300
|
+
402: {
|
|
4301
|
+
headers: {
|
|
4302
|
+
[name: string]: unknown;
|
|
4303
|
+
};
|
|
4304
|
+
content?: never;
|
|
4305
|
+
};
|
|
4306
|
+
/** @description Forbidden. Missing OAuth scope. */
|
|
4307
|
+
403: {
|
|
4308
|
+
headers: {
|
|
4309
|
+
[name: string]: unknown;
|
|
4310
|
+
};
|
|
4311
|
+
content?: never;
|
|
4312
|
+
};
|
|
4313
|
+
/** @description AOP or thread not found */
|
|
4314
|
+
404: {
|
|
4315
|
+
headers: {
|
|
4316
|
+
[name: string]: unknown;
|
|
4317
|
+
};
|
|
4318
|
+
content?: never;
|
|
4319
|
+
};
|
|
4320
|
+
/** @description Internal server error */
|
|
4321
|
+
500: {
|
|
4322
|
+
headers: {
|
|
4323
|
+
[name: string]: unknown;
|
|
4324
|
+
};
|
|
4325
|
+
content?: never;
|
|
4326
|
+
};
|
|
4327
|
+
};
|
|
4328
|
+
};
|
|
4329
|
+
get_v1_campaigns: {
|
|
4330
|
+
parameters: {
|
|
4331
|
+
query?: {
|
|
4332
|
+
/** @description Optional organization scope for session-authenticated calls. OAuth client credentials resolve the organization from the token. */
|
|
4333
|
+
organizationId?: string;
|
|
4334
|
+
/** @description Search campaign name. */
|
|
4335
|
+
q?: string;
|
|
4336
|
+
/** @description `all` lists draft and running campaigns. Any other value lists that stage only. */
|
|
4337
|
+
stage?:
|
|
4338
|
+
| "all"
|
|
4339
|
+
| "draft"
|
|
4340
|
+
| "approved"
|
|
4341
|
+
| "running"
|
|
4342
|
+
| "ending"
|
|
4343
|
+
| "completed"
|
|
4344
|
+
| "archived";
|
|
4345
|
+
offset?: number;
|
|
4346
|
+
limit?: number;
|
|
4347
|
+
};
|
|
4348
|
+
header?: never;
|
|
4349
|
+
path?: never;
|
|
4350
|
+
cookie?: never;
|
|
4351
|
+
};
|
|
4352
|
+
requestBody?: never;
|
|
4353
|
+
responses: {
|
|
4354
|
+
/** @description Campaign page and stage summary. */
|
|
4355
|
+
200: {
|
|
4356
|
+
headers: {
|
|
4357
|
+
[name: string]: unknown;
|
|
4358
|
+
};
|
|
4359
|
+
content: {
|
|
4360
|
+
"application/json": {
|
|
4361
|
+
campaigns: {
|
|
4362
|
+
id: string;
|
|
4363
|
+
organizationId: string;
|
|
4364
|
+
revision: number;
|
|
4365
|
+
/** @enum {string} */
|
|
4366
|
+
stage:
|
|
4367
|
+
| "draft"
|
|
4368
|
+
| "approved"
|
|
4369
|
+
| "running"
|
|
4370
|
+
| "ending"
|
|
4371
|
+
| "completed"
|
|
4372
|
+
| "archived";
|
|
4373
|
+
approval: {
|
|
4374
|
+
revision: number;
|
|
4375
|
+
userId: string;
|
|
4376
|
+
approvedAt: string;
|
|
4377
|
+
} | null;
|
|
4378
|
+
runId: string | null;
|
|
4379
|
+
startedAt: string | null;
|
|
4380
|
+
endedAt: string | null;
|
|
4381
|
+
createdAt: string;
|
|
4382
|
+
updatedAt: string;
|
|
4383
|
+
name: string;
|
|
4384
|
+
brand: string;
|
|
4385
|
+
storeCount: number;
|
|
4386
|
+
windowCount: number;
|
|
4387
|
+
offerCount: number;
|
|
4388
|
+
cleanupFailed?: boolean;
|
|
4389
|
+
}[];
|
|
4390
|
+
total: number;
|
|
4391
|
+
hasMore: boolean;
|
|
4392
|
+
nextOffset: number;
|
|
4393
|
+
summary: {
|
|
4394
|
+
/** @description Draft and running campaigns matching `q`. */
|
|
4395
|
+
totalCount: number;
|
|
4396
|
+
stageCounts: {
|
|
4397
|
+
[key: string]: number;
|
|
4398
|
+
};
|
|
4399
|
+
};
|
|
4400
|
+
pagination: {
|
|
4401
|
+
offset: number;
|
|
4402
|
+
limit: number;
|
|
4403
|
+
total: number;
|
|
4404
|
+
hasMore: boolean;
|
|
4405
|
+
nextOffset: number | null;
|
|
4406
|
+
maxLimit: number;
|
|
4407
|
+
defaultLimit: number;
|
|
4408
|
+
};
|
|
4409
|
+
};
|
|
4410
|
+
};
|
|
4411
|
+
};
|
|
4412
|
+
/** @description Invalid campaign payload or plan state. */
|
|
4413
|
+
400: {
|
|
4414
|
+
headers: {
|
|
4415
|
+
[name: string]: unknown;
|
|
4416
|
+
};
|
|
4417
|
+
content?: never;
|
|
4418
|
+
};
|
|
4419
|
+
/** @description Unauthorized */
|
|
4420
|
+
401: {
|
|
4421
|
+
headers: {
|
|
4422
|
+
[name: string]: unknown;
|
|
4423
|
+
};
|
|
4424
|
+
content?: never;
|
|
4425
|
+
};
|
|
4426
|
+
/** @description Forbidden: missing `promotions:read` scope, or a session member without organization-wide access */
|
|
4427
|
+
403: {
|
|
4428
|
+
headers: {
|
|
4429
|
+
[name: string]: unknown;
|
|
4430
|
+
};
|
|
4431
|
+
content?: never;
|
|
4432
|
+
};
|
|
4433
|
+
/** @description Rate limit exceeded */
|
|
4434
|
+
429: {
|
|
4435
|
+
headers: {
|
|
4436
|
+
[name: string]: unknown;
|
|
4437
|
+
};
|
|
4438
|
+
content?: never;
|
|
4439
|
+
};
|
|
4440
|
+
/** @description Internal Server Error */
|
|
4441
|
+
500: {
|
|
4442
|
+
headers: {
|
|
4443
|
+
[name: string]: unknown;
|
|
4444
|
+
};
|
|
4445
|
+
content?: never;
|
|
4446
|
+
};
|
|
4447
|
+
};
|
|
4448
|
+
};
|
|
4449
|
+
post_v1_campaigns: {
|
|
4450
|
+
parameters: {
|
|
4451
|
+
query?: never;
|
|
4452
|
+
header?: never;
|
|
4453
|
+
path?: never;
|
|
4454
|
+
cookie?: never;
|
|
4455
|
+
};
|
|
4456
|
+
requestBody: {
|
|
4457
|
+
content: {
|
|
4458
|
+
"application/json": {
|
|
4459
|
+
/** @description Required for session auth. Optional for an API key, which already identifies the organization. */
|
|
4460
|
+
organizationId?: string;
|
|
4461
|
+
plan: {
|
|
4462
|
+
brief: {
|
|
4463
|
+
name: string;
|
|
4464
|
+
/** @default */
|
|
4465
|
+
objective?: string;
|
|
4466
|
+
/** @default */
|
|
4467
|
+
brand?: string;
|
|
4468
|
+
ownerId: string;
|
|
4469
|
+
approverId: string;
|
|
4470
|
+
timezone: string;
|
|
4471
|
+
/** @default [] */
|
|
4472
|
+
stores?: {
|
|
4473
|
+
/** @enum {string} */
|
|
4474
|
+
marketplace:
|
|
4475
|
+
| "shopee"
|
|
4476
|
+
| "lazada"
|
|
4477
|
+
| "tiktok"
|
|
4478
|
+
| "shopify"
|
|
4479
|
+
| "whatsapp"
|
|
4480
|
+
| "zalora"
|
|
4481
|
+
| "amazon"
|
|
4482
|
+
| "ebay";
|
|
4483
|
+
country: string;
|
|
4484
|
+
storeId: string;
|
|
4485
|
+
}[];
|
|
4486
|
+
/** @default */
|
|
4487
|
+
serviceRequest?: string;
|
|
4488
|
+
/**
|
|
4489
|
+
* @default standard
|
|
4490
|
+
* @enum {string}
|
|
4491
|
+
*/
|
|
4492
|
+
priority?: "standard" | "priority" | "super_priority";
|
|
4493
|
+
/** @default [] */
|
|
4494
|
+
documentIds?: string[];
|
|
4495
|
+
/** @default null */
|
|
4496
|
+
reviewDueAt?: string | null;
|
|
4497
|
+
sourceCurrency?: string;
|
|
4498
|
+
/** @enum {string} */
|
|
4499
|
+
sourceMarketplace?:
|
|
4500
|
+
| "shopee"
|
|
4501
|
+
| "lazada"
|
|
4502
|
+
| "tiktok"
|
|
4503
|
+
| "shopify"
|
|
4504
|
+
| "whatsapp"
|
|
4505
|
+
| "zalora"
|
|
4506
|
+
| "amazon"
|
|
4507
|
+
| "ebay";
|
|
4508
|
+
sourceCountry?: string;
|
|
4509
|
+
/** @default */
|
|
4510
|
+
cleanupNotes?: string;
|
|
4511
|
+
};
|
|
4512
|
+
/** @default [] */
|
|
4513
|
+
windows?: {
|
|
4514
|
+
id: string;
|
|
4515
|
+
name: string;
|
|
4516
|
+
/**
|
|
4517
|
+
* @description Preparation time: publish promotions with the future live start/end. Must be at or before startsAt.
|
|
4518
|
+
* @default null
|
|
4519
|
+
*/
|
|
4520
|
+
preparesAt?: string | null;
|
|
4521
|
+
startsAt: string | null;
|
|
4522
|
+
endsAt: string | null;
|
|
4523
|
+
/** @default */
|
|
4524
|
+
reviewNotes?: string;
|
|
4525
|
+
}[];
|
|
4526
|
+
offers?: {
|
|
4527
|
+
id: string;
|
|
4528
|
+
windowId: string;
|
|
4529
|
+
/**
|
|
4530
|
+
* Format: uuid
|
|
4531
|
+
* @description Existing draft promotion attached to this window; the campaign controls its live dates.
|
|
4532
|
+
*/
|
|
4533
|
+
promotionId?: string;
|
|
4534
|
+
promotion: {
|
|
4535
|
+
name?: string;
|
|
4536
|
+
description?: string | null;
|
|
4537
|
+
/**
|
|
4538
|
+
* @description Canonical OmniCommerce promotion mechanic: product discount, flash sale, voucher, gift with purchase, Buy-X-Get-Y, bundle deal, or Lazada-only free shipping and early bird price.
|
|
4539
|
+
* @enum {string}
|
|
4540
|
+
*/
|
|
4541
|
+
kind?:
|
|
4542
|
+
| "product_discount"
|
|
4543
|
+
| "flash_sale"
|
|
4544
|
+
| "voucher"
|
|
4545
|
+
| "gift_with_purchase"
|
|
4546
|
+
| "buy_x_get_y"
|
|
4547
|
+
| "bundle_deal"
|
|
4548
|
+
| "free_shipping"
|
|
4549
|
+
| "early_bird_price";
|
|
4550
|
+
salesChannels?: ("pdp" | "live")[];
|
|
4551
|
+
/** @enum {string} */
|
|
4552
|
+
discountType?: "percentage" | "fixed_amount";
|
|
4553
|
+
discountValue?: number;
|
|
4554
|
+
/** @description Patch discount terms for exact target store keys; unnamed stores remain unchanged. Null discountValue restores shared campaign terms for that store. */
|
|
4555
|
+
storeDiscounts?: {
|
|
4556
|
+
storeKey: string;
|
|
4557
|
+
/** @enum {string} */
|
|
4558
|
+
discountType: "percentage" | "fixed_amount";
|
|
4559
|
+
discountValue: number | null;
|
|
4560
|
+
}[];
|
|
4561
|
+
/** @description Up to 100 connected stores for create (required) or update. Copy marketplace, country, and storeId from get_promotions targetStores or find_products marketplaceDetails. Do not concatenate a storeKeys string. */
|
|
4562
|
+
targetStores?: {
|
|
4563
|
+
/** @enum {string} */
|
|
4564
|
+
marketplace:
|
|
4565
|
+
| "lazada"
|
|
4566
|
+
| "shopee"
|
|
4567
|
+
| "tiktok"
|
|
4568
|
+
| "shopify"
|
|
4569
|
+
| "amazon"
|
|
4570
|
+
| "zalora"
|
|
4571
|
+
| "ebay";
|
|
4572
|
+
country: string;
|
|
4573
|
+
storeId: string;
|
|
4574
|
+
}[];
|
|
4575
|
+
minSalePrice?: number | null;
|
|
4576
|
+
maxDiscountAmount?: number | null;
|
|
4577
|
+
minSpend?: number | null;
|
|
4578
|
+
voucherCode?: string | null;
|
|
4579
|
+
claimStartsAt?: string | null;
|
|
4580
|
+
totalUsageLimit?: number | null;
|
|
4581
|
+
perBuyerLimit?: number | null;
|
|
4582
|
+
mechanicConfig?: {
|
|
4583
|
+
/** @description Voucher subtype from get_promotions capabilities.voucherTypes. Browser AOP types (delivery=browser_aop) are writable Seller Center vouchers. Omit browserAutomation.aopId to use the built-in marketplace AOP. */
|
|
4584
|
+
voucherType?:
|
|
4585
|
+
| (
|
|
4586
|
+
| "shopee_shop"
|
|
4587
|
+
| "shopee_product"
|
|
4588
|
+
| "shopee_private"
|
|
4589
|
+
| "shopee_live"
|
|
4590
|
+
| "shopee_video"
|
|
4591
|
+
| "shopee_new_buyer"
|
|
4592
|
+
| "shopee_repeat_buyer"
|
|
4593
|
+
| "shopee_follow_prize"
|
|
4594
|
+
| "shopee_exclusive_streamer"
|
|
4595
|
+
| "shopee_welcome"
|
|
4596
|
+
| "shopee_member_repeat_buyer"
|
|
4597
|
+
| "shopee_exclusive"
|
|
4598
|
+
| "shopee_redemption"
|
|
4599
|
+
| "shopee_exclusive_creator"
|
|
4600
|
+
| "lazada_store_follower"
|
|
4601
|
+
| "lazada_regular"
|
|
4602
|
+
| "lazada_store_new_buyer"
|
|
4603
|
+
| "lazada_live"
|
|
4604
|
+
| "lazada_offline"
|
|
4605
|
+
| "lazada_co_funded"
|
|
4606
|
+
| "lazada_welcome"
|
|
4607
|
+
| "lazada_linked_member"
|
|
4608
|
+
| "lazada_new_member"
|
|
4609
|
+
| "lazada_member_exclusive"
|
|
4610
|
+
| "lazada_points_redeemable"
|
|
4611
|
+
| "tiktok_seller_coupon"
|
|
4612
|
+
| "shopify_discount_code"
|
|
4613
|
+
| "amazon_promotion_code"
|
|
4614
|
+
| "zalora_seller_voucher"
|
|
4615
|
+
| "ebay_coded_coupon"
|
|
4616
|
+
)
|
|
4617
|
+
| null;
|
|
4618
|
+
browserAutomation?: {
|
|
4619
|
+
aopId?: string;
|
|
4620
|
+
variableValues?: {
|
|
4621
|
+
[key: string]: string;
|
|
4622
|
+
};
|
|
4623
|
+
instructions?: string;
|
|
4624
|
+
} | null;
|
|
4625
|
+
/**
|
|
4626
|
+
* @description shop = all products, products = selected assigned products. Repeat Buyer defaults to shop.
|
|
4627
|
+
* @enum {string}
|
|
4628
|
+
*/
|
|
4629
|
+
voucherScope?: "products" | "shop";
|
|
4630
|
+
/**
|
|
4631
|
+
* @description Seller Center reward type. coins_cashback is a percentage greater than 3 and does not reduce salePrice.
|
|
4632
|
+
* @enum {string}
|
|
4633
|
+
*/
|
|
4634
|
+
voucherReward?: "discount" | "coins_cashback";
|
|
4635
|
+
/** @enum {string} */
|
|
4636
|
+
voucherAudience?: "general" | "shop_follow";
|
|
4637
|
+
/** @description Shopee Repeat Buyer: minimum completed shop orders, 1 or 2. Required for shopee_repeat_buyer. */
|
|
4638
|
+
repeatPurchaseMinCount?: number;
|
|
4639
|
+
/** @description Shopee Repeat Buyer: lookback window in days, one of 30, 90, 180 or 365. Required for shopee_repeat_buyer. */
|
|
4640
|
+
repeatPurchaseLookbackDays?: number;
|
|
4641
|
+
/** @description Shopee Smart Voucher toggle. Used by New Buyer and similar portal types. */
|
|
4642
|
+
smartVoucher?: boolean;
|
|
4643
|
+
/** @description Shopee Follow Prize: days after claim until expiry. Seller Center is 7. */
|
|
4644
|
+
followPrizeExpiryDays?: number;
|
|
4645
|
+
/**
|
|
4646
|
+
* @description Shopee Video display: shopee_video = all Shopee Video; creator_video = targeted creator videos only.
|
|
4647
|
+
* @enum {string}
|
|
4648
|
+
*/
|
|
4649
|
+
videoDisplayMode?: "shopee_video" | "creator_video";
|
|
4650
|
+
/** @description Exclusive Creator Voucher: up to 15 Shopee usernames. */
|
|
4651
|
+
exclusiveCreatorUsernames?: string[];
|
|
4652
|
+
/** @description Exclusive Streamer Voucher: up to 15 Shopee usernames. */
|
|
4653
|
+
exclusiveStreamerUsernames?: string[];
|
|
4654
|
+
/** @description Shopee display setting. ["all"] = display on all pages; [] = hidden/share by code. */
|
|
4655
|
+
voucherDisplayChannels?: (
|
|
4656
|
+
| "all"
|
|
4657
|
+
| "feed"
|
|
4658
|
+
| "live"
|
|
4659
|
+
| "order_page"
|
|
4660
|
+
| "followers"
|
|
4661
|
+
| "offline"
|
|
4662
|
+
)[];
|
|
4663
|
+
/** @enum {string} */
|
|
4664
|
+
bundlePriceType?: "discount" | "fixed_price";
|
|
4665
|
+
bundleTiers?: {
|
|
4666
|
+
minimumQuantity: number;
|
|
4667
|
+
discountValue: number;
|
|
4668
|
+
}[];
|
|
4669
|
+
/** @enum {string} */
|
|
4670
|
+
thresholdType?: "item_quantity" | "order_amount";
|
|
4671
|
+
thresholdValue?: number;
|
|
4672
|
+
/** @enum {string} */
|
|
4673
|
+
giftType?: "gift" | "sample";
|
|
4674
|
+
giftQuantity?: number;
|
|
4675
|
+
gifts?: {
|
|
4676
|
+
/** Format: uuid */
|
|
4677
|
+
productId: string;
|
|
4678
|
+
variantId?: string | null;
|
|
4679
|
+
totalClaimLimit: number;
|
|
4680
|
+
}[];
|
|
4681
|
+
buyQuantity?: number;
|
|
4682
|
+
getQuantity?: number;
|
|
4683
|
+
benefitProductIds?: string[];
|
|
4684
|
+
/** @enum {string} */
|
|
4685
|
+
benefitType?: "free" | "percentage" | "fixed_amount";
|
|
4686
|
+
benefitValue?: number;
|
|
4687
|
+
maxApplicationsPerOrder?: number;
|
|
4688
|
+
bundleMinimumQuantity?: number;
|
|
4689
|
+
/** @description Free shipping delivery option. Lazada: STANDARD (default), ECONOMY, EXPRESS, SELLER_OWN_FLEET or P2P, as offered by the store. */
|
|
4690
|
+
shippingDeliveryOption?: string;
|
|
4691
|
+
/** @description Free shipping: total shipping subsidy budget in the store currency. Omit for an unlimited budget. */
|
|
4692
|
+
shippingBudget?: number;
|
|
4693
|
+
};
|
|
4694
|
+
};
|
|
4695
|
+
/** @default [] */
|
|
4696
|
+
productIds?: string[];
|
|
4697
|
+
/** @default */
|
|
4698
|
+
reviewNotes?: string;
|
|
4699
|
+
/** @default */
|
|
4700
|
+
excludedReason?: string;
|
|
4701
|
+
source?: {
|
|
4702
|
+
sheet: string;
|
|
4703
|
+
rows: number[];
|
|
4704
|
+
headers: string[];
|
|
4705
|
+
values: string[][];
|
|
4706
|
+
};
|
|
4707
|
+
}[];
|
|
4708
|
+
};
|
|
4709
|
+
};
|
|
4710
|
+
};
|
|
4711
|
+
};
|
|
4712
|
+
responses: {
|
|
4713
|
+
/** @description Campaign detail: plan, revision, executions, audit, schedule, and progress. */
|
|
4714
|
+
201: {
|
|
4715
|
+
headers: {
|
|
4716
|
+
[name: string]: unknown;
|
|
4717
|
+
};
|
|
4718
|
+
content: {
|
|
4719
|
+
"application/json": {
|
|
4720
|
+
campaign: {
|
|
4721
|
+
id: string;
|
|
4722
|
+
organizationId: string;
|
|
4723
|
+
revision: number;
|
|
4724
|
+
/** @enum {string} */
|
|
4725
|
+
stage:
|
|
4726
|
+
| "draft"
|
|
4727
|
+
| "approved"
|
|
4728
|
+
| "running"
|
|
4729
|
+
| "ending"
|
|
4730
|
+
| "completed"
|
|
4731
|
+
| "archived";
|
|
4732
|
+
approval: {
|
|
4733
|
+
revision: number;
|
|
4734
|
+
userId: string;
|
|
4735
|
+
approvedAt: string;
|
|
4736
|
+
} | null;
|
|
4737
|
+
runId: string | null;
|
|
4738
|
+
startedAt: string | null;
|
|
4739
|
+
endedAt: string | null;
|
|
4740
|
+
createdAt: string;
|
|
4741
|
+
updatedAt: string;
|
|
4742
|
+
plan: components["schemas"]["CampaignPlan"];
|
|
4743
|
+
/** @description A running campaign's proposed plan, applied only when the approver approves it. */
|
|
4744
|
+
pendingChange: {
|
|
4745
|
+
version: number;
|
|
4746
|
+
plan: components["schemas"]["CampaignPlan"];
|
|
4747
|
+
proposedBy: string;
|
|
4748
|
+
proposedAt: string;
|
|
4749
|
+
} | null;
|
|
4750
|
+
};
|
|
4751
|
+
executions: {
|
|
4752
|
+
offerId: string;
|
|
4753
|
+
windowId: string;
|
|
4754
|
+
promotionId: string | null;
|
|
4755
|
+
/** @enum {string} */
|
|
4756
|
+
state:
|
|
4757
|
+
| "draft"
|
|
4758
|
+
| "activating"
|
|
4759
|
+
| "prepared"
|
|
4760
|
+
| "active"
|
|
4761
|
+
| "ending"
|
|
4762
|
+
| "ended"
|
|
4763
|
+
| "failed";
|
|
4764
|
+
error: string | null;
|
|
4765
|
+
evidence: unknown;
|
|
4766
|
+
termsRevision: number | null;
|
|
4767
|
+
}[];
|
|
4768
|
+
audit: {
|
|
4769
|
+
id: string;
|
|
4770
|
+
action: string;
|
|
4771
|
+
actorId: string | null;
|
|
4772
|
+
actorName: string | null;
|
|
4773
|
+
createdAt: string;
|
|
4774
|
+
details: {
|
|
4775
|
+
[key: string]: unknown;
|
|
4776
|
+
};
|
|
4777
|
+
summary?: string;
|
|
4778
|
+
items?: {
|
|
4779
|
+
/** @enum {string} */
|
|
4780
|
+
kind: "brief" | "window" | "offer";
|
|
4781
|
+
/** @enum {string} */
|
|
4782
|
+
action: "add" | "update" | "remove";
|
|
4783
|
+
id: string;
|
|
4784
|
+
name: string;
|
|
4785
|
+
changes: {
|
|
4786
|
+
field: string;
|
|
4787
|
+
label: string;
|
|
4788
|
+
from: string | null;
|
|
4789
|
+
to: string | null;
|
|
4790
|
+
}[];
|
|
4791
|
+
}[];
|
|
4792
|
+
hiddenCount?: number;
|
|
4793
|
+
}[];
|
|
4794
|
+
/** @description Issues that block approving or running the current plan. */
|
|
4795
|
+
readiness: string[];
|
|
4796
|
+
/** @description Issues that block approving the proposed live change. */
|
|
4797
|
+
pendingChangeIssues: string[];
|
|
4798
|
+
pendingScheduleCount: number;
|
|
4799
|
+
failedScheduleCount: number;
|
|
4800
|
+
waitingBrowserJobCount: number;
|
|
4801
|
+
scheduleIssues?: {
|
|
4802
|
+
windowId: string;
|
|
4803
|
+
/** @enum {string} */
|
|
4804
|
+
phase: "prepare" | "live";
|
|
4805
|
+
/** @enum {string} */
|
|
4806
|
+
kind: "overdue" | "missed";
|
|
4807
|
+
}[];
|
|
4808
|
+
recovery?: {
|
|
4809
|
+
windowId: string;
|
|
4810
|
+
/** @enum {string} */
|
|
4811
|
+
phase: "prepare" | "live" | "start" | "end" | "revise";
|
|
4812
|
+
state: string;
|
|
4813
|
+
attempt: number;
|
|
4814
|
+
nextRetryAt: string;
|
|
4815
|
+
error: string | null;
|
|
4816
|
+
}[];
|
|
4817
|
+
cleanupFailed?: boolean;
|
|
4818
|
+
progress?: {
|
|
4819
|
+
asOf: string;
|
|
4820
|
+
title: string;
|
|
4821
|
+
description: string;
|
|
4822
|
+
total: number;
|
|
4823
|
+
counts: {
|
|
4824
|
+
waiting: number;
|
|
4825
|
+
preparing: number;
|
|
4826
|
+
prepared: number;
|
|
4827
|
+
live: number;
|
|
4828
|
+
ending: number;
|
|
4829
|
+
ended: number;
|
|
4830
|
+
cancelled: number;
|
|
4831
|
+
failed: number;
|
|
4832
|
+
};
|
|
4833
|
+
issues: {
|
|
4834
|
+
offerId: string;
|
|
4835
|
+
name: string;
|
|
4836
|
+
error: string;
|
|
4837
|
+
}[];
|
|
4838
|
+
scheduleIssues: {
|
|
4839
|
+
windowId: string;
|
|
4840
|
+
/** @enum {string} */
|
|
4841
|
+
phase: "prepare" | "live";
|
|
4842
|
+
/** @enum {string} */
|
|
4843
|
+
kind: "overdue" | "missed";
|
|
4844
|
+
name: string;
|
|
4845
|
+
message: string;
|
|
4846
|
+
}[];
|
|
4847
|
+
blockers: string[];
|
|
4848
|
+
nextWindow: {
|
|
4849
|
+
id: string;
|
|
4850
|
+
name: string;
|
|
4851
|
+
preparesAt: string | null;
|
|
4852
|
+
startsAt: string | null;
|
|
4853
|
+
endsAt: string | null;
|
|
4854
|
+
} | null;
|
|
4855
|
+
};
|
|
4856
|
+
};
|
|
4857
|
+
};
|
|
4858
|
+
};
|
|
4859
|
+
/** @description Invalid campaign payload or plan state. */
|
|
4860
|
+
400: {
|
|
4861
|
+
headers: {
|
|
4862
|
+
[name: string]: unknown;
|
|
4863
|
+
};
|
|
4864
|
+
content?: never;
|
|
4865
|
+
};
|
|
4866
|
+
/** @description Unauthorized */
|
|
4867
|
+
401: {
|
|
4868
|
+
headers: {
|
|
4869
|
+
[name: string]: unknown;
|
|
4870
|
+
};
|
|
4871
|
+
content?: never;
|
|
4872
|
+
};
|
|
4873
|
+
/** @description Forbidden: missing `promotions:write` scope, or a session member without organization-wide access */
|
|
4874
|
+
403: {
|
|
4875
|
+
headers: {
|
|
4876
|
+
[name: string]: unknown;
|
|
4877
|
+
};
|
|
4878
|
+
content?: never;
|
|
4879
|
+
};
|
|
4880
|
+
/** @description Rate limit exceeded */
|
|
4881
|
+
429: {
|
|
4882
|
+
headers: {
|
|
4883
|
+
[name: string]: unknown;
|
|
4884
|
+
};
|
|
4885
|
+
content?: never;
|
|
4886
|
+
};
|
|
4887
|
+
/** @description Internal Server Error */
|
|
4888
|
+
500: {
|
|
4889
|
+
headers: {
|
|
4890
|
+
[name: string]: unknown;
|
|
4891
|
+
};
|
|
4892
|
+
content?: never;
|
|
4893
|
+
};
|
|
4894
|
+
};
|
|
4895
|
+
};
|
|
4896
|
+
get_v1_campaigns_by_campaignid: {
|
|
4897
|
+
parameters: {
|
|
4898
|
+
query?: {
|
|
4899
|
+
/** @description Optional organization scope for session-authenticated calls. OAuth client credentials resolve the organization from the token. */
|
|
4900
|
+
organizationId?: string;
|
|
4901
|
+
};
|
|
4902
|
+
header?: never;
|
|
4903
|
+
path: {
|
|
4904
|
+
campaignId: string;
|
|
4905
|
+
};
|
|
4906
|
+
cookie?: never;
|
|
4907
|
+
};
|
|
4908
|
+
requestBody?: never;
|
|
4909
|
+
responses: {
|
|
4910
|
+
/** @description Campaign detail: plan, revision, executions, audit, schedule, and progress. */
|
|
4911
|
+
200: {
|
|
4912
|
+
headers: {
|
|
4913
|
+
[name: string]: unknown;
|
|
4914
|
+
};
|
|
4915
|
+
content: {
|
|
4916
|
+
"application/json": {
|
|
4917
|
+
campaign: {
|
|
4918
|
+
id: string;
|
|
4919
|
+
organizationId: string;
|
|
4920
|
+
revision: number;
|
|
4921
|
+
/** @enum {string} */
|
|
4922
|
+
stage:
|
|
4923
|
+
| "draft"
|
|
4924
|
+
| "approved"
|
|
4925
|
+
| "running"
|
|
4926
|
+
| "ending"
|
|
4927
|
+
| "completed"
|
|
4928
|
+
| "archived";
|
|
4929
|
+
approval: {
|
|
4930
|
+
revision: number;
|
|
4931
|
+
userId: string;
|
|
4932
|
+
approvedAt: string;
|
|
4933
|
+
} | null;
|
|
4934
|
+
runId: string | null;
|
|
4935
|
+
startedAt: string | null;
|
|
4936
|
+
endedAt: string | null;
|
|
4937
|
+
createdAt: string;
|
|
4938
|
+
updatedAt: string;
|
|
4939
|
+
plan: components["schemas"]["CampaignPlan"];
|
|
4940
|
+
/** @description A running campaign's proposed plan, applied only when the approver approves it. */
|
|
4941
|
+
pendingChange: {
|
|
4942
|
+
version: number;
|
|
4943
|
+
plan: components["schemas"]["CampaignPlan"];
|
|
4944
|
+
proposedBy: string;
|
|
4945
|
+
proposedAt: string;
|
|
4946
|
+
} | null;
|
|
4947
|
+
};
|
|
4948
|
+
executions: {
|
|
4949
|
+
offerId: string;
|
|
4950
|
+
windowId: string;
|
|
4951
|
+
promotionId: string | null;
|
|
4952
|
+
/** @enum {string} */
|
|
4953
|
+
state:
|
|
4954
|
+
| "draft"
|
|
4955
|
+
| "activating"
|
|
4956
|
+
| "prepared"
|
|
4957
|
+
| "active"
|
|
4958
|
+
| "ending"
|
|
4959
|
+
| "ended"
|
|
4960
|
+
| "failed";
|
|
4961
|
+
error: string | null;
|
|
4962
|
+
evidence: unknown;
|
|
4963
|
+
termsRevision: number | null;
|
|
4964
|
+
}[];
|
|
4965
|
+
audit: {
|
|
4966
|
+
id: string;
|
|
4967
|
+
action: string;
|
|
4968
|
+
actorId: string | null;
|
|
4969
|
+
actorName: string | null;
|
|
4970
|
+
createdAt: string;
|
|
4971
|
+
details: {
|
|
4972
|
+
[key: string]: unknown;
|
|
4973
|
+
};
|
|
4974
|
+
summary?: string;
|
|
4975
|
+
items?: {
|
|
4976
|
+
/** @enum {string} */
|
|
4977
|
+
kind: "brief" | "window" | "offer";
|
|
4978
|
+
/** @enum {string} */
|
|
4979
|
+
action: "add" | "update" | "remove";
|
|
4980
|
+
id: string;
|
|
4981
|
+
name: string;
|
|
4982
|
+
changes: {
|
|
4983
|
+
field: string;
|
|
4984
|
+
label: string;
|
|
4985
|
+
from: string | null;
|
|
4986
|
+
to: string | null;
|
|
4987
|
+
}[];
|
|
4988
|
+
}[];
|
|
4989
|
+
hiddenCount?: number;
|
|
4990
|
+
}[];
|
|
4991
|
+
/** @description Issues that block approving or running the current plan. */
|
|
4992
|
+
readiness: string[];
|
|
4993
|
+
/** @description Issues that block approving the proposed live change. */
|
|
4994
|
+
pendingChangeIssues: string[];
|
|
4995
|
+
pendingScheduleCount: number;
|
|
4996
|
+
failedScheduleCount: number;
|
|
4997
|
+
waitingBrowserJobCount: number;
|
|
4998
|
+
scheduleIssues?: {
|
|
4999
|
+
windowId: string;
|
|
5000
|
+
/** @enum {string} */
|
|
5001
|
+
phase: "prepare" | "live";
|
|
5002
|
+
/** @enum {string} */
|
|
5003
|
+
kind: "overdue" | "missed";
|
|
5004
|
+
}[];
|
|
5005
|
+
recovery?: {
|
|
5006
|
+
windowId: string;
|
|
5007
|
+
/** @enum {string} */
|
|
5008
|
+
phase: "prepare" | "live" | "start" | "end" | "revise";
|
|
5009
|
+
state: string;
|
|
5010
|
+
attempt: number;
|
|
5011
|
+
nextRetryAt: string;
|
|
5012
|
+
error: string | null;
|
|
5013
|
+
}[];
|
|
5014
|
+
cleanupFailed?: boolean;
|
|
5015
|
+
progress?: {
|
|
5016
|
+
asOf: string;
|
|
5017
|
+
title: string;
|
|
5018
|
+
description: string;
|
|
5019
|
+
total: number;
|
|
5020
|
+
counts: {
|
|
5021
|
+
waiting: number;
|
|
5022
|
+
preparing: number;
|
|
5023
|
+
prepared: number;
|
|
5024
|
+
live: number;
|
|
5025
|
+
ending: number;
|
|
5026
|
+
ended: number;
|
|
5027
|
+
cancelled: number;
|
|
5028
|
+
failed: number;
|
|
5029
|
+
};
|
|
5030
|
+
issues: {
|
|
5031
|
+
offerId: string;
|
|
5032
|
+
name: string;
|
|
5033
|
+
error: string;
|
|
5034
|
+
}[];
|
|
5035
|
+
scheduleIssues: {
|
|
5036
|
+
windowId: string;
|
|
5037
|
+
/** @enum {string} */
|
|
5038
|
+
phase: "prepare" | "live";
|
|
5039
|
+
/** @enum {string} */
|
|
5040
|
+
kind: "overdue" | "missed";
|
|
5041
|
+
name: string;
|
|
5042
|
+
message: string;
|
|
5043
|
+
}[];
|
|
5044
|
+
blockers: string[];
|
|
5045
|
+
nextWindow: {
|
|
5046
|
+
id: string;
|
|
5047
|
+
name: string;
|
|
5048
|
+
preparesAt: string | null;
|
|
5049
|
+
startsAt: string | null;
|
|
5050
|
+
endsAt: string | null;
|
|
5051
|
+
} | null;
|
|
5052
|
+
};
|
|
5053
|
+
};
|
|
5054
|
+
};
|
|
5055
|
+
};
|
|
5056
|
+
/** @description Invalid campaign payload or plan state. */
|
|
5057
|
+
400: {
|
|
5058
|
+
headers: {
|
|
5059
|
+
[name: string]: unknown;
|
|
5060
|
+
};
|
|
5061
|
+
content?: never;
|
|
5062
|
+
};
|
|
5063
|
+
/** @description Unauthorized */
|
|
5064
|
+
401: {
|
|
5065
|
+
headers: {
|
|
5066
|
+
[name: string]: unknown;
|
|
5067
|
+
};
|
|
5068
|
+
content?: never;
|
|
5069
|
+
};
|
|
5070
|
+
/** @description Forbidden: missing `promotions:read` scope, or a session member without organization-wide access */
|
|
5071
|
+
403: {
|
|
5072
|
+
headers: {
|
|
5073
|
+
[name: string]: unknown;
|
|
5074
|
+
};
|
|
5075
|
+
content?: never;
|
|
5076
|
+
};
|
|
5077
|
+
/** @description Campaign not found for this organization */
|
|
5078
|
+
404: {
|
|
5079
|
+
headers: {
|
|
5080
|
+
[name: string]: unknown;
|
|
5081
|
+
};
|
|
5082
|
+
content?: never;
|
|
5083
|
+
};
|
|
5084
|
+
/** @description Rate limit exceeded */
|
|
5085
|
+
429: {
|
|
5086
|
+
headers: {
|
|
5087
|
+
[name: string]: unknown;
|
|
5088
|
+
};
|
|
5089
|
+
content?: never;
|
|
5090
|
+
};
|
|
5091
|
+
/** @description Internal Server Error */
|
|
5092
|
+
500: {
|
|
5093
|
+
headers: {
|
|
5094
|
+
[name: string]: unknown;
|
|
5095
|
+
};
|
|
5096
|
+
content?: never;
|
|
5097
|
+
};
|
|
5098
|
+
};
|
|
5099
|
+
};
|
|
5100
|
+
put_v1_campaigns_by_campaignid: {
|
|
5101
|
+
parameters: {
|
|
5102
|
+
query?: never;
|
|
5103
|
+
header?: never;
|
|
5104
|
+
path: {
|
|
5105
|
+
campaignId: string;
|
|
5106
|
+
};
|
|
5107
|
+
cookie?: never;
|
|
5108
|
+
};
|
|
5109
|
+
requestBody: {
|
|
5110
|
+
content: {
|
|
5111
|
+
"application/json": {
|
|
5112
|
+
/** @description Required for session auth. Optional for an API key, which already identifies the organization. */
|
|
5113
|
+
organizationId?: string;
|
|
5114
|
+
expectedRevision: number;
|
|
5115
|
+
/** @enum {string} */
|
|
5116
|
+
expectedStage?: "draft" | "approved";
|
|
5117
|
+
expectedPendingVersion?: number | null;
|
|
5118
|
+
plan: {
|
|
5119
|
+
brief: {
|
|
5120
|
+
name: string;
|
|
5121
|
+
/** @default */
|
|
5122
|
+
objective?: string;
|
|
5123
|
+
/** @default */
|
|
5124
|
+
brand?: string;
|
|
5125
|
+
ownerId: string;
|
|
5126
|
+
approverId: string;
|
|
5127
|
+
timezone: string;
|
|
5128
|
+
/** @default [] */
|
|
5129
|
+
stores?: {
|
|
5130
|
+
/** @enum {string} */
|
|
5131
|
+
marketplace:
|
|
5132
|
+
| "shopee"
|
|
5133
|
+
| "lazada"
|
|
5134
|
+
| "tiktok"
|
|
5135
|
+
| "shopify"
|
|
5136
|
+
| "whatsapp"
|
|
5137
|
+
| "zalora"
|
|
5138
|
+
| "amazon"
|
|
5139
|
+
| "ebay";
|
|
5140
|
+
country: string;
|
|
5141
|
+
storeId: string;
|
|
5142
|
+
}[];
|
|
5143
|
+
/** @default */
|
|
5144
|
+
serviceRequest?: string;
|
|
5145
|
+
/**
|
|
5146
|
+
* @default standard
|
|
5147
|
+
* @enum {string}
|
|
5148
|
+
*/
|
|
5149
|
+
priority?: "standard" | "priority" | "super_priority";
|
|
5150
|
+
/** @default [] */
|
|
5151
|
+
documentIds?: string[];
|
|
5152
|
+
/** @default null */
|
|
5153
|
+
reviewDueAt?: string | null;
|
|
5154
|
+
sourceCurrency?: string;
|
|
5155
|
+
/** @enum {string} */
|
|
5156
|
+
sourceMarketplace?:
|
|
5157
|
+
| "shopee"
|
|
5158
|
+
| "lazada"
|
|
5159
|
+
| "tiktok"
|
|
5160
|
+
| "shopify"
|
|
5161
|
+
| "whatsapp"
|
|
5162
|
+
| "zalora"
|
|
5163
|
+
| "amazon"
|
|
5164
|
+
| "ebay";
|
|
5165
|
+
sourceCountry?: string;
|
|
5166
|
+
/** @default */
|
|
5167
|
+
cleanupNotes?: string;
|
|
5168
|
+
};
|
|
5169
|
+
/** @default [] */
|
|
5170
|
+
windows?: {
|
|
5171
|
+
id: string;
|
|
5172
|
+
name: string;
|
|
5173
|
+
/**
|
|
5174
|
+
* @description Preparation time: publish promotions with the future live start/end. Must be at or before startsAt.
|
|
5175
|
+
* @default null
|
|
5176
|
+
*/
|
|
5177
|
+
preparesAt?: string | null;
|
|
5178
|
+
startsAt: string | null;
|
|
5179
|
+
endsAt: string | null;
|
|
5180
|
+
/** @default */
|
|
5181
|
+
reviewNotes?: string;
|
|
5182
|
+
}[];
|
|
5183
|
+
offers?: {
|
|
5184
|
+
id: string;
|
|
5185
|
+
windowId: string;
|
|
5186
|
+
/**
|
|
5187
|
+
* Format: uuid
|
|
5188
|
+
* @description Existing draft promotion attached to this window; the campaign controls its live dates.
|
|
5189
|
+
*/
|
|
5190
|
+
promotionId?: string;
|
|
5191
|
+
promotion: {
|
|
5192
|
+
name?: string;
|
|
5193
|
+
description?: string | null;
|
|
5194
|
+
/**
|
|
5195
|
+
* @description Canonical OmniCommerce promotion mechanic: product discount, flash sale, voucher, gift with purchase, Buy-X-Get-Y, bundle deal, or Lazada-only free shipping and early bird price.
|
|
5196
|
+
* @enum {string}
|
|
5197
|
+
*/
|
|
5198
|
+
kind?:
|
|
5199
|
+
| "product_discount"
|
|
5200
|
+
| "flash_sale"
|
|
5201
|
+
| "voucher"
|
|
5202
|
+
| "gift_with_purchase"
|
|
5203
|
+
| "buy_x_get_y"
|
|
5204
|
+
| "bundle_deal"
|
|
5205
|
+
| "free_shipping"
|
|
5206
|
+
| "early_bird_price";
|
|
5207
|
+
salesChannels?: ("pdp" | "live")[];
|
|
5208
|
+
/** @enum {string} */
|
|
5209
|
+
discountType?: "percentage" | "fixed_amount";
|
|
5210
|
+
discountValue?: number;
|
|
5211
|
+
/** @description Patch discount terms for exact target store keys; unnamed stores remain unchanged. Null discountValue restores shared campaign terms for that store. */
|
|
5212
|
+
storeDiscounts?: {
|
|
5213
|
+
storeKey: string;
|
|
5214
|
+
/** @enum {string} */
|
|
5215
|
+
discountType: "percentage" | "fixed_amount";
|
|
5216
|
+
discountValue: number | null;
|
|
5217
|
+
}[];
|
|
5218
|
+
/** @description Up to 100 connected stores for create (required) or update. Copy marketplace, country, and storeId from get_promotions targetStores or find_products marketplaceDetails. Do not concatenate a storeKeys string. */
|
|
5219
|
+
targetStores?: {
|
|
5220
|
+
/** @enum {string} */
|
|
5221
|
+
marketplace:
|
|
5222
|
+
| "lazada"
|
|
5223
|
+
| "shopee"
|
|
5224
|
+
| "tiktok"
|
|
5225
|
+
| "shopify"
|
|
5226
|
+
| "amazon"
|
|
5227
|
+
| "zalora"
|
|
5228
|
+
| "ebay";
|
|
5229
|
+
country: string;
|
|
5230
|
+
storeId: string;
|
|
5231
|
+
}[];
|
|
5232
|
+
minSalePrice?: number | null;
|
|
5233
|
+
maxDiscountAmount?: number | null;
|
|
5234
|
+
minSpend?: number | null;
|
|
5235
|
+
voucherCode?: string | null;
|
|
5236
|
+
claimStartsAt?: string | null;
|
|
5237
|
+
totalUsageLimit?: number | null;
|
|
5238
|
+
perBuyerLimit?: number | null;
|
|
5239
|
+
mechanicConfig?: {
|
|
5240
|
+
/** @description Voucher subtype from get_promotions capabilities.voucherTypes. Browser AOP types (delivery=browser_aop) are writable Seller Center vouchers. Omit browserAutomation.aopId to use the built-in marketplace AOP. */
|
|
5241
|
+
voucherType?:
|
|
5242
|
+
| (
|
|
5243
|
+
| "shopee_shop"
|
|
5244
|
+
| "shopee_product"
|
|
5245
|
+
| "shopee_private"
|
|
5246
|
+
| "shopee_live"
|
|
5247
|
+
| "shopee_video"
|
|
5248
|
+
| "shopee_new_buyer"
|
|
5249
|
+
| "shopee_repeat_buyer"
|
|
5250
|
+
| "shopee_follow_prize"
|
|
5251
|
+
| "shopee_exclusive_streamer"
|
|
5252
|
+
| "shopee_welcome"
|
|
5253
|
+
| "shopee_member_repeat_buyer"
|
|
5254
|
+
| "shopee_exclusive"
|
|
5255
|
+
| "shopee_redemption"
|
|
5256
|
+
| "shopee_exclusive_creator"
|
|
5257
|
+
| "lazada_store_follower"
|
|
5258
|
+
| "lazada_regular"
|
|
5259
|
+
| "lazada_store_new_buyer"
|
|
5260
|
+
| "lazada_live"
|
|
5261
|
+
| "lazada_offline"
|
|
5262
|
+
| "lazada_co_funded"
|
|
5263
|
+
| "lazada_welcome"
|
|
5264
|
+
| "lazada_linked_member"
|
|
5265
|
+
| "lazada_new_member"
|
|
5266
|
+
| "lazada_member_exclusive"
|
|
5267
|
+
| "lazada_points_redeemable"
|
|
5268
|
+
| "tiktok_seller_coupon"
|
|
5269
|
+
| "shopify_discount_code"
|
|
5270
|
+
| "amazon_promotion_code"
|
|
5271
|
+
| "zalora_seller_voucher"
|
|
5272
|
+
| "ebay_coded_coupon"
|
|
5273
|
+
)
|
|
5274
|
+
| null;
|
|
5275
|
+
browserAutomation?: {
|
|
5276
|
+
aopId?: string;
|
|
5277
|
+
variableValues?: {
|
|
5278
|
+
[key: string]: string;
|
|
5279
|
+
};
|
|
5280
|
+
instructions?: string;
|
|
5281
|
+
} | null;
|
|
5282
|
+
/**
|
|
5283
|
+
* @description shop = all products, products = selected assigned products. Repeat Buyer defaults to shop.
|
|
5284
|
+
* @enum {string}
|
|
5285
|
+
*/
|
|
5286
|
+
voucherScope?: "products" | "shop";
|
|
5287
|
+
/**
|
|
5288
|
+
* @description Seller Center reward type. coins_cashback is a percentage greater than 3 and does not reduce salePrice.
|
|
5289
|
+
* @enum {string}
|
|
5290
|
+
*/
|
|
5291
|
+
voucherReward?: "discount" | "coins_cashback";
|
|
5292
|
+
/** @enum {string} */
|
|
5293
|
+
voucherAudience?: "general" | "shop_follow";
|
|
5294
|
+
/** @description Shopee Repeat Buyer: minimum completed shop orders, 1 or 2. Required for shopee_repeat_buyer. */
|
|
5295
|
+
repeatPurchaseMinCount?: number;
|
|
5296
|
+
/** @description Shopee Repeat Buyer: lookback window in days, one of 30, 90, 180 or 365. Required for shopee_repeat_buyer. */
|
|
5297
|
+
repeatPurchaseLookbackDays?: number;
|
|
5298
|
+
/** @description Shopee Smart Voucher toggle. Used by New Buyer and similar portal types. */
|
|
5299
|
+
smartVoucher?: boolean;
|
|
5300
|
+
/** @description Shopee Follow Prize: days after claim until expiry. Seller Center is 7. */
|
|
5301
|
+
followPrizeExpiryDays?: number;
|
|
5302
|
+
/**
|
|
5303
|
+
* @description Shopee Video display: shopee_video = all Shopee Video; creator_video = targeted creator videos only.
|
|
5304
|
+
* @enum {string}
|
|
5305
|
+
*/
|
|
5306
|
+
videoDisplayMode?: "shopee_video" | "creator_video";
|
|
5307
|
+
/** @description Exclusive Creator Voucher: up to 15 Shopee usernames. */
|
|
5308
|
+
exclusiveCreatorUsernames?: string[];
|
|
5309
|
+
/** @description Exclusive Streamer Voucher: up to 15 Shopee usernames. */
|
|
5310
|
+
exclusiveStreamerUsernames?: string[];
|
|
5311
|
+
/** @description Shopee display setting. ["all"] = display on all pages; [] = hidden/share by code. */
|
|
5312
|
+
voucherDisplayChannels?: (
|
|
5313
|
+
| "all"
|
|
5314
|
+
| "feed"
|
|
5315
|
+
| "live"
|
|
5316
|
+
| "order_page"
|
|
5317
|
+
| "followers"
|
|
5318
|
+
| "offline"
|
|
5319
|
+
)[];
|
|
5320
|
+
/** @enum {string} */
|
|
5321
|
+
bundlePriceType?: "discount" | "fixed_price";
|
|
5322
|
+
bundleTiers?: {
|
|
5323
|
+
minimumQuantity: number;
|
|
5324
|
+
discountValue: number;
|
|
5325
|
+
}[];
|
|
5326
|
+
/** @enum {string} */
|
|
5327
|
+
thresholdType?: "item_quantity" | "order_amount";
|
|
5328
|
+
thresholdValue?: number;
|
|
5329
|
+
/** @enum {string} */
|
|
5330
|
+
giftType?: "gift" | "sample";
|
|
5331
|
+
giftQuantity?: number;
|
|
5332
|
+
gifts?: {
|
|
5333
|
+
/** Format: uuid */
|
|
5334
|
+
productId: string;
|
|
5335
|
+
variantId?: string | null;
|
|
5336
|
+
totalClaimLimit: number;
|
|
5337
|
+
}[];
|
|
5338
|
+
buyQuantity?: number;
|
|
5339
|
+
getQuantity?: number;
|
|
5340
|
+
benefitProductIds?: string[];
|
|
5341
|
+
/** @enum {string} */
|
|
5342
|
+
benefitType?: "free" | "percentage" | "fixed_amount";
|
|
5343
|
+
benefitValue?: number;
|
|
5344
|
+
maxApplicationsPerOrder?: number;
|
|
5345
|
+
bundleMinimumQuantity?: number;
|
|
5346
|
+
/** @description Free shipping delivery option. Lazada: STANDARD (default), ECONOMY, EXPRESS, SELLER_OWN_FLEET or P2P, as offered by the store. */
|
|
5347
|
+
shippingDeliveryOption?: string;
|
|
5348
|
+
/** @description Free shipping: total shipping subsidy budget in the store currency. Omit for an unlimited budget. */
|
|
5349
|
+
shippingBudget?: number;
|
|
5350
|
+
};
|
|
5351
|
+
};
|
|
5352
|
+
/** @default [] */
|
|
5353
|
+
productIds?: string[];
|
|
5354
|
+
/** @default */
|
|
5355
|
+
reviewNotes?: string;
|
|
5356
|
+
/** @default */
|
|
5357
|
+
excludedReason?: string;
|
|
5358
|
+
source?: {
|
|
5359
|
+
sheet: string;
|
|
5360
|
+
rows: number[];
|
|
5361
|
+
headers: string[];
|
|
5362
|
+
values: string[][];
|
|
5363
|
+
};
|
|
5364
|
+
}[];
|
|
5365
|
+
};
|
|
5366
|
+
};
|
|
5367
|
+
};
|
|
5368
|
+
};
|
|
5369
|
+
responses: {
|
|
5370
|
+
/** @description Campaign detail: plan, revision, executions, audit, schedule, and progress. */
|
|
5371
|
+
200: {
|
|
5372
|
+
headers: {
|
|
5373
|
+
[name: string]: unknown;
|
|
5374
|
+
};
|
|
5375
|
+
content: {
|
|
5376
|
+
"application/json": {
|
|
5377
|
+
campaign: {
|
|
5378
|
+
id: string;
|
|
5379
|
+
organizationId: string;
|
|
5380
|
+
revision: number;
|
|
5381
|
+
/** @enum {string} */
|
|
5382
|
+
stage:
|
|
5383
|
+
| "draft"
|
|
5384
|
+
| "approved"
|
|
5385
|
+
| "running"
|
|
5386
|
+
| "ending"
|
|
5387
|
+
| "completed"
|
|
5388
|
+
| "archived";
|
|
5389
|
+
approval: {
|
|
5390
|
+
revision: number;
|
|
5391
|
+
userId: string;
|
|
5392
|
+
approvedAt: string;
|
|
5393
|
+
} | null;
|
|
5394
|
+
runId: string | null;
|
|
5395
|
+
startedAt: string | null;
|
|
5396
|
+
endedAt: string | null;
|
|
5397
|
+
createdAt: string;
|
|
5398
|
+
updatedAt: string;
|
|
5399
|
+
plan: components["schemas"]["CampaignPlan"];
|
|
5400
|
+
/** @description A running campaign's proposed plan, applied only when the approver approves it. */
|
|
5401
|
+
pendingChange: {
|
|
5402
|
+
version: number;
|
|
5403
|
+
plan: components["schemas"]["CampaignPlan"];
|
|
5404
|
+
proposedBy: string;
|
|
5405
|
+
proposedAt: string;
|
|
5406
|
+
} | null;
|
|
5407
|
+
};
|
|
5408
|
+
executions: {
|
|
5409
|
+
offerId: string;
|
|
5410
|
+
windowId: string;
|
|
5411
|
+
promotionId: string | null;
|
|
5412
|
+
/** @enum {string} */
|
|
5413
|
+
state:
|
|
5414
|
+
| "draft"
|
|
5415
|
+
| "activating"
|
|
5416
|
+
| "prepared"
|
|
5417
|
+
| "active"
|
|
5418
|
+
| "ending"
|
|
5419
|
+
| "ended"
|
|
5420
|
+
| "failed";
|
|
5421
|
+
error: string | null;
|
|
5422
|
+
evidence: unknown;
|
|
5423
|
+
termsRevision: number | null;
|
|
5424
|
+
}[];
|
|
5425
|
+
audit: {
|
|
5426
|
+
id: string;
|
|
5427
|
+
action: string;
|
|
5428
|
+
actorId: string | null;
|
|
5429
|
+
actorName: string | null;
|
|
5430
|
+
createdAt: string;
|
|
5431
|
+
details: {
|
|
5432
|
+
[key: string]: unknown;
|
|
5433
|
+
};
|
|
5434
|
+
summary?: string;
|
|
5435
|
+
items?: {
|
|
5436
|
+
/** @enum {string} */
|
|
5437
|
+
kind: "brief" | "window" | "offer";
|
|
5438
|
+
/** @enum {string} */
|
|
5439
|
+
action: "add" | "update" | "remove";
|
|
5440
|
+
id: string;
|
|
5441
|
+
name: string;
|
|
5442
|
+
changes: {
|
|
5443
|
+
field: string;
|
|
5444
|
+
label: string;
|
|
5445
|
+
from: string | null;
|
|
5446
|
+
to: string | null;
|
|
5447
|
+
}[];
|
|
5448
|
+
}[];
|
|
5449
|
+
hiddenCount?: number;
|
|
5450
|
+
}[];
|
|
5451
|
+
/** @description Issues that block approving or running the current plan. */
|
|
5452
|
+
readiness: string[];
|
|
5453
|
+
/** @description Issues that block approving the proposed live change. */
|
|
5454
|
+
pendingChangeIssues: string[];
|
|
5455
|
+
pendingScheduleCount: number;
|
|
5456
|
+
failedScheduleCount: number;
|
|
5457
|
+
waitingBrowserJobCount: number;
|
|
5458
|
+
scheduleIssues?: {
|
|
5459
|
+
windowId: string;
|
|
5460
|
+
/** @enum {string} */
|
|
5461
|
+
phase: "prepare" | "live";
|
|
5462
|
+
/** @enum {string} */
|
|
5463
|
+
kind: "overdue" | "missed";
|
|
5464
|
+
}[];
|
|
5465
|
+
recovery?: {
|
|
5466
|
+
windowId: string;
|
|
5467
|
+
/** @enum {string} */
|
|
5468
|
+
phase: "prepare" | "live" | "start" | "end" | "revise";
|
|
5469
|
+
state: string;
|
|
5470
|
+
attempt: number;
|
|
5471
|
+
nextRetryAt: string;
|
|
5472
|
+
error: string | null;
|
|
5473
|
+
}[];
|
|
5474
|
+
cleanupFailed?: boolean;
|
|
5475
|
+
progress?: {
|
|
5476
|
+
asOf: string;
|
|
5477
|
+
title: string;
|
|
5478
|
+
description: string;
|
|
5479
|
+
total: number;
|
|
5480
|
+
counts: {
|
|
5481
|
+
waiting: number;
|
|
5482
|
+
preparing: number;
|
|
5483
|
+
prepared: number;
|
|
5484
|
+
live: number;
|
|
5485
|
+
ending: number;
|
|
5486
|
+
ended: number;
|
|
5487
|
+
cancelled: number;
|
|
5488
|
+
failed: number;
|
|
5489
|
+
};
|
|
5490
|
+
issues: {
|
|
5491
|
+
offerId: string;
|
|
5492
|
+
name: string;
|
|
5493
|
+
error: string;
|
|
5494
|
+
}[];
|
|
5495
|
+
scheduleIssues: {
|
|
5496
|
+
windowId: string;
|
|
5497
|
+
/** @enum {string} */
|
|
5498
|
+
phase: "prepare" | "live";
|
|
5499
|
+
/** @enum {string} */
|
|
5500
|
+
kind: "overdue" | "missed";
|
|
5501
|
+
name: string;
|
|
5502
|
+
message: string;
|
|
5503
|
+
}[];
|
|
5504
|
+
blockers: string[];
|
|
5505
|
+
nextWindow: {
|
|
5506
|
+
id: string;
|
|
5507
|
+
name: string;
|
|
5508
|
+
preparesAt: string | null;
|
|
5509
|
+
startsAt: string | null;
|
|
5510
|
+
endsAt: string | null;
|
|
5511
|
+
} | null;
|
|
5512
|
+
};
|
|
5513
|
+
};
|
|
5514
|
+
};
|
|
5515
|
+
};
|
|
5516
|
+
/** @description Invalid campaign payload or plan state. */
|
|
5517
|
+
400: {
|
|
5518
|
+
headers: {
|
|
5519
|
+
[name: string]: unknown;
|
|
5520
|
+
};
|
|
5521
|
+
content?: never;
|
|
5522
|
+
};
|
|
5523
|
+
/** @description Unauthorized */
|
|
5524
|
+
401: {
|
|
5525
|
+
headers: {
|
|
5526
|
+
[name: string]: unknown;
|
|
5527
|
+
};
|
|
5528
|
+
content?: never;
|
|
5529
|
+
};
|
|
5530
|
+
/** @description Forbidden: missing `promotions:write` scope, or a session member without organization-wide access */
|
|
5531
|
+
403: {
|
|
5532
|
+
headers: {
|
|
5533
|
+
[name: string]: unknown;
|
|
5534
|
+
};
|
|
5535
|
+
content?: never;
|
|
5536
|
+
};
|
|
5537
|
+
/** @description Campaign not found for this organization */
|
|
5538
|
+
404: {
|
|
5539
|
+
headers: {
|
|
5540
|
+
[name: string]: unknown;
|
|
5541
|
+
};
|
|
5542
|
+
content?: never;
|
|
5543
|
+
};
|
|
5544
|
+
/** @description Rate limit exceeded */
|
|
5545
|
+
429: {
|
|
5546
|
+
headers: {
|
|
5547
|
+
[name: string]: unknown;
|
|
5548
|
+
};
|
|
5549
|
+
content?: never;
|
|
5550
|
+
};
|
|
5551
|
+
/** @description Internal Server Error */
|
|
5552
|
+
500: {
|
|
5553
|
+
headers: {
|
|
5554
|
+
[name: string]: unknown;
|
|
5555
|
+
};
|
|
5556
|
+
content?: never;
|
|
5557
|
+
};
|
|
5558
|
+
};
|
|
5559
|
+
};
|
|
5560
|
+
post_v1_campaigns_by_campaignid_actions: {
|
|
5561
|
+
parameters: {
|
|
5562
|
+
query?: never;
|
|
5563
|
+
header?: never;
|
|
5564
|
+
path: {
|
|
5565
|
+
campaignId: string;
|
|
5566
|
+
};
|
|
5567
|
+
cookie?: never;
|
|
5568
|
+
};
|
|
5569
|
+
requestBody: {
|
|
5570
|
+
content: {
|
|
5571
|
+
"application/json": {
|
|
5572
|
+
/** @enum {string} */
|
|
5573
|
+
action:
|
|
5574
|
+
| "approve"
|
|
5575
|
+
| "run"
|
|
5576
|
+
| "approve_and_run"
|
|
5577
|
+
| "end"
|
|
5578
|
+
| "resume"
|
|
5579
|
+
| "retry"
|
|
5580
|
+
| "approve_change"
|
|
5581
|
+
| "discard_change";
|
|
5582
|
+
expectedRevision: number;
|
|
5583
|
+
expectedPendingVersion?: number;
|
|
5584
|
+
/** @description Required for session auth. Optional for an API key, which already identifies the organization. */
|
|
5585
|
+
organizationId?: string;
|
|
5586
|
+
};
|
|
5587
|
+
};
|
|
5588
|
+
};
|
|
5589
|
+
responses: {
|
|
5590
|
+
/** @description Campaign detail after the action, plus the scheduling result. */
|
|
5591
|
+
200: {
|
|
5592
|
+
headers: {
|
|
5593
|
+
[name: string]: unknown;
|
|
5594
|
+
};
|
|
5595
|
+
content: {
|
|
5596
|
+
"application/json": {
|
|
5597
|
+
campaign: {
|
|
5598
|
+
id: string;
|
|
5599
|
+
organizationId: string;
|
|
5600
|
+
revision: number;
|
|
5601
|
+
/** @enum {string} */
|
|
5602
|
+
stage:
|
|
5603
|
+
| "draft"
|
|
5604
|
+
| "approved"
|
|
5605
|
+
| "running"
|
|
5606
|
+
| "ending"
|
|
5607
|
+
| "completed"
|
|
5608
|
+
| "archived";
|
|
5609
|
+
approval: {
|
|
5610
|
+
revision: number;
|
|
5611
|
+
userId: string;
|
|
5612
|
+
approvedAt: string;
|
|
5613
|
+
} | null;
|
|
5614
|
+
runId: string | null;
|
|
5615
|
+
startedAt: string | null;
|
|
5616
|
+
endedAt: string | null;
|
|
5617
|
+
createdAt: string;
|
|
5618
|
+
updatedAt: string;
|
|
5619
|
+
plan: components["schemas"]["CampaignPlan"];
|
|
5620
|
+
/** @description A running campaign's proposed plan, applied only when the approver approves it. */
|
|
5621
|
+
pendingChange: {
|
|
5622
|
+
version: number;
|
|
5623
|
+
plan: components["schemas"]["CampaignPlan"];
|
|
5624
|
+
proposedBy: string;
|
|
5625
|
+
proposedAt: string;
|
|
5626
|
+
} | null;
|
|
5627
|
+
};
|
|
5628
|
+
executions: {
|
|
5629
|
+
offerId: string;
|
|
5630
|
+
windowId: string;
|
|
5631
|
+
promotionId: string | null;
|
|
5632
|
+
/** @enum {string} */
|
|
5633
|
+
state:
|
|
5634
|
+
| "draft"
|
|
5635
|
+
| "activating"
|
|
5636
|
+
| "prepared"
|
|
5637
|
+
| "active"
|
|
5638
|
+
| "ending"
|
|
5639
|
+
| "ended"
|
|
5640
|
+
| "failed";
|
|
5641
|
+
error: string | null;
|
|
5642
|
+
evidence: unknown;
|
|
5643
|
+
termsRevision: number | null;
|
|
5644
|
+
}[];
|
|
5645
|
+
audit: {
|
|
5646
|
+
id: string;
|
|
5647
|
+
action: string;
|
|
5648
|
+
actorId: string | null;
|
|
5649
|
+
actorName: string | null;
|
|
5650
|
+
createdAt: string;
|
|
5651
|
+
details: {
|
|
5652
|
+
[key: string]: unknown;
|
|
5653
|
+
};
|
|
5654
|
+
summary?: string;
|
|
5655
|
+
items?: {
|
|
5656
|
+
/** @enum {string} */
|
|
5657
|
+
kind: "brief" | "window" | "offer";
|
|
5658
|
+
/** @enum {string} */
|
|
5659
|
+
action: "add" | "update" | "remove";
|
|
5660
|
+
id: string;
|
|
5661
|
+
name: string;
|
|
5662
|
+
changes: {
|
|
5663
|
+
field: string;
|
|
5664
|
+
label: string;
|
|
5665
|
+
from: string | null;
|
|
5666
|
+
to: string | null;
|
|
5667
|
+
}[];
|
|
5668
|
+
}[];
|
|
5669
|
+
hiddenCount?: number;
|
|
5670
|
+
}[];
|
|
5671
|
+
/** @description Issues that block approving or running the current plan. */
|
|
5672
|
+
readiness: string[];
|
|
5673
|
+
/** @description Issues that block approving the proposed live change. */
|
|
5674
|
+
pendingChangeIssues: string[];
|
|
5675
|
+
pendingScheduleCount: number;
|
|
5676
|
+
failedScheduleCount: number;
|
|
5677
|
+
waitingBrowserJobCount: number;
|
|
5678
|
+
scheduleIssues?: {
|
|
5679
|
+
windowId: string;
|
|
5680
|
+
/** @enum {string} */
|
|
5681
|
+
phase: "prepare" | "live";
|
|
5682
|
+
/** @enum {string} */
|
|
5683
|
+
kind: "overdue" | "missed";
|
|
5684
|
+
}[];
|
|
5685
|
+
recovery?: {
|
|
5686
|
+
windowId: string;
|
|
5687
|
+
/** @enum {string} */
|
|
5688
|
+
phase: "prepare" | "live" | "start" | "end" | "revise";
|
|
5689
|
+
state: string;
|
|
5690
|
+
attempt: number;
|
|
5691
|
+
nextRetryAt: string;
|
|
5692
|
+
error: string | null;
|
|
5693
|
+
}[];
|
|
5694
|
+
cleanupFailed?: boolean;
|
|
5695
|
+
progress?: {
|
|
5696
|
+
asOf: string;
|
|
5697
|
+
title: string;
|
|
5698
|
+
description: string;
|
|
5699
|
+
total: number;
|
|
5700
|
+
counts: {
|
|
5701
|
+
waiting: number;
|
|
5702
|
+
preparing: number;
|
|
5703
|
+
prepared: number;
|
|
5704
|
+
live: number;
|
|
5705
|
+
ending: number;
|
|
5706
|
+
ended: number;
|
|
5707
|
+
cancelled: number;
|
|
5708
|
+
failed: number;
|
|
5709
|
+
};
|
|
5710
|
+
issues: {
|
|
5711
|
+
offerId: string;
|
|
5712
|
+
name: string;
|
|
5713
|
+
error: string;
|
|
5714
|
+
}[];
|
|
5715
|
+
scheduleIssues: {
|
|
5716
|
+
windowId: string;
|
|
5717
|
+
/** @enum {string} */
|
|
5718
|
+
phase: "prepare" | "live";
|
|
5719
|
+
/** @enum {string} */
|
|
5720
|
+
kind: "overdue" | "missed";
|
|
5721
|
+
name: string;
|
|
5722
|
+
message: string;
|
|
5723
|
+
}[];
|
|
5724
|
+
blockers: string[];
|
|
5725
|
+
nextWindow: {
|
|
5726
|
+
id: string;
|
|
5727
|
+
name: string;
|
|
5728
|
+
preparesAt: string | null;
|
|
5729
|
+
startsAt: string | null;
|
|
5730
|
+
endsAt: string | null;
|
|
5731
|
+
} | null;
|
|
3255
5732
|
};
|
|
3256
|
-
|
|
3257
|
-
|
|
5733
|
+
/** @description `pending` is true when the schedule was saved but not yet acknowledged; retry the action to confirm. */
|
|
5734
|
+
scheduling: {
|
|
5735
|
+
queued: number;
|
|
5736
|
+
pending: boolean;
|
|
3258
5737
|
};
|
|
3259
5738
|
};
|
|
3260
5739
|
};
|
|
3261
5740
|
};
|
|
3262
|
-
/** @description Invalid
|
|
5741
|
+
/** @description Invalid campaign payload or plan state. */
|
|
3263
5742
|
400: {
|
|
3264
5743
|
headers: {
|
|
3265
5744
|
[name: string]: unknown;
|
|
@@ -3273,28 +5752,28 @@ interface operations {
|
|
|
3273
5752
|
};
|
|
3274
5753
|
content?: never;
|
|
3275
5754
|
};
|
|
3276
|
-
/** @description
|
|
3277
|
-
|
|
5755
|
+
/** @description Forbidden: missing `promotions:write` scope, or a session member without organization-wide access */
|
|
5756
|
+
403: {
|
|
3278
5757
|
headers: {
|
|
3279
5758
|
[name: string]: unknown;
|
|
3280
5759
|
};
|
|
3281
5760
|
content?: never;
|
|
3282
5761
|
};
|
|
3283
|
-
/** @description
|
|
3284
|
-
|
|
5762
|
+
/** @description Campaign not found for this organization */
|
|
5763
|
+
404: {
|
|
3285
5764
|
headers: {
|
|
3286
5765
|
[name: string]: unknown;
|
|
3287
5766
|
};
|
|
3288
5767
|
content?: never;
|
|
3289
5768
|
};
|
|
3290
|
-
/** @description
|
|
3291
|
-
|
|
5769
|
+
/** @description Rate limit exceeded */
|
|
5770
|
+
429: {
|
|
3292
5771
|
headers: {
|
|
3293
5772
|
[name: string]: unknown;
|
|
3294
5773
|
};
|
|
3295
5774
|
content?: never;
|
|
3296
5775
|
};
|
|
3297
|
-
/** @description Internal
|
|
5776
|
+
/** @description Internal Server Error */
|
|
3298
5777
|
500: {
|
|
3299
5778
|
headers: {
|
|
3300
5779
|
[name: string]: unknown;
|
|
@@ -3303,7 +5782,7 @@ interface operations {
|
|
|
3303
5782
|
};
|
|
3304
5783
|
};
|
|
3305
5784
|
};
|
|
3306
|
-
|
|
5785
|
+
post_v1_campaigns_archive: {
|
|
3307
5786
|
parameters: {
|
|
3308
5787
|
query?: never;
|
|
3309
5788
|
header?: never;
|
|
@@ -3312,54 +5791,74 @@ interface operations {
|
|
|
3312
5791
|
};
|
|
3313
5792
|
requestBody: {
|
|
3314
5793
|
content: {
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
5794
|
+
"application/json":
|
|
5795
|
+
| {
|
|
5796
|
+
campaignIds: string[];
|
|
5797
|
+
/** @enum {string} */
|
|
5798
|
+
action: "archive" | "restore";
|
|
5799
|
+
/** @description Required for session auth. Optional for an API key, which already identifies the organization. */
|
|
5800
|
+
organizationId?: string;
|
|
5801
|
+
}
|
|
5802
|
+
| {
|
|
5803
|
+
/** @constant */
|
|
5804
|
+
action: "restore";
|
|
5805
|
+
selection: {
|
|
5806
|
+
/** @constant */
|
|
5807
|
+
mode: "all_matching";
|
|
5808
|
+
filters: {
|
|
5809
|
+
/** @default */
|
|
5810
|
+
q?: string;
|
|
5811
|
+
/**
|
|
5812
|
+
* @default all
|
|
5813
|
+
* @enum {string}
|
|
5814
|
+
*/
|
|
5815
|
+
stage?:
|
|
5816
|
+
| "all"
|
|
5817
|
+
| "draft"
|
|
5818
|
+
| "approved"
|
|
5819
|
+
| "running"
|
|
5820
|
+
| "ending"
|
|
5821
|
+
| "completed"
|
|
5822
|
+
| "archived";
|
|
5823
|
+
};
|
|
5824
|
+
/** @default [] */
|
|
5825
|
+
excludedCampaignIds?: string[];
|
|
5826
|
+
};
|
|
5827
|
+
/** @description Required for session auth. Optional for an API key, which already identifies the organization. */
|
|
5828
|
+
organizationId?: string;
|
|
5829
|
+
};
|
|
3343
5830
|
};
|
|
3344
5831
|
};
|
|
3345
5832
|
responses: {
|
|
3346
|
-
/** @description
|
|
5833
|
+
/** @description Aggregate result plus one result per campaign. `success` is true only when every requested campaign succeeds. */
|
|
3347
5834
|
200: {
|
|
3348
5835
|
headers: {
|
|
3349
5836
|
[name: string]: unknown;
|
|
3350
5837
|
};
|
|
3351
5838
|
content: {
|
|
3352
5839
|
"application/json": {
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
5840
|
+
/** @description True only when every requested campaign succeeds. */
|
|
5841
|
+
success: boolean;
|
|
5842
|
+
campaignIds: string[];
|
|
5843
|
+
succeededCount: number;
|
|
5844
|
+
failedCount: number;
|
|
5845
|
+
results: {
|
|
5846
|
+
success: boolean;
|
|
5847
|
+
campaignId: string;
|
|
5848
|
+
/** @enum {string} */
|
|
5849
|
+
stage?:
|
|
5850
|
+
| "draft"
|
|
5851
|
+
| "approved"
|
|
5852
|
+
| "running"
|
|
5853
|
+
| "ending"
|
|
5854
|
+
| "completed"
|
|
5855
|
+
| "archived";
|
|
5856
|
+
error?: string;
|
|
5857
|
+
}[];
|
|
3359
5858
|
};
|
|
3360
5859
|
};
|
|
3361
5860
|
};
|
|
3362
|
-
/** @description Invalid
|
|
5861
|
+
/** @description Invalid campaign payload or plan state. */
|
|
3363
5862
|
400: {
|
|
3364
5863
|
headers: {
|
|
3365
5864
|
[name: string]: unknown;
|
|
@@ -3373,28 +5872,21 @@ interface operations {
|
|
|
3373
5872
|
};
|
|
3374
5873
|
content?: never;
|
|
3375
5874
|
};
|
|
3376
|
-
/** @description
|
|
3377
|
-
402: {
|
|
3378
|
-
headers: {
|
|
3379
|
-
[name: string]: unknown;
|
|
3380
|
-
};
|
|
3381
|
-
content?: never;
|
|
3382
|
-
};
|
|
3383
|
-
/** @description Forbidden. Missing OAuth scope. */
|
|
5875
|
+
/** @description Forbidden: missing `promotions:write` scope, or a session member without organization-wide access */
|
|
3384
5876
|
403: {
|
|
3385
5877
|
headers: {
|
|
3386
5878
|
[name: string]: unknown;
|
|
3387
5879
|
};
|
|
3388
5880
|
content?: never;
|
|
3389
5881
|
};
|
|
3390
|
-
/** @description
|
|
3391
|
-
|
|
5882
|
+
/** @description Rate limit exceeded */
|
|
5883
|
+
429: {
|
|
3392
5884
|
headers: {
|
|
3393
5885
|
[name: string]: unknown;
|
|
3394
5886
|
};
|
|
3395
5887
|
content?: never;
|
|
3396
5888
|
};
|
|
3397
|
-
/** @description Internal
|
|
5889
|
+
/** @description Internal Server Error */
|
|
3398
5890
|
500: {
|
|
3399
5891
|
headers: {
|
|
3400
5892
|
[name: string]: unknown;
|
|
@@ -3403,7 +5895,7 @@ interface operations {
|
|
|
3403
5895
|
};
|
|
3404
5896
|
};
|
|
3405
5897
|
};
|
|
3406
|
-
|
|
5898
|
+
post_v1_campaigns_delete: {
|
|
3407
5899
|
parameters: {
|
|
3408
5900
|
query?: never;
|
|
3409
5901
|
header?: never;
|
|
@@ -3413,33 +5905,60 @@ interface operations {
|
|
|
3413
5905
|
requestBody: {
|
|
3414
5906
|
content: {
|
|
3415
5907
|
"application/json": {
|
|
3416
|
-
/** @description
|
|
3417
|
-
thread_id: string;
|
|
3418
|
-
/** @description Optional user inputs appended to the AOP prompt as key-value pairs. */
|
|
3419
|
-
user_inputs?: {
|
|
3420
|
-
[key: string]: string | number | boolean;
|
|
3421
|
-
} | null;
|
|
3422
|
-
/** @description Required for session auth. Optional for API keys. */
|
|
5908
|
+
/** @description Required for session auth. Optional for an API key, which already identifies the organization. */
|
|
3423
5909
|
organizationId?: string;
|
|
5910
|
+
selection:
|
|
5911
|
+
| {
|
|
5912
|
+
/** @constant */
|
|
5913
|
+
mode: "explicit";
|
|
5914
|
+
campaignIds: string[];
|
|
5915
|
+
}
|
|
5916
|
+
| {
|
|
5917
|
+
/** @constant */
|
|
5918
|
+
mode: "all_matching";
|
|
5919
|
+
filters: {
|
|
5920
|
+
/** @default */
|
|
5921
|
+
q?: string;
|
|
5922
|
+
/**
|
|
5923
|
+
* @default all
|
|
5924
|
+
* @enum {string}
|
|
5925
|
+
*/
|
|
5926
|
+
stage?:
|
|
5927
|
+
| "all"
|
|
5928
|
+
| "draft"
|
|
5929
|
+
| "approved"
|
|
5930
|
+
| "running"
|
|
5931
|
+
| "ending"
|
|
5932
|
+
| "completed"
|
|
5933
|
+
| "archived";
|
|
5934
|
+
};
|
|
5935
|
+
excludedCampaignIds?: string[];
|
|
5936
|
+
};
|
|
3424
5937
|
};
|
|
3425
5938
|
};
|
|
3426
5939
|
};
|
|
3427
5940
|
responses: {
|
|
3428
|
-
/** @description
|
|
5941
|
+
/** @description Aggregate result plus one result per campaign. `success` is true only when every requested campaign succeeds. */
|
|
3429
5942
|
200: {
|
|
3430
5943
|
headers: {
|
|
3431
5944
|
[name: string]: unknown;
|
|
3432
5945
|
};
|
|
3433
5946
|
content: {
|
|
3434
5947
|
"application/json": {
|
|
3435
|
-
/** @
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
5948
|
+
/** @description True only when every requested campaign succeeds. */
|
|
5949
|
+
success: boolean;
|
|
5950
|
+
campaignIds: string[];
|
|
5951
|
+
succeededCount: number;
|
|
5952
|
+
failedCount: number;
|
|
5953
|
+
results: {
|
|
5954
|
+
success: boolean;
|
|
5955
|
+
campaignId: string;
|
|
5956
|
+
error?: string;
|
|
5957
|
+
}[];
|
|
3439
5958
|
};
|
|
3440
5959
|
};
|
|
3441
5960
|
};
|
|
3442
|
-
/** @description Invalid
|
|
5961
|
+
/** @description Invalid campaign payload or plan state. */
|
|
3443
5962
|
400: {
|
|
3444
5963
|
headers: {
|
|
3445
5964
|
[name: string]: unknown;
|
|
@@ -3453,28 +5972,120 @@ interface operations {
|
|
|
3453
5972
|
};
|
|
3454
5973
|
content?: never;
|
|
3455
5974
|
};
|
|
3456
|
-
/** @description
|
|
3457
|
-
|
|
5975
|
+
/** @description Forbidden: missing `promotions:write` scope, or a session member without organization-wide access */
|
|
5976
|
+
403: {
|
|
3458
5977
|
headers: {
|
|
3459
5978
|
[name: string]: unknown;
|
|
3460
5979
|
};
|
|
3461
5980
|
content?: never;
|
|
3462
5981
|
};
|
|
3463
|
-
/** @description
|
|
5982
|
+
/** @description Rate limit exceeded */
|
|
5983
|
+
429: {
|
|
5984
|
+
headers: {
|
|
5985
|
+
[name: string]: unknown;
|
|
5986
|
+
};
|
|
5987
|
+
content?: never;
|
|
5988
|
+
};
|
|
5989
|
+
/** @description Internal Server Error */
|
|
5990
|
+
500: {
|
|
5991
|
+
headers: {
|
|
5992
|
+
[name: string]: unknown;
|
|
5993
|
+
};
|
|
5994
|
+
content?: never;
|
|
5995
|
+
};
|
|
5996
|
+
};
|
|
5997
|
+
};
|
|
5998
|
+
get_v1_campaigns_options: {
|
|
5999
|
+
parameters: {
|
|
6000
|
+
query?: {
|
|
6001
|
+
/** @description Optional organization scope for session-authenticated calls. OAuth client credentials resolve the organization from the token. */
|
|
6002
|
+
organizationId?: string;
|
|
6003
|
+
};
|
|
6004
|
+
header?: never;
|
|
6005
|
+
path?: never;
|
|
6006
|
+
cookie?: never;
|
|
6007
|
+
};
|
|
6008
|
+
requestBody?: never;
|
|
6009
|
+
responses: {
|
|
6010
|
+
/** @description Members and connected stores. */
|
|
6011
|
+
200: {
|
|
6012
|
+
headers: {
|
|
6013
|
+
[name: string]: unknown;
|
|
6014
|
+
};
|
|
6015
|
+
content: {
|
|
6016
|
+
"application/json": {
|
|
6017
|
+
/** @description Organization members. Use `id` for `ownerId` and `approverId`. */
|
|
6018
|
+
members: {
|
|
6019
|
+
id: string;
|
|
6020
|
+
name: string;
|
|
6021
|
+
email: string;
|
|
6022
|
+
}[];
|
|
6023
|
+
/** @description Connected stores for `brief.stores`. */
|
|
6024
|
+
stores: {
|
|
6025
|
+
/** @enum {string} */
|
|
6026
|
+
marketplace:
|
|
6027
|
+
| "shopify"
|
|
6028
|
+
| "shopee"
|
|
6029
|
+
| "lazada"
|
|
6030
|
+
| "tiktok"
|
|
6031
|
+
| "whatsapp"
|
|
6032
|
+
| "zalora"
|
|
6033
|
+
| "amazon"
|
|
6034
|
+
| "ebay";
|
|
6035
|
+
country: string;
|
|
6036
|
+
storeId: string;
|
|
6037
|
+
storeName: string;
|
|
6038
|
+
isDefaultPublish?: boolean;
|
|
6039
|
+
dbsHazmatApproved?: boolean;
|
|
6040
|
+
}[];
|
|
6041
|
+
/** @description Connected stores for offer `promotion.targetStores`. */
|
|
6042
|
+
promotionStores: {
|
|
6043
|
+
/** @enum {string} */
|
|
6044
|
+
marketplace:
|
|
6045
|
+
| "lazada"
|
|
6046
|
+
| "shopee"
|
|
6047
|
+
| "tiktok"
|
|
6048
|
+
| "shopify"
|
|
6049
|
+
| "amazon"
|
|
6050
|
+
| "zalora"
|
|
6051
|
+
| "ebay";
|
|
6052
|
+
country: string;
|
|
6053
|
+
storeId: string;
|
|
6054
|
+
storeName?: string;
|
|
6055
|
+
currency?: string | null;
|
|
6056
|
+
}[];
|
|
6057
|
+
};
|
|
6058
|
+
};
|
|
6059
|
+
};
|
|
6060
|
+
/** @description Invalid campaign payload or plan state. */
|
|
6061
|
+
400: {
|
|
6062
|
+
headers: {
|
|
6063
|
+
[name: string]: unknown;
|
|
6064
|
+
};
|
|
6065
|
+
content?: never;
|
|
6066
|
+
};
|
|
6067
|
+
/** @description Unauthorized */
|
|
6068
|
+
401: {
|
|
6069
|
+
headers: {
|
|
6070
|
+
[name: string]: unknown;
|
|
6071
|
+
};
|
|
6072
|
+
content?: never;
|
|
6073
|
+
};
|
|
6074
|
+
/** @description Forbidden: missing `promotions:write` scope, or a session member without organization-wide access */
|
|
3464
6075
|
403: {
|
|
3465
6076
|
headers: {
|
|
3466
6077
|
[name: string]: unknown;
|
|
3467
6078
|
};
|
|
3468
6079
|
content?: never;
|
|
3469
6080
|
};
|
|
3470
|
-
/** @description
|
|
3471
|
-
|
|
6081
|
+
/** @description Rate limit exceeded */
|
|
6082
|
+
429: {
|
|
3472
6083
|
headers: {
|
|
3473
6084
|
[name: string]: unknown;
|
|
3474
6085
|
};
|
|
3475
6086
|
content?: never;
|
|
3476
6087
|
};
|
|
3477
|
-
/** @description Internal
|
|
6088
|
+
/** @description Internal Server Error */
|
|
3478
6089
|
500: {
|
|
3479
6090
|
headers: {
|
|
3480
6091
|
[name: string]: unknown;
|
|
@@ -12946,6 +15557,41 @@ interface operations {
|
|
|
12946
15557
|
* `get`/`list`/`create`-style names.
|
|
12947
15558
|
*/
|
|
12948
15559
|
|
|
15560
|
+
declare class AgentsGeneralClient {
|
|
15561
|
+
protected readonly _http: OmniHttp;
|
|
15562
|
+
constructor(_http: OmniHttp);
|
|
15563
|
+
/**
|
|
15564
|
+
* Invoke the Omni agent
|
|
15565
|
+
*
|
|
15566
|
+
* Run the general Omni agent and wait until it completes, pauses for approval, or fails. Requires `agents:invoke`.
|
|
15567
|
+
|
|
15568
|
+
A waiting call can take several minutes; raise the client timeout. Send `decisions` with the same `thread_id` to approve or reject a paused run. Omit `config.enabled_tools` to use the organization's agent tools. Attach images on the latest user message as `{ type: "image", url }` HTTP(S) URLs.
|
|
15569
|
+
*
|
|
15570
|
+
* `POST /api/v1/agents/general/invoke`
|
|
15571
|
+
*/
|
|
15572
|
+
invoke(request: OperationBody<operations["post_v1_agents_general_invoke"]>, requestOptions?: BaseRequestOptions): HttpResponsePromise<SuccessData<operations["post_v1_agents_general_invoke"]>>;
|
|
15573
|
+
/**
|
|
15574
|
+
* Start an Omni agent run
|
|
15575
|
+
*
|
|
15576
|
+
* Queue the general Omni agent and return immediately with the run in `queued` state. Poll the URL in the `Location` header (`GET /api/v1/agents/general/runs/{runId}`), honoring `Retry-After`. Requires `agents:invoke`. The request body matches invoke.
|
|
15577
|
+
*
|
|
15578
|
+
* `POST /api/v1/agents/general/runs`
|
|
15579
|
+
*/
|
|
15580
|
+
start(request: OperationBody<operations["post_v1_agents_general_runs"]>, requestOptions?: BaseRequestOptions): HttpResponsePromise<SuccessData<operations["post_v1_agents_general_runs"]>>;
|
|
15581
|
+
/**
|
|
15582
|
+
* Get an Omni agent run
|
|
15583
|
+
*
|
|
15584
|
+
* Read a queued, running, completed, paused, or failed Omni agent run. Requires `agents:invoke`.
|
|
15585
|
+
*
|
|
15586
|
+
* `GET /api/v1/agents/general/runs/{runId}`
|
|
15587
|
+
*/
|
|
15588
|
+
getRun(request: OperationPath<operations["get_v1_agents_general_runs_by_runid"]> & OperationQuery<operations["get_v1_agents_general_runs_by_runid"]>, requestOptions?: BaseRequestOptions): HttpResponsePromise<SuccessData<operations["get_v1_agents_general_runs_by_runid"]>>;
|
|
15589
|
+
}
|
|
15590
|
+
declare class AgentsClient {
|
|
15591
|
+
protected readonly _http: OmniHttp;
|
|
15592
|
+
readonly general: AgentsGeneralClient;
|
|
15593
|
+
constructor(_http: OmniHttp);
|
|
15594
|
+
}
|
|
12949
15595
|
declare class AopClient {
|
|
12950
15596
|
protected readonly _http: OmniHttp;
|
|
12951
15597
|
constructor(_http: OmniHttp);
|
|
@@ -13010,6 +15656,74 @@ declare class ApiClient {
|
|
|
13010
15656
|
*/
|
|
13011
15657
|
v1(requestOptions?: BaseRequestOptions): HttpResponsePromise<SuccessData<operations["get_v1"]>>;
|
|
13012
15658
|
}
|
|
15659
|
+
declare class CampaignsClient {
|
|
15660
|
+
protected readonly _http: OmniHttp;
|
|
15661
|
+
constructor(_http: OmniHttp);
|
|
15662
|
+
/**
|
|
15663
|
+
* List Campaigns
|
|
15664
|
+
*
|
|
15665
|
+
* List campaigns for the authenticated organization. `stage=all` is the workspace working set: draft and running. Requires `promotions:read`.
|
|
15666
|
+
*
|
|
15667
|
+
* `GET /api/v1/campaigns`
|
|
15668
|
+
*/
|
|
15669
|
+
list(request?: OperationQuery<operations["get_v1_campaigns"]>, requestOptions?: BaseRequestOptions): HttpResponsePromise<SuccessData<operations["get_v1_campaigns"]>>;
|
|
15670
|
+
/**
|
|
15671
|
+
* Create Campaign
|
|
15672
|
+
*
|
|
15673
|
+
* Create a draft campaign. `ownerId` and `approverId` must be members of the organization, and every store must already be connected. Requires `promotions:write`.
|
|
15674
|
+
*
|
|
15675
|
+
* `POST /api/v1/campaigns`
|
|
15676
|
+
*/
|
|
15677
|
+
create(request: OperationBody<operations["post_v1_campaigns"]>, requestOptions?: BaseRequestOptions): HttpResponsePromise<SuccessData<operations["post_v1_campaigns"]>>;
|
|
15678
|
+
/**
|
|
15679
|
+
* Get Campaign
|
|
15680
|
+
*
|
|
15681
|
+
* Read one campaign, including its plan, executions, audit, schedule, and progress. Requires `promotions:read`.
|
|
15682
|
+
*
|
|
15683
|
+
* `GET /api/v1/campaigns/{campaignId}`
|
|
15684
|
+
*/
|
|
15685
|
+
get(request: OperationPath<operations["get_v1_campaigns_by_campaignid"]> & OperationQuery<operations["get_v1_campaigns_by_campaignid"]>, requestOptions?: BaseRequestOptions): HttpResponsePromise<SuccessData<operations["get_v1_campaigns_by_campaignid"]>>;
|
|
15686
|
+
/**
|
|
15687
|
+
* Update Campaign
|
|
15688
|
+
*
|
|
15689
|
+
* Replace a draft or approved plan, or propose one change to a running plan. Send `expectedRevision` from the last read. Requires `promotions:write`.
|
|
15690
|
+
*
|
|
15691
|
+
* `PUT /api/v1/campaigns/{campaignId}`
|
|
15692
|
+
*/
|
|
15693
|
+
replace(request: OperationPath<operations["put_v1_campaigns_by_campaignid"]> & OperationBody<operations["put_v1_campaigns_by_campaignid"]>, requestOptions?: BaseRequestOptions): HttpResponsePromise<SuccessData<operations["put_v1_campaigns_by_campaignid"]>>;
|
|
15694
|
+
/**
|
|
15695
|
+
* Act on Campaign
|
|
15696
|
+
*
|
|
15697
|
+
* Approve, start, end, resume, retry, or decide a proposed live change. Approve, run, resume, and approving a change must be called by the named approver. Requires `promotions:write`.
|
|
15698
|
+
*
|
|
15699
|
+
* `POST /api/v1/campaigns/{campaignId}/actions`
|
|
15700
|
+
*/
|
|
15701
|
+
actions(request: OperationPath<operations["post_v1_campaigns_by_campaignid_actions"]> & OperationBody<operations["post_v1_campaigns_by_campaignid_actions"]>, requestOptions?: BaseRequestOptions): HttpResponsePromise<SuccessData<operations["post_v1_campaigns_by_campaignid_actions"]>>;
|
|
15702
|
+
/**
|
|
15703
|
+
* Archive Campaigns
|
|
15704
|
+
*
|
|
15705
|
+
* Archive campaigns, or restore archived campaigns by id or by the current archived list filters. Requires `promotions:write`.
|
|
15706
|
+
*
|
|
15707
|
+
* `POST /api/v1/campaigns/archive`
|
|
15708
|
+
*/
|
|
15709
|
+
archive(request: OperationBody<operations["post_v1_campaigns_archive"]>, requestOptions?: BaseRequestOptions): HttpResponsePromise<SuccessData<operations["post_v1_campaigns_archive"]>>;
|
|
15710
|
+
/**
|
|
15711
|
+
* Delete Campaigns
|
|
15712
|
+
*
|
|
15713
|
+
* Permanently delete archived campaigns by explicit id or by archived list filters. Requires `promotions:write`.
|
|
15714
|
+
*
|
|
15715
|
+
* `POST /api/v1/campaigns/delete`
|
|
15716
|
+
*/
|
|
15717
|
+
delete(request: OperationBody<operations["post_v1_campaigns_delete"]>, requestOptions?: BaseRequestOptions): HttpResponsePromise<SuccessData<operations["post_v1_campaigns_delete"]>>;
|
|
15718
|
+
/**
|
|
15719
|
+
* Get Campaign Options
|
|
15720
|
+
*
|
|
15721
|
+
* List the organization members and connected stores a campaign plan can name. Use a member `id` for `ownerId` and `approverId`. Requires `promotions:write`.
|
|
15722
|
+
*
|
|
15723
|
+
* `GET /api/v1/campaigns/options`
|
|
15724
|
+
*/
|
|
15725
|
+
getOptions(request?: OperationQuery<operations["get_v1_campaigns_options"]>, requestOptions?: BaseRequestOptions): HttpResponsePromise<SuccessData<operations["get_v1_campaigns_options"]>>;
|
|
15726
|
+
}
|
|
13013
15727
|
declare class CatalogClient {
|
|
13014
15728
|
protected readonly _http: OmniHttp;
|
|
13015
15729
|
constructor(_http: OmniHttp);
|
|
@@ -13939,8 +16653,10 @@ declare class ZaloraClient {
|
|
|
13939
16653
|
}
|
|
13940
16654
|
declare class OmniGeneratedClient {
|
|
13941
16655
|
protected readonly _http: OmniHttp;
|
|
16656
|
+
readonly agents: AgentsClient;
|
|
13942
16657
|
readonly aop: AopClient;
|
|
13943
16658
|
readonly api: ApiClient;
|
|
16659
|
+
readonly campaigns: CampaignsClient;
|
|
13944
16660
|
readonly catalog: CatalogClient;
|
|
13945
16661
|
readonly checkoutSessions: CheckoutSessionsClient;
|
|
13946
16662
|
readonly compare: CompareClient;
|
|
@@ -13972,8 +16688,10 @@ declare class OmniGeneratedClient {
|
|
|
13972
16688
|
constructor(_http: OmniHttp);
|
|
13973
16689
|
}
|
|
13974
16690
|
type OmniResources = {
|
|
16691
|
+
agents: AgentsClient;
|
|
13975
16692
|
aop: AopClient;
|
|
13976
16693
|
api: ApiClient;
|
|
16694
|
+
campaigns: CampaignsClient;
|
|
13977
16695
|
catalog: CatalogClient;
|
|
13978
16696
|
checkoutSessions: CheckoutSessionsClient;
|
|
13979
16697
|
compare: CompareClient;
|
|
@@ -14045,7 +16763,7 @@ declare function constructEvent(payload: string | Uint8Array, headers: WebhookHe
|
|
|
14045
16763
|
toleranceInSeconds?: number;
|
|
14046
16764
|
}): Promise<ConstructedWebhookEvent>;
|
|
14047
16765
|
|
|
14048
|
-
declare const SDK_VERSION = "0.
|
|
16766
|
+
declare const SDK_VERSION = "0.2.0";
|
|
14049
16767
|
|
|
14050
16768
|
type ProductCreatedWebhookEvent = components["schemas"]["ProductCreatedWebhookEvent"];
|
|
14051
16769
|
type ProductUpdatedWebhookEvent = components["schemas"]["ProductUpdatedWebhookEvent"];
|