@proveanything/smartlinks 2.1.36 → 2.1.37

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.
@@ -1,6 +1,6 @@
1
1
  # Smartlinks API Summary
2
2
 
3
- Version: 2.1.36 | Generated: 2026-11-21T12:59:21.332Z
3
+ Version: 2.1.37 | Generated: 2026-11-21T13:39:32.434Z
4
4
 
5
5
  This is a concise summary of all available API functions and types.
6
6
 
@@ -166,6 +166,7 @@ The Smartlinks SDK is organized into the following namespaces:
166
166
  - **realtime** - Functions for realtime operations
167
167
  - **research** - Functions for research operations
168
168
  - **secrets** - Functions for secrets operations
169
+ - **shop** - Functions for shop operations
169
170
  - **tagCodes** - Functions for tagCodes operations
170
171
  - **tags** - Functions for tags operations
171
172
  - **template** - Functions for template operations
@@ -11775,6 +11776,294 @@ interface SegmentRecipientsResponse {
11775
11776
 
11776
11777
  **SegmentFilterRule** = ``
11777
11778
 
11779
+ ### shop
11780
+
11781
+ **ShopPrice** (interface)
11782
+ ```typescript
11783
+ interface ShopPrice {
11784
+ id: string
11785
+ collectionId: string
11786
+ productId: string
11787
+ variantId: string | null
11788
+ appId: string
11789
+ currency: string
11790
+ amount: number
11791
+ compareAtAmount: number | null
11792
+ delivery: ShopDelivery
11793
+ deliveryConfig: ShopDeliveryConfig | Record<string, never>
11794
+ trackStock: boolean
11795
+ active: boolean
11796
+ sort: number
11797
+ metadata: Record<string, any>
11798
+ createdAt: string
11799
+ updatedAt: string
11800
+ }
11801
+ ```
11802
+
11803
+ **ShopPriceInput** (interface)
11804
+ ```typescript
11805
+ interface ShopPriceInput {
11806
+ productId: string
11807
+ variantId?: string | null
11808
+ appId?: string
11809
+ currency?: string
11810
+ amount: number
11811
+ compareAtAmount?: number | null
11812
+ delivery?: ShopDelivery
11813
+ deliveryConfig?: ShopDeliveryConfig
11814
+ trackStock?: boolean
11815
+ active?: boolean
11816
+ sort?: number
11817
+ metadata?: Record<string, any>
11818
+ }
11819
+ ```
11820
+
11821
+ **ShopPriceListParams** (interface)
11822
+ ```typescript
11823
+ interface ShopPriceListParams {
11824
+ productId?: string
11825
+ currency?: string
11826
+ active?: boolean
11827
+ appId?: string
11828
+ limit?: number
11829
+ offset?: number
11830
+ }
11831
+ ```
11832
+
11833
+ **ShopShippingRate** (interface)
11834
+ ```typescript
11835
+ interface ShopShippingRate {
11836
+ id: string
11837
+ label: string
11838
+ amount: number
11839
+ days?: string
11840
+ }
11841
+ ```
11842
+
11843
+ **ShopSettings** (interface)
11844
+ ```typescript
11845
+ interface ShopSettings {
11846
+ currency: string
11847
+ appId: string
11848
+ seller: { name?: string; address?: string; email?: string; phone?: string; vatNumber?: string }
11849
+ vat: { registered: boolean; rate: number }
11850
+ shipping: {
11851
+ rates: ShopShippingRate[]
11852
+ freeOver: number | null
11853
+ collection: { label: string } | null
11854
+ }
11855
+ policies: { returns?: string; terms?: string; privacy?: string }
11856
+ stripe: { accountId: string | null }
11857
+ stockContainerId: string | null
11858
+ checkout: {
11859
+ successUrl: string | null
11860
+ cancelUrl: string | null
11861
+ expiresMinutes: number
11862
+ allowedHosts: string[]
11863
+ }
11864
+ digital: { euBuyers: boolean }
11865
+ interaction: { interactionId: string | null }
11866
+ }
11867
+ ```
11868
+
11869
+ **ShopReadiness** (interface)
11870
+ ```typescript
11871
+ interface ShopReadiness {
11872
+ ready: boolean
11873
+ missing: { key: string; text: string }[]
11874
+ }
11875
+ ```
11876
+
11877
+ **ShopConnectStatus** (interface)
11878
+ ```typescript
11879
+ interface ShopConnectStatus {
11880
+ connected: boolean
11881
+ chargesEnabled?: boolean
11882
+ detailsSubmitted?: boolean
11883
+ payoutsEnabled?: boolean
11884
+ id?: string
11885
+ }
11886
+ ```
11887
+
11888
+ **ShopPublicConfig** (interface)
11889
+ ```typescript
11890
+ interface ShopPublicConfig {
11891
+ currency: string
11892
+ seller: { name: string | null; address: string | null; email: string | null; vatNumber?: string }
11893
+ vat: { registered: boolean; rate: number }
11894
+ shipping: ShopSettings['shipping']
11895
+ policies: ShopSettings['policies']
11896
+ digital: { euBuyers: boolean }
11897
+ ready: boolean
11898
+ }
11899
+ ```
11900
+
11901
+ **ShopProduct** (interface)
11902
+ ```typescript
11903
+ interface ShopProduct {
11904
+ priceId: string
11905
+ productId: string
11906
+ variantId: string | null
11907
+ name: string
11908
+ description: string | null
11909
+ heroImage: any
11910
+ amount: number
11911
+ compareAtAmount: number | null
11912
+ currency: string
11913
+ delivery: ShopDelivery
11914
+ deliveryKind: ShopDigitalKind | null
11915
+ needsSignIn: boolean
11916
+ available: number | null
11917
+ inStock: boolean
11918
+ }
11919
+ ```
11920
+
11921
+ **ShopCheckoutLine** (interface)
11922
+ ```typescript
11923
+ interface ShopCheckoutLine {
11924
+ productId: string
11925
+ variantId?: string | null
11926
+ quantity?: number
11927
+ }
11928
+ ```
11929
+
11930
+ **ShopCheckoutInput** (interface)
11931
+ ```typescript
11932
+ interface ShopCheckoutInput {
11933
+ lines: ShopCheckoutLine[]
11934
+ shippingRateId?: string
11935
+ email?: string
11936
+ successUrl?: string
11937
+ cancelUrl?: string
11938
+ acceptances?: { digitalImmediate?: boolean }
11939
+ }
11940
+ ```
11941
+
11942
+ **ShopCheckoutResult** (interface)
11943
+ ```typescript
11944
+ interface ShopCheckoutResult {
11945
+ orderId: string
11946
+ checkoutUrl: string
11947
+ expiresAt: string
11948
+ total: number
11949
+ currency: string
11950
+ }
11951
+ ```
11952
+
11953
+ **ShopOrderLine** (interface)
11954
+ ```typescript
11955
+ interface ShopOrderLine {
11956
+ id: string
11957
+ productId: string
11958
+ variantId: string | null
11959
+ name: string | null
11960
+ quantity: number
11961
+ unitAmount: number | null
11962
+ lineTotal: number | null
11963
+ delivery: ShopDelivery | null
11964
+ deliveryKind: ShopDigitalKind | null
11965
+ quantityDone: number
11966
+ quantityRefunded: number
11967
+ priceId: string | null
11968
+ appId: string
11969
+ files?: string[]
11970
+ fee?: { bps: number; amount: number }
11971
+ }
11972
+ ```
11973
+
11974
+ **ShopShipment** (interface)
11975
+ ```typescript
11976
+ interface ShopShipment {
11977
+ id: string
11978
+ at: string
11979
+ lines: { itemId: string; quantity: number }[]
11980
+ carrier?: string
11981
+ trackingNumber?: string
11982
+ trackingUrl?: string
11983
+ }
11984
+ ```
11985
+
11986
+ **ShopOrder** (interface)
11987
+ ```typescript
11988
+ interface ShopOrder {
11989
+ id: string
11990
+ collectionId: string
11991
+ orderRef: string | null
11992
+ status: ShopOrderStatus
11993
+ source: 'shop'
11994
+ contactId: string | null
11995
+ currency: string
11996
+ subtotal: number | null
11997
+ shipping: number | null
11998
+ tax: number | null
11999
+ total: number | null
12000
+ refunded: number
12001
+ paidAt: string | null
12002
+ expiresAt: string | null
12003
+ createdAt: string
12004
+ updatedAt: string
12005
+ email: string | null
12006
+ shippingChoice: ShopShippingRate | null
12007
+ shippingAddress: Record<string, any> | null
12008
+ shipments: ShopShipment[]
12009
+ lines: ShopOrderLine[]
12010
+ }
12011
+ ```
12012
+
12013
+ **ShopOrderListParams** (interface)
12014
+ ```typescript
12015
+ interface ShopOrderListParams {
12016
+ status?: string
12017
+ contactId?: string
12018
+ includeExpired?: boolean
12019
+ limit?: number
12020
+ offset?: number
12021
+ }
12022
+ ```
12023
+
12024
+ **ShopPage<T>** (interface)
12025
+ ```typescript
12026
+ interface ShopPage<T> {
12027
+ items: T[]
12028
+ total: number
12029
+ limit: number
12030
+ offset: number
12031
+ }
12032
+ ```
12033
+
12034
+ **ShopShipInput** (interface)
12035
+ ```typescript
12036
+ interface ShopShipInput {
12037
+ lines?: { itemId: string; quantity?: number }[]
12038
+ carrier?: string
12039
+ trackingNumber?: string
12040
+ trackingUrl?: string
12041
+ }
12042
+ ```
12043
+
12044
+ **ShopRefundInput** (interface)
12045
+ ```typescript
12046
+ interface ShopRefundInput {
12047
+ lines?: { itemId: string; quantity?: number }[]
12048
+ shipping?: boolean
12049
+ amount?: number
12050
+ restock?: boolean
12051
+ reason?: string
12052
+ }
12053
+ ```
12054
+
12055
+ **ShopDelivery** = `'physical' | 'digital'`
12056
+
12057
+ **ShopDigitalKind** = `'proof' | 'download' | 'access' | 'app'`
12058
+
12059
+ **ShopDeliveryConfig** = ``
12060
+
12061
+ **ShopPriceUpdate** = `Partial<Omit<ShopPriceInput, 'productId' | 'variantId' | 'currency'>>`
12062
+
12063
+ **ShopSettingsPatch** = `Partial<Omit<ShopSettings, 'stripe' | 'shipping' | 'checkout' | 'vat' | 'seller' | 'digital' | 'interaction'>> & {`
12064
+
12065
+ **ShopOrderStatus** = `'pending-payment' | 'paid' | 'fulfilled' | 'partly-refunded' | 'refunded' | 'expired'`
12066
+
11778
12067
  ### tags
11779
12068
 
11780
12069
  **Tag** (interface)
@@ -15490,6 +15779,70 @@ Append Responses items (input/output/tool) to a session — the manual-persisten
15490
15779
  **clear**(collectionId: string, id: string) → `Promise<`
15491
15780
  Archive (soft-delete) a session.
15492
15781
 
15782
+ ### shop
15783
+
15784
+ **config**(collectionId: string) → `Promise<ShopPublicConfig>`
15785
+ What a shop front shows: currency, the seller's details (UK law: shown before paying), shipping rates, policies, and `ready` (false until the shop can take payments).
15786
+
15787
+ **products**(collectionId: string, params?: { productIds?: string[] }) → `Promise<`
15788
+ What is for sale, in the shop's currency, with stock (`inStock`, `available`) and whether the buyer must sign in first (`needsSignIn`: a proof or access goes to an account). ```typescript const { items } = await shop.products(collectionId) items.map((p) => `${p.name}: ${formatMoney(p.amount, p.currency)}${p.inStock ? '' : ' (sold out)'}`) ```
15789
+
15790
+ **checkout**(collectionId: string, input: ShopCheckoutInput) → `Promise<ShopCheckoutResult>`
15791
+ Start paying: the server prices the basket, holds the stock and returns Stripe's checkout page. Send the buyer to `checkoutUrl`. Signed-in buyers' orders are theirs (`shop.myOrders`). ```typescript const { checkoutUrl } = await shop.checkout(collectionId, { lines: [{ productId: 'soap', quantity: 2 }], shippingRateId: 'std', successUrl: `${location.origin}/thanks`, // ?session_id= is added cancelUrl: `${location.origin}/basket`, }) location.href = checkoutUrl ``` `DIGITAL_CONSENT_REQUIRED`, `INVALID_INPUT` (e.g. a return page on another site), `PAYMENT_UNAVAILABLE` (nothing was charged)
15792
+
15793
+ **orderBySession**(collectionId: string, sessionId: string) → `Promise<ShopBuyerOrder>`
15794
+ The thank-you page: the order a Stripe checkout paid for, from the `session_id` on the success URL. Its `status` is `pending-payment` for a moment while the payment is confirmed: check again shortly. `downloads` has links for bought files once it's paid.
15795
+
15796
+ **myOrders**(collectionId: string, params?: { limit?: number; offset?: number }) → `Promise<ShopPage<ShopBuyerOrder>>`
15797
+ The signed-in buyer's orders, newest first, with their download links. @throws `SIGN_IN_REQUIRED`
15798
+
15799
+ **formatMoney**(amount: number, currency: string, locale?: string) → `string`
15800
+ Format minor units as money for the person: `formatMoney(1299, 'GBP')` → "£12.99".
15801
+
15802
+ ### shop.admin
15803
+
15804
+ **settings**(collectionId: string) → `Promise<ShopSettingsView>`
15805
+ The settings, what's still needed to take payments (`readiness`), and what SmartLinks takes (`fee`, read-only).
15806
+
15807
+ **updateSettings**(collectionId: string, patch: ShopSettingsPatch) → `Promise<ShopSettingsView>`
15808
+ Change settings: merged into what's stored; `shipping.rates` is replaced as a whole.
15809
+
15810
+ **connect**(collectionId: string, input: { returnUrl: string; refreshUrl: string }) → `Promise<`
15811
+ Connect the seller's Stripe account (a new one, set up on Stripe's own pages). Send the seller to `url`; Stripe brings them back to `returnUrl` (done or not: check `connectStatus`) or `refreshUrl` (the link ran out).
15812
+
15813
+ **connectStatus**(collectionId: string) → `Promise<ShopConnectStatus>`
15814
+ Whether Stripe is connected, and whether it can take payments and pay out yet.
15815
+
15816
+ **listPrices**(collectionId: string, params?: ShopPriceListParams) → `Promise<ShopPage<ShopPrice>>`
15817
+ Whether Stripe is connected, and whether it can take payments and pay out yet.
15818
+
15819
+ **setPrice**(collectionId: string, input: ShopPriceInput) → `Promise<ShopPrice>`
15820
+ Put a product (or variant) on sale, or change its price in that currency (one price per product per currency). @throws `INVALID_INPUT`, `APP_NOT_INSTALLED`
15821
+
15822
+ **updatePrice**(collectionId: string, priceId: string, changes: ShopPriceUpdate) → `Promise<ShopPrice>`
15823
+ Put a product (or variant) on sale, or change its price in that currency (one price per product per currency). @throws `INVALID_INPUT`, `APP_NOT_INSTALLED`
15824
+
15825
+ **removePrice**(collectionId: string, priceId: string) → `Promise<`
15826
+ Take it off sale for good (or set `active: false` to pause).
15827
+
15828
+ **listOrders**(collectionId: string, params?: ShopOrderListParams) → `Promise<ShopPage<ShopAdminOrder>>`
15829
+ Shop orders, newest first. Unpaid and expired checkouts are left out unless asked for.
15830
+
15831
+ **getOrder**(collectionId: string, orderId: string) → `Promise<ShopAdminOrder>`
15832
+ Shop orders, newest first. Unpaid and expired checkouts are left out unless asked for.
15833
+
15834
+ **ship**(collectionId: string, orderId: string, input: ShopShipInput = {}) → `Promise<ShopAdminOrder>`
15835
+ Send some or all of what's left, with tracking. The held stock leaves; the buyer's "shipped" email goes out if the shop has one. @throws `NOT_SHIPPABLE`, `NOTHING_TO_SHIP`
15836
+
15837
+ **refund**(collectionId: string, orderId: string, input: ShopRefundInput = {}) → `Promise<ShopAdminOrder>`
15838
+ Refund through Stripe: lines, shipping, a goodwill amount, or everything left. Unsent stock goes back; digital delivery is withdrawn. @throws `NOT_REFUNDABLE`, `NOTHING_TO_REFUND`
15839
+
15840
+ **markDelivered**(collectionId: string, orderId: string, itemId: string, input: { note?: string; reference?: string } = {}) → `Promise<ShopAdminOrder>`
15841
+ An app that delivers a line itself (`deliveryConfig.kind: 'app'`) says it's done.
15842
+
15843
+ **cancelCheckout**(collectionId: string, orderId: string) → `Promise<ShopAdminOrder>`
15844
+ Cancel a checkout that hasn't been paid (its stock is released). @throws `NOT_PENDING`
15845
+
15493
15846
  ### skills
15494
15847
 
15495
15848
  **list**(collectionId: string) → `Promise<SkillsListResponse>`