@agentforge-io/sdk-server 4.69.0 → 4.71.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.d.ts CHANGED
@@ -6,7 +6,7 @@ export { BillingResource } from './resources/billing';
6
6
  export type { BillingEntitlement, BillingEntitlementStatus, BillingInterval, BillingLimits, BillingPlan, BillingInvoice, BillingPaymentMethod, BillingCheckoutInput, BillingStartTrialInput, AppBillingWebhookEvent, AppBillingWebhookEventName, AppBillingWebhookData, } from './resources/billing';
7
7
  export { APP_WEBHOOK_HEADERS, TOOL_CALLBACK_HEADERS, ToolCallbackSignatureError, signToolCallbackPayload, verifyAppWebhook, verifyToolCallbackSignature, } from './webhooks';
8
8
  export { WebhookResource, type SetAppWebhookInput } from './resources/webhook';
9
- export type { AppWebhook, AppWebhookEvent, AppWebhookEventName, AppCaseWebhookEvent, AppCaseWebhookEventName, AppConversationMessageWebhookEvent, AppChannelStatusWebhookEvent, AgentMe, AgentSummary, AppUserConnectorStatus, ApprovalCopyBundle, ChannelContext, ChatStreamChunk, ChatStreamEvent, ChatTokenRecord, ConnectorDefaultsResult, ConnectorDefaultsSource, ConnectorResourceItem, ConnectorStatus, ConnectorToolInfo, ConversationHistory, ConversationStatus, CreateAgentInput, CreateClickupTaskInput, CreateClickupTaskResult, ExternalToolSummary, IssueChatTokenInput, ListAgentsResult, ListConnectorResourcesResult, McpServerConfig, MessageRecord, MessageRole, PublicAppBranding, PublicProfileBlock, PublicProfileTemplate, PublicTeamLanding, CreateTeamInput, UpdateTeamInput, TeamSummary, TeamDetail, TeamTheme, TeamBusinessHours, TeamWeekday, TeamProfileBlock, ProfileBlockPlacement, ProfileBlockPosition, CatalogBlockPreview, AppInstallation, TemplateConfigField, TemplateSummary, TemplateDetail, TemplateInstallStats, TemplatePublisher, TemplateAuthor, AppTemplatePolicy, TemplateCategoryRef, MarketplaceCategory, MarketplaceCategoryGroup, MarketplaceLocale, TemplateInstallResult, UpsertSystemTemplateInput, UpsertSystemTemplateResult, TemplateReview, TemplateRatingSummary, TemplateReviewsPage, BusinessReview, BusinessReviewsPage, ProductRatingSummary, ProductReview, ProductReviewOwner, ProductReviewsPage, ProductReviewsOwnerPage, ListProductReviewsInput, ListProductReviewsForOwnerInput, HideProductReviewInput, ProductLikeResult, ReceiptReviewable, ReceiptReviewables, SaveReceiptReviewInput, ListTemplateReviewsInput, SaveTemplateReviewInput, TemplateReportKind, CreateTemplateReportInput, TenantConfigEntry, Place, PlaceSuggestion, SearchPlacesInput, AutocompletePlacesInput, PlacesScope, CaseField, CaseBusinessState, CaseType, CaseState, CaseStateType, CasePayment, CasePaymentAccount, CasePaymentStatus, CaseReceiptPayment, CaseDestination, CaseView, CaseStateStep, CreateDirectOrderInput, CreateDirectBookingInput, MoveCaseSlotInput, CaseSlot, CatalogAttendedAt, CatalogBookingRule, CaseOrigin, CaseOriginChannel, DirectOrderForm, DirectPaymentOption, CaseClosingMethod, CaseClosingOrder, CaseClosingReport, CaseReportPage, CaseReceipt, CaseReceiptLine, CaseProposal, CaseProposalAnswer, CaseProposalChange, CaseProposalInput, ListCasesInput, AddressValue, DeliveryLocalPricing, DeliverySettings, PaymentMethodKind, PaymentSettings, PaymentSettingsInput, PaymentAccount, PaymentCountry, PaymentFieldDef, PaymentMethodDef, StructuredConfigInput, StructuredConfigEntry, DeliveryQuoteStatus, DeliveryQuoteInput, DeliveryPricePreview, DeliveryPricingPreview, DeliveryPricingPreviewInput, DeliveryRoute, DeliveryRouteInput, DeliveryQuote, AppSelf, AppOwner, AppSelfConnector, AppSelfConnectors, AppSelfConnectorTools, AppSelfConnectorToolsResponse, RegisterToolInput, RegisterToolsInput, BusinessRoleEntry, Catalog, CatalogCheckoutCta, CatalogCategory, CatalogProduct, CatalogProductPhoto, CatalogProductKind, CatalogProductStatus, CatalogPriceKind, CatalogAvailability, CatalogLockableField, CatalogProductPage, UpsertCatalogInput, CreateCatalogCategoryInput, UpdateCatalogCategoryInput, CreateCatalogProductInput, UpdateCatalogProductInput, ListCatalogProductsInput, CatalogPhotoUploadTarget, SignCatalogPhotoUploadInput, AttachCatalogPhotoInput, AttachCatalogCategoryImageInput, CatalogImportItem, CatalogImportPreview, CatalogImportApplyResult, CatalogFileMapping, CatalogFilePlan, CatalogFilePreview, CatalogFileApplyResult, CatalogFileInput, CatalogFilePreviewInput, CatalogMenuItem, CatalogMenuRead, CatalogMenuReadInput, CatalogMenuAttachInput, CatalogMenuChatFile, CatalogMenuKeepInSyncInput, CatalogMenuKeepInSyncResult, CatalogOption, CatalogOptionGroup, SaveCatalogOptionGroupInput, CatalogOptionChoice, CatalogOptionChange, CatalogOptionChangesPlan, CatalogUnit, SaveCatalogUnitInput, CatalogSaleRule, CatalogFileApplyInput, CatalogFileErrorCode, CatalogImportSourceStatus, CatalogImportColumnMapping, CatalogImportRunResult, CatalogImportSource, CreateCatalogImportSourceInput, UpdateCatalogImportSourceInput, PreviewCatalogImportSourceInput, CatalogImportSourcePreview, CatalogSheetTab, CatalogTemplateSheet, CreateCatalogTemplateSheetInput, GoogleSheetsPickerInput, GoogleSheetsPickerSession, GoogleSheetsPickerErrorCode, GoogleSheetsPickerResult, RegisterToolsResult, ToolCallbackPayload, ToolCallRecord, ToolPermission, ToolPermissionMode, TokenUsage, TenantSecretEntry, UpdateAgentInput, InboxThreadMode, InboxMessageDirection, InboxMessageSource, InboxMessageType, InboxThreadCustomerProfileView, InboxThreadView, InboxMessageView, SupportKpiTotals, SupportKpiResponse, AgentAttentionLogRow, } from './types';
9
+ export type { AppWebhook, AppWebhookEvent, AppWebhookEventName, AppCaseWebhookEvent, AppCaseWebhookEventName, AppConversationMessageWebhookEvent, AppChannelStatusWebhookEvent, AgentMe, AgentSummary, AppUserConnectorStatus, ApprovalCopyBundle, ChannelContext, ChatStreamChunk, ChatStreamEvent, ChatTokenRecord, ConnectorDefaultsResult, ConnectorDefaultsSource, ConnectorResourceItem, ConnectorStatus, ConnectorToolInfo, ConversationHistory, ConversationStatus, CreateAgentInput, CreateClickupTaskInput, CreateClickupTaskResult, ExternalToolSummary, IssueChatTokenInput, ListAgentsResult, ListConnectorResourcesResult, McpServerConfig, MessageRecord, MessageRole, PublicAppBranding, PublicProfileBlock, PublicProfileTemplate, PublicTeamLanding, CreateTeamInput, UpdateTeamInput, TeamSummary, TeamDetail, TeamTheme, TeamBusinessHours, TeamWeekday, TeamProfileBlock, ProfileBlockPlacement, ProfileBlockPosition, CatalogBlockPreview, ServiceCta, ServiceCtaAction, CatalogServicesBlockConfig, AppInstallation, TemplateConfigField, TemplateSummary, TemplateDetail, TemplateInstallStats, TemplatePublisher, TemplateAuthor, AppTemplatePolicy, TemplateCategoryRef, MarketplaceCategory, MarketplaceCategoryGroup, MarketplaceLocale, TemplateInstallResult, UpsertSystemTemplateInput, UpsertSystemTemplateResult, TemplateReview, TemplateRatingSummary, TemplateReviewsPage, BusinessReview, BusinessReviewsPage, ProductRatingSummary, ProductReview, ProductReviewOwner, ProductReviewsPage, ProductReviewsOwnerPage, ListProductReviewsInput, ListProductReviewsForOwnerInput, HideProductReviewInput, ProductLikeResult, ReceiptReviewable, ReceiptReviewables, SaveReceiptReviewInput, ListTemplateReviewsInput, SaveTemplateReviewInput, TemplateReportKind, CreateTemplateReportInput, TenantConfigEntry, Place, PlaceSuggestion, SearchPlacesInput, AutocompletePlacesInput, PlacesScope, CaseField, CaseBusinessState, CaseType, CaseState, CaseStateType, CasePayment, CasePaymentAccount, CasePaymentStatus, CaseReceiptPayment, CaseDestination, CaseView, CaseStateStep, CreateDirectOrderInput, CreateOpenOrderInput, OpenOrderLine, CreateDirectBookingInput, MoveCaseSlotInput, CaseSlot, CatalogAttendedAt, CatalogBookingRule, CaseOrigin, CaseOriginChannel, DirectOrderForm, DirectPaymentOption, CaseClosingMethod, CaseClosingOrder, CaseClosingReport, CaseReportPage, CaseReceipt, CaseReceiptLine, CaseProposal, CaseProposalAnswer, CaseProposalChange, CaseProposalInput, ListCasesInput, AddressValue, DeliveryLocalPricing, DeliverySettings, PaymentMethodKind, PaymentSettings, PaymentSettingsInput, PaymentAccount, PaymentCountry, PaymentFieldDef, PaymentFieldDue, PaymentRequirements, PaymentMethodDef, StructuredConfigInput, StructuredConfigEntry, DeliveryQuoteStatus, DeliveryQuoteInput, DeliveryPricePreview, DeliveryPricingPreview, DeliveryPricingPreviewInput, DeliveryRoute, DeliveryRouteInput, DeliveryQuote, AppSelf, AppOwner, AppSelfConnector, AppSelfConnectors, AppSelfConnectorTools, AppSelfConnectorToolsResponse, RegisterToolInput, RegisterToolsInput, BusinessRoleEntry, Catalog, CatalogCheckoutCta, CatalogCategory, CatalogProduct, CatalogProductPhoto, CatalogProductKind, CatalogProductStatus, CatalogPriceKind, CatalogAvailability, CatalogLockableField, CatalogProductPage, UpsertCatalogInput, CreateCatalogCategoryInput, UpdateCatalogCategoryInput, CreateCatalogProductInput, UpdateCatalogProductInput, ListCatalogProductsInput, CatalogPhotoUploadTarget, SignCatalogPhotoUploadInput, AttachCatalogPhotoInput, AttachCatalogCategoryImageInput, CatalogImportItem, CatalogImportPreview, CatalogImportApplyResult, CatalogFileMapping, CatalogFilePlan, CatalogFilePreview, CatalogFileApplyResult, CatalogFileInput, CatalogFilePreviewInput, CatalogMenuItem, CatalogMenuRead, CatalogMenuReadInput, CatalogMenuAttachInput, CatalogMenuChatFile, CatalogMenuKeepInSyncInput, CatalogMenuKeepInSyncResult, CatalogOption, CatalogOptionGroup, SaveCatalogOptionGroupInput, CatalogOptionChoice, CatalogOptionChange, CatalogOptionChangesPlan, CatalogUnit, SaveCatalogUnitInput, CatalogSaleRule, CatalogFileApplyInput, CatalogFileErrorCode, CatalogImportSourceStatus, CatalogImportColumnMapping, CatalogImportRunResult, CatalogImportSource, CreateCatalogImportSourceInput, UpdateCatalogImportSourceInput, PreviewCatalogImportSourceInput, CatalogImportSourcePreview, CatalogSheetTab, CatalogTemplateSheet, CreateCatalogTemplateSheetInput, GoogleSheetsPickerInput, GoogleSheetsPickerSession, GoogleSheetsPickerErrorCode, GoogleSheetsPickerResult, RegisterToolsResult, ToolCallbackPayload, ToolCallRecord, ToolPermission, ToolPermissionMode, TokenUsage, TenantSecretEntry, UpdateAgentInput, InboxThreadMode, InboxMessageDirection, InboxMessageSource, InboxMessageType, InboxThreadCustomerProfileView, InboxThreadView, InboxMessageView, SupportKpiTotals, SupportKpiResponse, AgentAttentionLogRow, } from './types';
10
10
  export { AgentsResource } from './resources/agents';
11
11
  export { AnalyticsResource } from './resources/analytics';
12
12
  export type { GetSupportKpisInput, GetAgentAttentionLogInput, } from './resources/analytics';
@@ -1,5 +1,5 @@
1
1
  import type { AgentForgeClient } from '../client';
2
- import type { CaseClosingReport, CaseProposalAnswer, CaseProposalInput, CaseReportPage, CasePaymentStatus, CaseReceipt, CaseState, CaseView, CreateDirectBookingInput, CreateDirectOrderInput, DirectOrderForm, ListCasesInput, MoveCaseSlotInput, ProductReview, ReceiptReviewables, SaveReceiptReviewInput } from '../types';
2
+ import type { CaseClosingReport, CaseProposalAnswer, CaseProposalInput, CaseReportPage, CasePaymentStatus, CaseReceipt, CaseState, CaseView, CreateDirectBookingInput, CreateDirectOrderInput, CreateOpenOrderInput, DirectOrderForm, ListCasesInput, MoveCaseSlotInput, ProductReview, ReceiptReviewables, SaveReceiptReviewInput } from '../types';
3
3
  export declare class CasesResource {
4
4
  private readonly client;
5
5
  constructor(client: AgentForgeClient);
@@ -135,8 +135,12 @@ export declare class CasesResource {
135
135
  * assistant cannot answer). Created already sent: units held, receipt issued,
136
136
  * `case.submitted` fired — the business sees it in its requests like any other.
137
137
  * 400 for a bad order or missing fields, 409 when a product lacks stock.
138
+ *
139
+ * PDK-ORDER-INVITE — with `CreateOpenOrderInput` (`origin: { channel: 'link', place: 'open-order' }` +
140
+ * `freeLines` + `totalCents` + `state: 'confirmed'`) it creates an open order instead: free-text lines,
141
+ * the typed total, born `confirmed`, no stock holds.
138
142
  */
139
- createDirect(input: CreateDirectOrderInput): Promise<CaseView>;
143
+ createDirect(input: CreateDirectOrderInput | CreateOpenOrderInput): Promise<CaseView>;
140
144
  /**
141
145
  * `POST /api/v1/cases/bookings` — AGF-AGENDA: a booking from your App's agenda
142
146
  * (hold the time in your own ledger first). Created sent (`submitted`), or
@@ -194,6 +194,10 @@ class CasesResource {
194
194
  * assistant cannot answer). Created already sent: units held, receipt issued,
195
195
  * `case.submitted` fired — the business sees it in its requests like any other.
196
196
  * 400 for a bad order or missing fields, 409 when a product lacks stock.
197
+ *
198
+ * PDK-ORDER-INVITE — with `CreateOpenOrderInput` (`origin: { channel: 'link', place: 'open-order' }` +
199
+ * `freeLines` + `totalCents` + `state: 'confirmed'`) it creates an open order instead: free-text lines,
200
+ * the typed total, born `confirmed`, no stock holds.
197
201
  */
198
202
  async createDirect(input) {
199
203
  return this.client.request('POST', '/api/v1/cases/direct', input);
package/dist/types.d.ts CHANGED
@@ -809,6 +809,48 @@ export interface ProfileBlockPlacement {
809
809
  export type ProfileBlockPosition = 'top-left' | 'top-center' | 'top-right' | 'middle-left' | 'middle-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
810
810
  /** Products a catalog block draws inline; the rest sit behind «Ver todo». Absent = `'all'`. */
811
811
  export type CatalogBlockPreview = 3 | 6 | 9 | 12 | 'all';
812
+ /** PDK-SERVICES — what a service's button does. */
813
+ export type ServiceCtaAction = 'book' | 'request' | 'cart' | 'chat' | 'whatsapp' | 'link';
814
+ /**
815
+ * PDK-SERVICES — a service's call to action (`CatalogProduct.cta`; only `kind: 'service'`).
816
+ * `label` 2–28 chars (trimmed; absent = the action's default), `helper` <= 60 chars,
817
+ * `value`: https URL (required for `link`) or a phone normalized to `+E.164` (optional for `whatsapp`,
818
+ * absent = the business's number); ignored for the other actions.
819
+ */
820
+ export interface ServiceCta {
821
+ action: ServiceCtaAction;
822
+ label?: string;
823
+ value?: string;
824
+ /** Show the price inside the button. */
825
+ showPrice?: boolean;
826
+ helper?: string;
827
+ }
828
+ /**
829
+ * PDK-SERVICES — presentation of the catalog block's «Servicios» tab. Every field is optional; an invalid
830
+ * value is dropped by the platform (not refused) and the reader's default applies.
831
+ */
832
+ export interface CatalogServicesBlockConfig {
833
+ /** Default `feed`. */
834
+ layout?: 'feed' | 'cards' | 'list' | 'carousel';
835
+ mediaRatio?: '4:5' | '1:1' | '16:9';
836
+ /** On the photo, inside the button, or under the title. */
837
+ pricePlacement?: 'media' | 'button' | 'title';
838
+ /** 0–4. */
839
+ descriptionLines?: number;
840
+ showHeader?: boolean;
841
+ showReactions?: boolean;
842
+ showDuration?: boolean;
843
+ showRating?: boolean;
844
+ /** Default button for every service of the page; a service's own `cta` wins. No `value`. */
845
+ cta?: Omit<ServiceCta, 'value'>;
846
+ /** Tab names, <= 24 chars each. */
847
+ tabLabels?: {
848
+ products?: string;
849
+ services?: string;
850
+ };
851
+ /** Default `products-first`. */
852
+ tabOrder?: 'products-first' | 'services-first';
853
+ }
812
854
  /** One block of a public page. `id` is minted by the platform when omitted. */
813
855
  export type TeamProfileBlock = {
814
856
  id?: string;
@@ -857,6 +899,7 @@ export type TeamProfileBlock = {
857
899
  kind: 'catalog';
858
900
  catalogId: string;
859
901
  preview?: CatalogBlockPreview;
902
+ services?: CatalogServicesBlockConfig;
860
903
  [field: string]: unknown;
861
904
  }
862
905
  /**
@@ -876,6 +919,7 @@ export type TeamProfileBlock = {
876
919
  serviceIds?: string[];
877
920
  customerPicksMember?: boolean;
878
921
  layout?: 'chips' | 'list';
922
+ startWith?: 'service' | 'time';
879
923
  });
880
924
  /** `GET /api/v1/teams/:id` — the team with its page settings, and its members. */
881
925
  export interface TeamDetail {
@@ -1294,6 +1338,8 @@ export interface CatalogProduct {
1294
1338
  saleRule?: CatalogSaleRule | null;
1295
1339
  /** AGF-AGENDA — a service's duration and buffer; null = not bookable. */
1296
1340
  booking?: CatalogBookingRule | null;
1341
+ /** PDK-SERVICES — a service's button; null = the default rule. Only `kind: 'service'`. */
1342
+ cta?: ServiceCta | null;
1297
1343
  lastSoldAt?: string | null;
1298
1344
  demandCount: number;
1299
1345
  /** AGF-PDK-PRODUCT-REVIEWS — over the visible reviews (absent on an older platform). */
@@ -1329,6 +1375,9 @@ export interface CreateCatalogProductInput {
1329
1375
  /** AGF-AGENDA — a service's `{ durationMinutes, bufferMinutes? }`; null makes it not bookable.
1330
1376
  * Only `kind: 'service'` (400 NOT_A_SERVICE), 5–720 and 0–120 minutes (400 INVALID_BOOKING). */
1331
1377
  booking?: CatalogBookingRule | null;
1378
+ /** PDK-SERVICES — a service's button `{ action, label?, value?, showPrice?, helper? }`; null clears it.
1379
+ * Only `kind: 'service'` (400 NOT_A_SERVICE); invalid values 400 INVALID_CTA. Turning the item into a product drops it. */
1380
+ cta?: ServiceCta | null;
1332
1381
  }
1333
1382
  export interface UpdateCatalogProductInput extends Partial<CreateCatalogProductInput> {
1334
1383
  sortOrder?: number;
@@ -2053,12 +2102,21 @@ export interface DeliverySettings {
2053
2102
  export type PaymentMethodKind = 'cash' | 'bank_transfer' | 'card_on_delivery' | 'payment_link' | 'card_in_store' | 'other';
2054
2103
  /** AGF-PAYMENT-ACCOUNTS — countries with a payment catalog. */
2055
2104
  export type PaymentCountry = 'CO';
2105
+ /**
2106
+ * PDK-ORDER-PARTICIPANTS D8 — when a field is due (progressive requirements). `save`: the account cannot be
2107
+ * saved without it; `offer`: saved, but not offered to customers until present; `eventually`: saved and offered,
2108
+ * shown to the business as a pending item. Absent: optional.
2109
+ */
2110
+ export type PaymentFieldDue = 'save' | 'offer' | 'eventually';
2056
2111
  /** A field an account of a method asks for. */
2057
2112
  export interface PaymentFieldDef {
2058
2113
  key: string;
2059
2114
  label: string;
2060
2115
  kind: 'text' | 'phone' | 'digits' | 'select' | 'bank';
2116
+ /** Derived from `due` (`due === 'save'`), kept for older clients. */
2061
2117
  required: boolean;
2118
+ /** When the field is due. Absent on an older platform: read `required`. */
2119
+ due?: PaymentFieldDue;
2062
2120
  /** `select` / `bank`: the options. */
2063
2121
  options?: Array<{
2064
2122
  value: string;
@@ -2094,6 +2152,13 @@ export interface PaymentAccount {
2094
2152
  when: 'before' | 'on_delivery';
2095
2153
  /** Paused without deleting. */
2096
2154
  active: boolean;
2155
+ /** PDK-ORDER-PARTICIPANTS D8 — what the account still lacks (field keys); read-only, set by the platform on read. */
2156
+ requirements?: PaymentRequirements;
2157
+ }
2158
+ /** Field keys an account still lacks. `currentlyDue` non-empty: the account is not offered to customers. */
2159
+ export interface PaymentRequirements {
2160
+ currentlyDue: string[];
2161
+ eventuallyDue: string[];
2097
2162
  }
2098
2163
  export interface PaymentSettings {
2099
2164
  locale?: 'es' | 'en';
@@ -2396,6 +2461,12 @@ export interface CasePaymentAccount {
2396
2461
  when: 'before' | 'on_delivery';
2397
2462
  /** "Nequi (Principal): 3001234567 a nombre de Ana Pérez". */
2398
2463
  line: string;
2464
+ /**
2465
+ * PDK-ORDER-PARTICIPANTS-S3b — `line` with the holder unmasked. Business reads only (cases API, never the
2466
+ * public receipt); present only when it differs from `line` (wallets / Bre-B with a titular). Prefer
2467
+ * `ownerLine ?? line` in the business's views.
2468
+ */
2469
+ ownerLine?: string;
2399
2470
  /** What to copy to pay (empty for cash / card terminal). */
2400
2471
  copy: Array<{
2401
2472
  label: string;
@@ -2502,6 +2573,11 @@ export interface CaseReceiptLine {
2502
2573
  coverUrl?: string;
2503
2574
  /** AGF-PRODUCT-SKU — the product's inventory code as it is now (absent: none, or an older platform). */
2504
2575
  sku?: string;
2576
+ /** PDK-ORDER-INVITE — open-order lines (free text: no `productId`, `unitCents` null, `priceKind` `on_request`).
2577
+ * `out`: not delivered («Agotado»), show it struck; `swapText`: delivered as this instead; `note`: the customer's note. */
2578
+ out?: true;
2579
+ swapText?: string;
2580
+ note?: string;
2505
2581
  }
2506
2582
  /** One option group's choice on a proposed alternative: the group and what was picked in it (ids, or names). */
2507
2583
  export interface CaseProposalSwapOption {
@@ -2600,6 +2676,8 @@ export interface CaseReceipt {
2600
2676
  distanceKm?: number;
2601
2677
  };
2602
2678
  totalCents: number | null;
2679
+ /** PDK-ORDER-INVITE — `totalCents` is the amount typed at dispatch (an open order), not Σ of the lines; final, delivery included. */
2680
+ totalManual?: true;
2603
2681
  currency: string | null;
2604
2682
  fields: Array<{
2605
2683
  label: string;
@@ -2721,6 +2799,67 @@ export interface CreateDirectOrderInput {
2721
2799
  */
2722
2800
  reopens?: string;
2723
2801
  }
2802
+ /** PDK-ORDER-INVITE — one free-text line of an open order (no catalog product, no unit price). */
2803
+ export interface OpenOrderLine {
2804
+ title: string;
2805
+ qty: number;
2806
+ unit?: string;
2807
+ note?: string;
2808
+ /** What dispatch decided: `ready` (delivered), `out` («Agotado»: not delivered), `swap` (delivered as `swapText`). */
2809
+ mark: 'ready' | 'out' | 'swap';
2810
+ /** Required with `mark: 'swap'`, refused otherwise. */
2811
+ swapText?: string;
2812
+ }
2813
+ /**
2814
+ * PDK-ORDER-INVITE — an OPEN ORDER: a free-form order a shopkeeper already dispatched (no catalog, no
2815
+ * unit prices), created in a business's tenant once it exists. Same endpoint as `CreateDirectOrderInput`;
2816
+ * the explicit opt-in is `origin = { channel: 'link', place: 'open-order' }` together with `freeLines`
2817
+ * (either one alone → 400). The case is born `confirmed` (dispatch made it final): no holds, no proposals,
2818
+ * no redo. The receipt shows `totalCents` exactly (`totalManual`), `out` lines struck, swaps as dispatched.
2819
+ * Name/phone are optional; `customerContact` is another name for `customer` (`customer.ref` defaults to a
2820
+ * key-derived value). `payment` here is a method snapshot, not a catalog account.
2821
+ */
2822
+ export interface CreateOpenOrderInput {
2823
+ origin: {
2824
+ channel: 'link';
2825
+ place: 'open-order' | {
2826
+ ref: 'open-order';
2827
+ label: string;
2828
+ };
2829
+ };
2830
+ freeLines: OpenOrderLine[];
2831
+ /** The total the business typed at dispatch, in cents (> 0). The receipt and the case read exactly this. */
2832
+ totalCents: number;
2833
+ /** ISO code, default `COP`. */
2834
+ currency?: string;
2835
+ state: 'confirmed';
2836
+ /** How the customer said they pay (a method of the platform's country catalog: `nequi`, `daviplata`, `efectivo`…) and where to. */
2837
+ payment?: {
2838
+ method: string;
2839
+ payTo?: string;
2840
+ label?: string;
2841
+ };
2842
+ customer?: {
2843
+ ref?: string;
2844
+ name?: string;
2845
+ phone?: string;
2846
+ };
2847
+ customerContact?: {
2848
+ name?: string;
2849
+ phone?: string;
2850
+ };
2851
+ /** Delivery address (domicilio). Absent: pickup. The quote, if any, is NOT added to `totalCents`. */
2852
+ destination?: CaseDestination;
2853
+ /** The order type's other fields (entrega, notas…), by key. `entrega` defaults from `destination`. */
2854
+ fields?: Record<string, unknown>;
2855
+ type?: string;
2856
+ conversationId?: string;
2857
+ /** Same key → same order. 8–80 of [A-Za-z0-9_.:-]. */
2858
+ idempotencyKey: string;
2859
+ lines?: never;
2860
+ reopens?: never;
2861
+ place?: never;
2862
+ }
2724
2863
  /** A payment method a checkout offers (no account data — that is on the receipt once the order is sent). */
2725
2864
  export interface DirectPaymentOption {
2726
2865
  accountId: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentforge-io/sdk-server",
3
- "version": "4.69.0",
3
+ "version": "4.71.0",
4
4
  "description": "Server-side SDK for backend apps integrating with AgentForge platform. Auth via ChatToken, ak_live_ API key or App secret (sk_live_), with App installations across tenants.",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",