@vindentech/api-client 2.0.0-next.2 → 2.0.0-next.21

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.
Files changed (54) hide show
  1. package/dist/client.d.ts.map +1 -1
  2. package/dist/client.js.map +1 -1
  3. package/dist/generated/_all.d.ts +4 -0
  4. package/dist/generated/_all.d.ts.map +1 -1
  5. package/dist/generated/_all.js +4 -0
  6. package/dist/generated/_all.js.map +1 -1
  7. package/dist/generated/_permissions.d.ts +41 -1
  8. package/dist/generated/_permissions.d.ts.map +1 -1
  9. package/dist/generated/_permissions.js +10 -0
  10. package/dist/generated/_permissions.js.map +1 -1
  11. package/dist/generated/analytics/analytics.d.ts +30 -2
  12. package/dist/generated/analytics/analytics.d.ts.map +1 -1
  13. package/dist/generated/analytics/analytics.js +43 -1
  14. package/dist/generated/analytics/analytics.js.map +1 -1
  15. package/dist/generated/billing-accounts/billing-accounts.d.ts +8 -1
  16. package/dist/generated/billing-accounts/billing-accounts.d.ts.map +1 -1
  17. package/dist/generated/billing-accounts/billing-accounts.js +0 -1
  18. package/dist/generated/billing-accounts/billing-accounts.js.map +1 -1
  19. package/dist/generated/collection-holds/collection-holds.d.ts +24 -0
  20. package/dist/generated/collection-holds/collection-holds.d.ts.map +1 -0
  21. package/dist/generated/collection-holds/collection-holds.js +23 -0
  22. package/dist/generated/collection-holds/collection-holds.js.map +1 -0
  23. package/dist/generated/index.schemas.d.ts +1388 -61
  24. package/dist/generated/index.schemas.d.ts.map +1 -1
  25. package/dist/generated/index.schemas.js +151 -5
  26. package/dist/generated/index.schemas.js.map +1 -1
  27. package/dist/generated/invoice-auto-charge-mode/invoice-auto-charge-mode.d.ts +38 -0
  28. package/dist/generated/invoice-auto-charge-mode/invoice-auto-charge-mode.d.ts.map +1 -0
  29. package/dist/generated/invoice-auto-charge-mode/invoice-auto-charge-mode.js +41 -0
  30. package/dist/generated/invoice-auto-charge-mode/invoice-auto-charge-mode.js.map +1 -0
  31. package/dist/generated/organization-stored-volume/organization-stored-volume.d.ts +31 -0
  32. package/dist/generated/organization-stored-volume/organization-stored-volume.d.ts.map +1 -0
  33. package/dist/generated/organization-stored-volume/organization-stored-volume.js +15 -0
  34. package/dist/generated/organization-stored-volume/organization-stored-volume.js.map +1 -0
  35. package/dist/generated/organizations/organizations.d.ts +1 -1
  36. package/dist/generated/organizations/organizations.js +1 -1
  37. package/dist/generated/price-presentation/price-presentation.d.ts +38 -0
  38. package/dist/generated/price-presentation/price-presentation.d.ts.map +1 -0
  39. package/dist/generated/price-presentation/price-presentation.js +41 -0
  40. package/dist/generated/price-presentation/price-presentation.js.map +1 -0
  41. package/dist/generated/provider-switch/provider-switch.d.ts +5 -1
  42. package/dist/generated/provider-switch/provider-switch.d.ts.map +1 -1
  43. package/dist/generated/provider-switch/provider-switch.js.map +1 -1
  44. package/dist/generated/service-points/service-points.d.ts +1 -1
  45. package/dist/generated/service-points/service-points.js +1 -1
  46. package/dist/generated/tenant-config/tenant-config.d.ts +29 -1
  47. package/dist/generated/tenant-config/tenant-config.d.ts.map +1 -1
  48. package/dist/generated/tenant-config/tenant-config.js +39 -0
  49. package/dist/generated/tenant-config/tenant-config.js.map +1 -1
  50. package/dist/generated/users/users.d.ts +1 -1
  51. package/dist/generated/users/users.js +1 -1
  52. package/dist/index.d.ts +3 -3
  53. package/dist/index.d.ts.map +1 -1
  54. package/package.json +1 -1
@@ -9,6 +9,24 @@ export interface HealthResponseDto {
9
9
  status: string;
10
10
  timestamp: string;
11
11
  }
12
+ export interface OrderCustomerLegDto {
13
+ /** The leg's id, as in OrderDetailDto.legs. */
14
+ orderTransportLegId: string;
15
+ /** PICKUP, DELIVERY, DISPATCH, RETURN or SERVICE. Tells a pickup address from a delivery address, and shows when no leg of the order's own direction was picked. */
16
+ legType: string;
17
+ /** @nullable */
18
+ addressLine1: string | null;
19
+ /** @nullable */
20
+ zipCode: string | null;
21
+ /** @nullable */
22
+ city: string | null;
23
+ /** @nullable */
24
+ recipientPhone: string | null;
25
+ /** @nullable */
26
+ plannedWindowStart: string | null;
27
+ /** @nullable */
28
+ plannedWindowEnd: string | null;
29
+ }
12
30
  export interface OrderHandlingZoneDto {
13
31
  positionId: string;
14
32
  section: string;
@@ -51,6 +69,11 @@ export interface OrderSummaryDto {
51
69
  * @nullable
52
70
  */
53
71
  recipientName: string | null;
72
+ /**
73
+ * The customer-facing transport leg: its address, contact phone and booked window. Picked from the live legs the caller can see as the lowest-sequence leg of the order's customer-facing type (PICKUP for PICKUP, MOVE, TRANSFER and PICKING jobs; DELIVERY for DELIVERY, DROP_OFF and MERCHANDISE_SALE jobs), else the lowest-sequence leg with an address, else the lowest-sequence leg — the same leg a client picks from `GET /v1/orders/{id}`'s `legs`. Not necessarily the leg `recipientName` reads, which is always the lowest-sequence one. Null when the order has no leg the caller can see. A carrier reaches only its own booked legs and warehouse staff only legs on an assigned warehouse, so for them this can also be a leg other than the customer's own; `legType` says which.
74
+ * @nullable
75
+ */
76
+ customerLeg: OrderCustomerLegDto | null;
54
77
  /** Live product lines on the job (voided and deleted lines excluded). Scoped by the caller's own row visibility, so it matches what `GET /v1/orders/{id}` would show them. */
55
78
  productCount: number;
56
79
  /** Merchandise lines on the job (public.sales_order_merchandise) — always 0 except on a MERCHANDISE_SALE job, which carries merchandise instead of product lines. Distinct from `productCount`, which never counts these. Scoped by the caller's own row visibility like `productCount`: 0 can mean 'no merchandise' or 'withheld by scope'. */
@@ -226,10 +249,15 @@ export interface OrderMerchandiseDto {
226
249
  /** Units placed. */
227
250
  quantity: number;
228
251
  /**
229
- * Per-unit price ex VAT, frozen at placement, in minor units (e.g. öre/cent).
252
+ * Per-unit price ex VAT, frozen at placement, in minor units (e.g. öre/cent). A price entered including VAT is its net part, which does not multiply back to the line.
230
253
  * @minimum 0
231
254
  */
232
255
  unitPriceExVatMinor: number;
256
+ /**
257
+ * Per-unit price inc VAT, frozen at placement, in minor units: as entered where the price includes VAT, so `unitPriceIncVatMinor` × `quantity` is the line the invoice bills (10 × 2,99 € = 29,90 €), else `unitPriceExVatMinor` with its VAT.
258
+ * @minimum 0
259
+ */
260
+ unitPriceIncVatMinor: number;
233
261
  /** VAT rate frozen at placement (numeric column → string, e.g. "25.0000"). */
234
262
  vatRate: string;
235
263
  /** Frozen at placement (ISO 4217). */
@@ -415,6 +443,11 @@ export interface OrderDetailDto {
415
443
  * @nullable
416
444
  */
417
445
  recipientName: string | null;
446
+ /**
447
+ * The customer-facing transport leg: its address, contact phone and booked window. Picked from the live legs the caller can see as the lowest-sequence leg of the order's customer-facing type (PICKUP for PICKUP, MOVE, TRANSFER and PICKING jobs; DELIVERY for DELIVERY, DROP_OFF and MERCHANDISE_SALE jobs), else the lowest-sequence leg with an address, else the lowest-sequence leg — the same leg a client picks from `GET /v1/orders/{id}`'s `legs`. Not necessarily the leg `recipientName` reads, which is always the lowest-sequence one. Null when the order has no leg the caller can see. A carrier reaches only its own booked legs and warehouse staff only legs on an assigned warehouse, so for them this can also be a leg other than the customer's own; `legType` says which.
448
+ * @nullable
449
+ */
450
+ customerLeg: OrderCustomerLegDto | null;
418
451
  /** Live product lines on the job (voided and deleted lines excluded). Scoped by the caller's own row visibility, so it matches what `GET /v1/orders/{id}` would show them. */
419
452
  productCount: number;
420
453
  /** Merchandise lines on the job (public.sales_order_merchandise) — always 0 except on a MERCHANDISE_SALE job, which carries merchandise instead of product lines. Distinct from `productCount`, which never counts these. Scoped by the caller's own row visibility like `productCount`: 0 can mean 'no merchandise' or 'withheld by scope'. */
@@ -1550,6 +1583,31 @@ export interface OrganizationOwnerDto {
1550
1583
  /** @nullable */
1551
1584
  phone: string | null;
1552
1585
  }
1586
+ export interface OrganizationPaymentMethodDto {
1587
+ /** The tenant's code for the method, e.g. `manual_invoice` or `stripe_card`. */
1588
+ code: string;
1589
+ /** The method's name, as the tenant labels it. */
1590
+ displayName: string;
1591
+ /** True when invoices are charged automatically (a card), false when the customer pays an invoice they receive. */
1592
+ isAutoChargeable: boolean;
1593
+ }
1594
+ export interface OrganizationContractSummaryDto {
1595
+ /**
1596
+ * The binding plan the contract is on. null for a contract that names no plan (older contracts carry only `bindingType`).
1597
+ * @nullable
1598
+ */
1599
+ bindingPlanId: string | null;
1600
+ /**
1601
+ * The binding plan's code.
1602
+ * @nullable
1603
+ */
1604
+ bindingType: string | null;
1605
+ /**
1606
+ * The binding plan's name. null when the contract names no plan.
1607
+ * @nullable
1608
+ */
1609
+ name: string | null;
1610
+ }
1553
1611
  export type OrganizationListItemDtoType = typeof OrganizationListItemDtoType[keyof typeof OrganizationListItemDtoType];
1554
1612
  export declare const OrganizationListItemDtoType: {
1555
1613
  readonly business: "business";
@@ -1584,6 +1642,53 @@ export interface OrganizationListItemDto {
1584
1642
  * @nullable
1585
1643
  */
1586
1644
  owner: OrganizationOwnerDto | null;
1645
+ /**
1646
+ * Live members of the organization, invited members who have not signed in yet included. A forgotten (erased) person is not counted, as they are never the `owner`. null for a caller without `member:read`, like `owner`.
1647
+ * @nullable
1648
+ */
1649
+ memberCount: number | null;
1650
+ /** True when the organization is personal and still carries the name onboarding gives an account nobody named ("Account" and eight hex characters). Erasure renames an account back to it, so an erased customer reads true as well. */
1651
+ isPlaceholderName: boolean;
1652
+ /**
1653
+ * The invoice email staff set on the billing account: an override. Trimmed, and null when unset or blank, the rule `invoiceRecipientEmail` applies to it; `invoiceEmail` on `GET /v1/billing/accounts` is the column as stored. null for a caller without `billingaccount:read`.
1654
+ * @nullable
1655
+ */
1656
+ invoiceEmail: string | null;
1657
+ /**
1658
+ * Where the organization's invoices are sent: `invoiceEmail` when set, else the owner's profile email for a personal organization, else the organization's contact email for a business. Read from the same billing account as `invoiceEmail`. As `invoiceRecipientEmail` on `GET /v1/billing/accounts`, and null for a caller without `billingaccount:read`.
1659
+ * @nullable
1660
+ */
1661
+ invoiceRecipientEmail: string | null;
1662
+ /**
1663
+ * The customer's orders (jobs), every status: the `total` of `GET /v1/orders?organizationId=…`. null for a caller without `order:read` (org-billing).
1664
+ * @nullable
1665
+ */
1666
+ ordersCount: number | null;
1667
+ /**
1668
+ * The customer's orders not yet in a final status (completed, cancelled or failed): the orders that keep a customer from being deleted. `openOrdersCount > 0` is a customer with active orders. null for a caller without `order:read`.
1669
+ * @nullable
1670
+ */
1671
+ openOrdersCount: number | null;
1672
+ /**
1673
+ * When the customer's newest order was created, the time the orders list sorts by. null when the customer has no orders, and for a caller without `order:read` (`ordersCount` is then null too).
1674
+ * @nullable
1675
+ */
1676
+ lastOrderAt: string | null;
1677
+ /**
1678
+ * Units of the customer's goods in storage: the `units` of `GET /v1/products/stats?organizationId=…&status=IN_STORAGE`, the number the customer profile shows. Goods awaiting disposal are not counted, so a customer at 0 can still be refused deletion for goods on the shelf. null for a caller without `product:read` (org-billing).
1679
+ * @nullable
1680
+ */
1681
+ inStorageUnits: number | null;
1682
+ /**
1683
+ * How the customer pays: their billing account's payment method, else the tenant's default. null when the customer has no billing account or the tenant no default, and for a caller without `billingaccount:read`.
1684
+ * @nullable
1685
+ */
1686
+ paymentMethod: OrganizationPaymentMethodDto | null;
1687
+ /**
1688
+ * The customer's active contract (binding), as `GET /v1/organizations/:id/contract` returns it. null when none is active, and for a caller without `organizationcontract:read` (tenant-admin and operations-manager hold it).
1689
+ * @nullable
1690
+ */
1691
+ contract: OrganizationContractSummaryDto | null;
1587
1692
  }
1588
1693
  export interface PaginatedOrganizationsDto {
1589
1694
  /** The page of rows. */
@@ -1841,10 +1946,6 @@ export interface OrganizationContractDto {
1841
1946
  /** @nullable */
1842
1947
  bindingVolumeCm3: number | null;
1843
1948
  /** @nullable */
1844
- volumeCm3: number | null;
1845
- /** @nullable */
1846
- billableVolumeCm3: number | null;
1847
- /** @nullable */
1848
1949
  currentPeriodStart: string | null;
1849
1950
  /** @nullable */
1850
1951
  currentPeriodEnd: string | null;
@@ -1861,6 +1962,16 @@ export interface UpdateOrganizationContractBindingDto {
1861
1962
  /** Target billing.binding_plan id. */
1862
1963
  bindingPlanId: string;
1863
1964
  }
1965
+ export interface OrganizationStoredVolumeDto {
1966
+ /** The measured volume in cm³, at the sizes storage bills. It counts the goods the storage snapshot dated tomorrow in the billing calendar counts, and adds up the same sizes, so that snapshot bills this figure if nothing changes before it is written. Goods leaving on a delivery count through the delivery's planned day, so those planned for today are already out. A pod with no size adds nothing. Counted whether or not the organization has a billing account; only one with an account is billed. Before any minimum billable volume, which pricing applies. */
1967
+ measuredVolumeCm3: number;
1968
+ /** The measured volume in cm³, with each pod that has no size counted at its product's measured size, or else at the product's estimated size. A pod with neither adds nothing. Nothing is invoiced from it. */
1969
+ estimatedVolumeCm3: number;
1970
+ /** The pods counted that have no size, so add nothing to measuredVolumeCm3. */
1971
+ unmeasuredPodCount: number;
1972
+ /** When the figure was read. */
1973
+ asOf: string;
1974
+ }
1864
1975
  export type OrganizationSettingDtoServiceType = typeof OrganizationSettingDtoServiceType[keyof typeof OrganizationSettingDtoServiceType];
1865
1976
  export declare const OrganizationSettingDtoServiceType: {
1866
1977
  readonly STORAGE: "STORAGE";
@@ -2192,7 +2303,7 @@ export interface UpdateCarrierMethodDto {
2192
2303
  export interface MembershipDto {
2193
2304
  organizationId: string;
2194
2305
  role: string;
2195
- /** Fine-grained permissions (resource:action) granted by this org role — drives component visibility when this org is active */
2306
+ /** Permissions (resource:action) of this membership's stored `role`, for display, such as labelling the user's role in an organization. Permission checks never read this list; they use the top-level `capabilities`, which come from the token. The stored role can differ from the token's roles: `GET /v1/me` stores a single role picked from the token (its highest-priority organization role, when it has one) only when it creates the membership and never refreshes it, and a role set by onboarding or the organization-member endpoints reaches the token only once Keycloak is updated and the token is refreshed. */
2196
2307
  capabilities: string[];
2197
2308
  }
2198
2309
  export interface AssignmentDto {
@@ -2247,15 +2358,6 @@ export declare const MeOrganizationDtoType: {
2247
2358
  readonly business: "business";
2248
2359
  readonly personal: "personal";
2249
2360
  };
2250
- /**
2251
- * Service tier of the account. PRO is the 3PL / Receive & Distribute tier; CORE is the default. A display hint for client-side feature gating only — no endpoint enforces it server-side, so a CORE account can still reach PRO-tier routes it otherwise has permission for.
2252
- */
2253
- export type MeOrganizationDtoServiceTier = typeof MeOrganizationDtoServiceTier[keyof typeof MeOrganizationDtoServiceTier];
2254
- export declare const MeOrganizationDtoServiceTier: {
2255
- readonly PRO: "PRO";
2256
- readonly CORE: "CORE";
2257
- readonly LIGHT: "LIGHT";
2258
- };
2259
2361
  export interface MeOrganizationDto {
2260
2362
  organizationId: string;
2261
2363
  /** The account's name — the company name for a business org. */
@@ -2272,8 +2374,6 @@ export interface MeOrganizationDto {
2272
2374
  * @nullable
2273
2375
  */
2274
2376
  preferredLocale: string | null;
2275
- /** Service tier of the account. PRO is the 3PL / Receive & Distribute tier; CORE is the default. A display hint for client-side feature gating only — no endpoint enforces it server-side, so a CORE account can still reach PRO-tier routes it otherwise has permission for. */
2276
- serviceTier: MeOrganizationDtoServiceTier;
2277
2377
  /**
2278
2378
  * Active storage/service agreement; null when there is none, or when the caller's role cannot read it.
2279
2379
  * @nullable
@@ -2348,7 +2448,7 @@ export interface MeResponseDto {
2348
2448
  */
2349
2449
  preferences: MeResponseDtoPreferences;
2350
2450
  memberships: MembershipDto[];
2351
- /** Cross-cutting permissions (resource:action) from platform/tenant-wide/warehouse/carrier roles for the active context — drives client-side component visibility. Org-scoped permissions are on each membership. */
2451
+ /** Permissions (resource:action) of every role on the caller's token — realm roles and the API client's roles, organization roles (`org-billing`, `owner`, …) included. This is the set the server checks each operation's required permissions against: drive UI visibility off it (for example `hasRequiredPermissions(me.capabilities, operation)`), not off `memberships[].capabilities` or role names. An organization role's permissions apply to the token's organization. Holding a permission does not guarantee success: data stays scoped to the caller's organization, warehouses or carrier, and some operations check more (see their 403 responses). */
2352
2452
  capabilities: string[];
2353
2453
  /** Warehouses the caller can act for (JWT warehouse_ids claim; [] if none) — matches what RLS scopes operational reads to. */
2354
2454
  warehouseIds: string[];
@@ -2360,7 +2460,7 @@ export interface MeResponseDto {
2360
2460
  /** Long-form staff assignments (own rows only) from employee_assignment — the authoritative warehouse/carrier reach behind the warehouseIds/carrierId summary. */
2361
2461
  assignments: AssignmentDto[];
2362
2462
  /**
2363
- * The caller's active customer account (company name, tier, subscription) — the org named by the token's organization_id claim. Null for staff and for a tenant-less platform operator.
2463
+ * The caller's active customer account (company name, subscription) — the org named by the token's organization_id claim. Null for staff and for a tenant-less platform operator.
2364
2464
  * @nullable
2365
2465
  */
2366
2466
  organization: MeOrganizationDto | null;
@@ -2619,7 +2719,7 @@ export interface CreateCartDto {
2619
2719
  customerType?: CreateCartDtoCustomerType;
2620
2720
  /** ISO 3166-1 alpha-2. Fallback only: overridden by the target organization's active billing account, if it has one. */
2621
2721
  countryCode: string;
2622
- /** ISO 4217. Fallback only: overridden by the target organization's active billing account, if it has one. */
2722
+ /** ISO 4217. Fallback only: overridden by the target organization's active billing account, if it has one. When it is used (a guest, or an organization with no active billing account), it must be one of the tenant's active enabled currencies. Any other code is refused with 400 `currency_not_enabled`, and no cart is created. */
2623
2723
  currencyCode: string;
2624
2724
  /** Staff create-on-behalf target organization. Ignored for org users (own org). */
2625
2725
  organizationId?: string;
@@ -2778,10 +2878,15 @@ export interface CartMerchandiseDto {
2778
2878
  */
2779
2879
  name: string | null;
2780
2880
  /**
2781
- * Price ex VAT as a decimal string: what the SKU's pricing rule charges today in the cart's currency, which is what the quote charges for the line. Null when no price is in force.
2881
+ * Price ex VAT as a decimal string: what the SKU's pricing rule charges today in the cart's currency, which is what the quote charges for the line. A price entered including VAT shows its net part, which does not multiply back to the line. Null when no price is in force.
2782
2882
  * @nullable
2783
2883
  */
2784
2884
  retailPriceExVat: string | null;
2885
+ /**
2886
+ * The same price including VAT, as a decimal string: as entered when the price includes VAT, else retailPriceExVat with its VAT. Null exactly when retailPriceExVat is.
2887
+ * @nullable
2888
+ */
2889
+ retailPriceIncVat: string | null;
2785
2890
  /** @nullable */
2786
2891
  currencyCode: string | null;
2787
2892
  /**
@@ -2914,6 +3019,22 @@ export interface CartDto {
2914
3019
  createdAt: string;
2915
3020
  updatedAt: string;
2916
3021
  }
3022
+ export interface QuoteFloorItemDto {
3023
+ /** The cart goods line: `items[].cartProductId` on the cart. */
3024
+ cartProductId: string;
3025
+ /** Units on the line, each topped up by `topUpCm3`. */
3026
+ quantity: number;
3027
+ /** One unit's volume in cm³, from the line's dimensions. */
3028
+ measuredCm3: number;
3029
+ /** `measuredCm3` rounded the way the rule rounds each item before its minimum (to the nearest 0,01 m³, say). Equal to `measuredCm3` when the rule does not round. */
3030
+ roundedCm3: number;
3031
+ /** The minimum billable volume per unit, in cm³: what each unit is billed as. */
3032
+ minimumCm3: number;
3033
+ /** What the minimum adds to one unit, in cm³: `minimumCm3` − `roundedCm3`. */
3034
+ topUpCm3: number;
3035
+ /** What the minimum adds to the line, in cm³: `topUpCm3` × `quantity`. */
3036
+ totalTopUpCm3: number;
3037
+ }
2917
3038
  export type QuoteLineDtoKind = typeof QuoteLineDtoKind[keyof typeof QuoteLineDtoKind];
2918
3039
  export declare const QuoteLineDtoKind: {
2919
3040
  readonly GOODS: "GOODS";
@@ -2923,7 +3044,7 @@ export declare const QuoteLineDtoKind: {
2923
3044
  readonly START_FEE: "START_FEE";
2924
3045
  };
2925
3046
  /**
2926
- * Set on a line that exists only because a contracted minimum applied, so it can be shown as such: `quantity` — a minimum billable volume lifted the quantity (the line carries the difference; the line before it carries what the goods account for), `fee` — a minimum charge topped the component up, `minimum_amount` — the charge's own minimum price per order lifted it (the line carries the difference, including any minimum billable volume beneath it; the line before it carries what the goods account for), `minimum_monthly_fee` — the storage came in under its minimum monthly fee after every campaign, binding discount and code, and this line bills the difference (a `GOODS` line against the minimum fee article; no reduction applies to it, and it is the line the invoice bills for the month). The line keeps the kind of the charge it lifts. Absent on every other line.
3047
+ * Set on a line that exists only because a contracted minimum applied, so it can be shown as such: `quantity` — a minimum billable volume lifted the quantity (the line carries the difference; the line before it carries what the goods account for; `floorItems` says which items, when the minimum is per item), `fee` — a minimum charge topped the component up, `minimum_amount` — the charge's own minimum price per order lifted it (the line carries the difference, including any minimum billable volume beneath it; the line before it carries what the goods account for), `minimum_monthly_fee` — the storage came in under its minimum monthly fee after every campaign, binding discount and code, and this line bills the difference (a `GOODS` line against the minimum fee article; no reduction applies to it, and it is the line the invoice bills for the month). The line keeps the kind of the charge it lifts. Absent on every other line.
2927
3048
  * @nullable
2928
3049
  */
2929
3050
  export type QuoteLineDtoFloorKind = typeof QuoteLineDtoFloorKind[keyof typeof QuoteLineDtoFloorKind] | null;
@@ -2942,8 +3063,10 @@ export interface QuoteLineDto {
2942
3063
  reference: string | null;
2943
3064
  description: string;
2944
3065
  quantity: number;
2945
- /** Unit price ex-VAT, integer minor units of the quote currency. This is the catalogue price BEFORE any campaign or binding discount — with one applied it no longer multiplies out to `lineTotalExVatMinor` (a 100% start-fee waiver leaves a priced unit against a zero line). Nor does a storage month the price book prices, which is billed a night at a time with each night rounded, as the invoice bills it. Sum `lineTotalExVatMinor`, never unit × quantity, or the result contradicts `totals`. */
3066
+ /** Unit price ex-VAT, integer minor units of the quote currency. This is the catalogue price BEFORE any campaign or binding discount — with one applied it no longer multiplies out to `lineTotalExVatMinor` (a 100% start-fee waiver leaves a priced unit against a zero line). Nor does a storage month the price book prices, which is billed a night at a time with each night rounded, as the invoice bills it. Sum `lineTotalExVatMinor`, never unit × quantity, or the result contradicts `totals`. A price that includes VAT is stated here as its net part, which taxed again can miss by a cent; `unitPriceIncVatMinor` states it as written. */
2946
3067
  unitPriceExVatMinor: number;
3068
+ /** Unit price inc-VAT, integer minor units, on the same basis as `unitPriceExVatMinor`: before any campaign or binding discount. Where the price book states the price including VAT, this is that price as written (29,90 € per m³, where `unitPriceExVatMinor` is its net part, 23,82 €, which taxed again is 29,89 €); otherwise it is `unitPriceExVatMinor` with its VAT added. On a line that is its own unit (a minimum charge, or a minimum lifting a price), it is the amount `unitPriceExVatMinor` states with that amount's VAT: on a storage month, one night's. Like the ex-VAT unit price it does not multiply out to a line total: show `lineTotalIncVatMinor` for that. */
3069
+ unitPriceIncVatMinor: number;
2947
3070
  /** Line total ex-VAT, integer minor units, AFTER any campaign and binding discount — the amount that reaches `totals` */
2948
3071
  lineTotalExVatMinor: number;
2949
3072
  /** Line total inc-VAT, integer minor units, on the same basis as `lineTotalExVatMinor`: after any campaign and binding discount, before the coupon (`couponDiscountIncVatMinor` is not subtracted). The VAT is the line's share of what the invoice charges on the invoice line it is billed on, so the lines add up to `totals.incVatMinor` exactly. Quote lines billed as one invoice line (the same article, VAT rate and RUT flag) share that line's VAT in proportion to their totals, so one of them can be a cent off its own total taxed alone. */
@@ -2978,10 +3101,12 @@ export interface QuoteLineDto {
2978
3101
  */
2979
3102
  componentCode?: string | null;
2980
3103
  /**
2981
- * Set on a line that exists only because a contracted minimum applied, so it can be shown as such: `quantity` — a minimum billable volume lifted the quantity (the line carries the difference; the line before it carries what the goods account for), `fee` — a minimum charge topped the component up, `minimum_amount` — the charge's own minimum price per order lifted it (the line carries the difference, including any minimum billable volume beneath it; the line before it carries what the goods account for), `minimum_monthly_fee` — the storage came in under its minimum monthly fee after every campaign, binding discount and code, and this line bills the difference (a `GOODS` line against the minimum fee article; no reduction applies to it, and it is the line the invoice bills for the month). The line keeps the kind of the charge it lifts. Absent on every other line.
3104
+ * Set on a line that exists only because a contracted minimum applied, so it can be shown as such: `quantity` — a minimum billable volume lifted the quantity (the line carries the difference; the line before it carries what the goods account for; `floorItems` says which items, when the minimum is per item), `fee` — a minimum charge topped the component up, `minimum_amount` — the charge's own minimum price per order lifted it (the line carries the difference, including any minimum billable volume beneath it; the line before it carries what the goods account for), `minimum_monthly_fee` — the storage came in under its minimum monthly fee after every campaign, binding discount and code, and this line bills the difference (a `GOODS` line against the minimum fee article; no reduction applies to it, and it is the line the invoice bills for the month). The line keeps the kind of the charge it lifts. Absent on every other line.
2982
3105
  * @nullable
2983
3106
  */
2984
3107
  floorKind?: QuoteLineDtoFloorKind;
3108
+ /** On a `floorKind: quantity` line lifted by a minimum billable volume per item: the cart's goods lines that minimum tops up, so the line can say which items it comes from. Each names its cart line and states, per unit, its volume, that volume rounded as the rule rounds each item, the minimum it is billed as, and the difference. Lines whose units bill at least the minimum are not listed. The lines' `totalTopUpCm3` add up to the volume this line bills, which `quantity` states in the rule's unit (m³) rounded to 4 decimals. That sum is exact when the rule rounds each item; when it does not, the line starts from the cart's total volume, rounded once, so the two can differ by up to 1 cm³ a unit. Absent on every other line, including a minimum for the whole storage or order, one per counted item, a transport whose own minimum price applied instead (`floorKind: minimum_amount`), and the price book preview. */
3109
+ floorItems?: QuoteFloorItemDto[];
2985
3110
  }
2986
3111
  export interface QuoteVolumeDto {
2987
3112
  /** Total goods volume in cm³ */
@@ -3108,6 +3233,77 @@ export interface QuoteBindingOptionDto {
3108
3233
  /** This cart, priced under this plan */
3109
3234
  totals: QuoteTotalsDto;
3110
3235
  }
3236
+ /**
3237
+ * `category`: a price category's amount. `start_fee`: the start fee's, a row of its own. `discount`: what the campaigns, the binding discount and the code took off the row before it, as a negative amount; it follows that row and has the same `category` and `vatRate`.
3238
+ */
3239
+ export type QuoteDisplayLineDtoKind = typeof QuoteDisplayLineDtoKind[keyof typeof QuoteDisplayLineDtoKind];
3240
+ export declare const QuoteDisplayLineDtoKind: {
3241
+ readonly category: "category";
3242
+ readonly start_fee: "start_fee";
3243
+ readonly discount: "discount";
3244
+ };
3245
+ /**
3246
+ * The price category: `storage` (the storage month and every minimum on it, the minimum monthly fee included), `transport` (the transport, its minimums and its window and zone surcharges), `start_fee`, `packing_materials`, `insurance`, `services`.
3247
+ */
3248
+ export type QuoteDisplayLineDtoCategory = typeof QuoteDisplayLineDtoCategory[keyof typeof QuoteDisplayLineDtoCategory];
3249
+ export declare const QuoteDisplayLineDtoCategory: {
3250
+ readonly storage: "storage";
3251
+ readonly transport: "transport";
3252
+ readonly start_fee: "start_fee";
3253
+ readonly packing_materials: "packing_materials";
3254
+ readonly insurance: "insurance";
3255
+ readonly services: "services";
3256
+ };
3257
+ /**
3258
+ * `m3`: cubic metres. `pcs`: items. Null exactly when `quantity` is.
3259
+ * @nullable
3260
+ */
3261
+ export type QuoteDisplayLineDtoUnit = typeof QuoteDisplayLineDtoUnit[keyof typeof QuoteDisplayLineDtoUnit] | null;
3262
+ export declare const QuoteDisplayLineDtoUnit: {
3263
+ readonly m3: "m3";
3264
+ readonly pcs: "pcs";
3265
+ };
3266
+ export interface QuoteDisplayLineDto {
3267
+ /** `category`: a price category's amount. `start_fee`: the start fee's, a row of its own. `discount`: what the campaigns, the binding discount and the code took off the row before it, as a negative amount; it follows that row and has the same `category` and `vatRate`. */
3268
+ kind: QuoteDisplayLineDtoKind;
3269
+ /** The price category: `storage` (the storage month and every minimum on it, the minimum monthly fee included), `transport` (the transport, its minimums and its window and zone surcharges), `start_fee`, `packing_materials`, `insurance`, `services`. */
3270
+ category: QuoteDisplayLineDtoCategory;
3271
+ /** The row's label in the booking's language (the organization's preferred language, else the cart's country's): the category's name, or that category's discount. */
3272
+ description: string;
3273
+ /**
3274
+ * What the row bills for, in `unit`: the m³ the storage month is billed on (`volume.billableM3`), the m³ the transport is billed on when it is priced per m³, the number of packing-material items. Null on a discount row and wherever a quantity says nothing (a transport priced per order, the start fee).
3275
+ * @nullable
3276
+ */
3277
+ quantity: number | null;
3278
+ /**
3279
+ * `m3`: cubic metres. `pcs`: items. Null exactly when `quantity` is.
3280
+ * @nullable
3281
+ */
3282
+ unit: QuoteDisplayLineDtoUnit;
3283
+ /** The row's amount excluding VAT, integer minor units. A category row is before every reduction when a discount row follows it, after them otherwise; a discount row is negative. */
3284
+ amountExVatMinor: number;
3285
+ /** The row's amount including VAT, integer minor units, on the same basis as `amountExVatMinor`. Whether a discount row is shown is decided in the basis the prices are written in (including VAT where they include it). A discount row is never above zero in either figure, but a reduction smaller than a VAT rounding can leave the other one at 0. */
3286
+ amountIncVatMinor: number;
3287
+ /** VAT rate as a percentage (25 = 25%). A category whose lines carry different rates is split into one row per rate. */
3288
+ vatRate: number;
3289
+ }
3290
+ export interface QuoteDisplayTotalsDto {
3291
+ /** Sum of `displayLines[].amountExVatMinor`, minor units */
3292
+ exVatMinor: number;
3293
+ /** `incVatMinor` − `exVatMinor`, minor units */
3294
+ vatMinor: number;
3295
+ /** Sum of `displayLines[].amountIncVatMinor`, minor units: equal to `totals.payableMinor`, since the discount rows include the code. */
3296
+ incVatMinor: number;
3297
+ }
3298
+ /**
3299
+ * How the tenant presents its prices (its price presentation setting), which decides `displayLines`. `detailed`: show `lines` as they are, with the code and totals beside them; `displayLines` is empty. `category_with_discounts`: one row per price category before its reductions, then a discount row per category one reduced. `category_net`: one row per category after them.
3300
+ */
3301
+ export type QuoteResponseDtoPresentationMode = typeof QuoteResponseDtoPresentationMode[keyof typeof QuoteResponseDtoPresentationMode];
3302
+ export declare const QuoteResponseDtoPresentationMode: {
3303
+ readonly detailed: "detailed";
3304
+ readonly category_with_discounts: "category_with_discounts";
3305
+ readonly category_net: "category_net";
3306
+ };
3111
3307
  export interface QuoteResponseDto {
3112
3308
  cartId: string;
3113
3309
  /** ISO 4217 — the currency all amounts are expressed in */
@@ -3141,6 +3337,15 @@ export interface QuoteResponseDto {
3141
3337
  */
3142
3338
  rutDeductionMinor: number | null;
3143
3339
  totals: QuoteTotalsDto;
3340
+ /** How the tenant presents its prices (its price presentation setting), which decides `displayLines`. `detailed`: show `lines` as they are, with the code and totals beside them; `displayLines` is empty. `category_with_discounts`: one row per price category before its reductions, then a discount row per category one reduced. `category_net`: one row per category after them. */
3341
+ presentationMode: QuoteResponseDtoPresentationMode;
3342
+ /** The lines regrouped as `presentationMode` says, in the order to show them: storage, transport, start fee, packing materials, insurance, services, each by VAT rate, each followed by its discount row. Every minimum folds into its category, and the window and zone surcharges into transport. Unlike `lines`, the discount rows include the code, so the rows add up to `displayTotals`, which is what the customer pays. Where the storage comes in under its minimum monthly fee, its discount row shows only what a reduction took off what is paid. Empty in `detailed` mode. */
3343
+ displayLines: QuoteDisplayLineDto[];
3344
+ /**
3345
+ * What `displayLines` add up to: `incVatMinor` is `totals.payableMinor`. Null in `detailed` mode.
3346
+ * @nullable
3347
+ */
3348
+ displayTotals: QuoteDisplayTotalsDto | null;
3144
3349
  /** Components present on the cart that this quote did not price, or reductions it did not apply. Their absence from `totals` is intentional, never a zero charge. Values: GOODS, SERVICE, START_FEE, TRANSPORT (no configured article, price row, or computable rate — no line is emitted at all), INSURANCE (no plan catalogue exists yet), TRANSPORT_PARTIAL (a transport line IS priced from the rate card but excludes a component the cart carries no quantity for — a per-hour rate with no `estimatedHours`, or a per-unit rate with no shipment manifest — so the transport amount is a floor, not the final charge), TRANSPORT_RUT (the line is RUT-eligible but its price source carries no post-deduction price to derive the amount from), MATERIAL_DELIVERY (the cart holds a material:delivery timeslot; its underlying slot may carry a real price, but materials pricing is not yet designed, so it is excluded from `totals` rather than priced as ordinary transport), MERCHANDISE (at least one basketed SKU could not be priced and is excluded from `totals` — it was deactivated after being basketed, it has no active price for today in the cart's currency, or its price rule is malformed. Priceable SKUs in the same basket still appear as MERCHANDISE lines, so this value means 'some of the basket is missing from the total', not 'none of it is priced'). When the tenant's price-book mode is `live`, a PICKUP or DELIVERY cart's GOODS, START_FEE and TRANSPORT come from the pricing rules the invoice uses, and one of those values here means a rule could not price this cart — most often because the cart does not yet state what it reads (a volume with a line missing its dimensions, a slot price before a slot is held) — or reads a component that could not be priced; the rest of the cart is still priced. A rule-priced TRANSPORT line carries no post-deduction price, so a RUT cart reports TRANSPORT_RUT for it. TRANSPORT_PARTIAL does not occur in that mode. */
3145
3350
  deferred: string[];
3146
3351
  }
@@ -3495,38 +3700,71 @@ export interface AvailableServiceDto {
3495
3700
  * @nullable
3496
3701
  */
3497
3702
  fromPrice: MoneyDto | null;
3703
+ /**
3704
+ * `fromPrice` including VAT: the price as the price book states it where its prices include VAT (29,90 €, where `fromPrice` shows its net part, 23,82 €, which taxed again is 29,89 €), else `fromPrice` with its VAT added. Null exactly when `fromPrice` is.
3705
+ * @nullable
3706
+ */
3707
+ fromPriceIncVat: MoneyDto | null;
3498
3708
  /** Whether any future capacity day/slot exists for the service+zone */
3499
3709
  hasSlots: boolean;
3500
3710
  }
3501
3711
  export interface SlotPriceDto {
3502
3712
  /** @nullable */
3503
3713
  perM3ExVat?: string | null;
3504
- /** @nullable */
3714
+ /**
3715
+ * `perM3ExVat` including VAT. Null exactly when `perM3ExVat` is.
3716
+ * @nullable
3717
+ */
3505
3718
  perM3IncVat?: string | null;
3506
3719
  /** @nullable */
3507
3720
  perHourExVat?: string | null;
3508
3721
  /** @nullable */
3509
3722
  baseFeeExVat?: string | null;
3723
+ /**
3724
+ * `baseFeeExVat` including VAT. Null exactly when `baseFeeExVat` is.
3725
+ * @nullable
3726
+ */
3727
+ baseFeeIncVat?: string | null;
3510
3728
  /**
3511
3729
  * Money, ex VAT: what the slot's service zone adds ON TOP of the base transport price — show it as "+X". Null when the cart would add none: the slot has no zone of its own (a pooled slot), no zone surcharge rule lists the slot's zone above 0, or the zone is priced per m³ (zoneSurchargePerM3ExVat).
3512
3730
  * @nullable
3513
3731
  */
3514
3732
  zoneSurchargeExVat: string | null;
3733
+ /**
3734
+ * `zoneSurchargeExVat` including VAT — show it as "+X". Null exactly when `zoneSurchargeExVat` is.
3735
+ * @nullable
3736
+ */
3737
+ zoneSurchargeIncVat: string | null;
3515
3738
  /**
3516
3739
  * Money per m³, ex VAT: what the slot's service zone adds ON TOP of the base transport price for each m³ the order's transport bills, after its minimum billable volumes — show it as "+X/m³". Null when the zone adds nothing per m³; never set beside zoneSurchargeExVat.
3517
3740
  * @nullable
3518
3741
  */
3519
3742
  zoneSurchargePerM3ExVat: string | null;
3743
+ /**
3744
+ * `zoneSurchargePerM3ExVat` including VAT — show it as "+X/m³". Null exactly when `zoneSurchargePerM3ExVat` is.
3745
+ * @nullable
3746
+ */
3747
+ zoneSurchargePerM3IncVat: string | null;
3520
3748
  /**
3521
3749
  * Money, ex VAT: what this window adds ON TOP of the base transport price — show it as "+X". Null when the cart would add none: the window carries no surcharge, no pricing rule bills it, or the window is priced per m³ (windowSurchargePerM3ExVat).
3522
3750
  * @nullable
3523
3751
  */
3524
3752
  windowSurchargeExVat: string | null;
3753
+ /**
3754
+ * `windowSurchargeExVat` including VAT — show it as "+X". Null exactly when `windowSurchargeExVat` is.
3755
+ * @nullable
3756
+ */
3757
+ windowSurchargeIncVat: string | null;
3525
3758
  /**
3526
3759
  * Money per m³, ex VAT: what this window adds ON TOP of the base transport price for each m³ the order's transport bills, after its minimum billable volumes — show it as "+X/m³". Null when the window adds nothing per m³ or no pricing rule bills it; never set beside windowSurchargeExVat.
3527
3760
  * @nullable
3528
3761
  */
3529
3762
  windowSurchargePerM3ExVat: string | null;
3763
+ /**
3764
+ * `windowSurchargePerM3ExVat` including VAT — show it as "+X/m³". Null exactly when `windowSurchargePerM3ExVat` is.
3765
+ * @nullable
3766
+ */
3767
+ windowSurchargePerM3IncVat: string | null;
3530
3768
  /** @nullable */
3531
3769
  vatRate: string | null;
3532
3770
  /** @nullable */
@@ -6486,6 +6724,11 @@ export interface DisposalRequestQuoteLineDto {
6486
6724
  * @nullable
6487
6725
  */
6488
6726
  unitPriceExVatMinor: number | null;
6727
+ /**
6728
+ * Minor units, inc VAT: the price as written where the price book states it including VAT, else unitPriceExVatMinor with its VAT. Null exactly when unitPriceExVatMinor is.
6729
+ * @nullable
6730
+ */
6731
+ unitPriceIncVatMinor: number | null;
6489
6732
  /** Minor units, ex VAT. */
6490
6733
  totalExVatMinor: number;
6491
6734
  /** VAT percentage, e.g. 25.5. */
@@ -8477,7 +8720,7 @@ export interface UpdateBillingAccountDto {
8477
8720
  /** ISO 4217 currency code. */
8478
8721
  currencyCode?: string;
8479
8722
  /**
8480
- * Pin the account to one of the tenant's payment methods. `null` clears it, so the account uses the tenant default. An invoice keeps the method it was sent with; a Stripe-collected invoice's saved card is charged on its due date when that method is auto-chargeable.
8723
+ * Pin the account to one of the tenant's payment methods. `null` clears it, so the account uses the tenant default. A new pin must be an active, undeleted method of the account's own payment provider, or the request is a 400 naming why; sending the method already pinned is not re-checked. An invoice keeps the method it was sent with; a Stripe-collected invoice's saved card is charged on its due date when that method is auto-chargeable.
8481
8724
  * @nullable
8482
8725
  */
8483
8726
  paymentMethodId?: string | null;
@@ -8492,6 +8735,24 @@ export interface InvoiceNowDto {
8492
8735
  */
8493
8736
  reason: string;
8494
8737
  }
8738
+ /**
8739
+ * Where this invoice is bookkept: `manual` until POST /sync queues its Fortnox push, `fortnox` from then on. An imported invoice carries the provider it was imported with, so `fortnox` can come with syncStatus `not_required`. The invoice's own value, not the billing account's. Whether to offer Bookkeep is still decided by syncStatus.
8740
+ */
8741
+ export type InvoiceDtoAccountingProvider = typeof InvoiceDtoAccountingProvider[keyof typeof InvoiceDtoAccountingProvider];
8742
+ export declare const InvoiceDtoAccountingProvider: {
8743
+ readonly manual: "manual";
8744
+ readonly fortnox: "fortnox";
8745
+ readonly stripe: "stripe";
8746
+ };
8747
+ /**
8748
+ * The rail the invoice is sent on, frozen from the billing account when POST /send accepts it (so already set while sendStatus is `pending` or `failed`): manual = bank transfer, emailed by Fortnox; stripe = card, collected through Stripe. Null until then, except on an imported invoice, which carries its rail from the import. A later change to the billing account does not change it.
8749
+ * @nullable
8750
+ */
8751
+ export type InvoiceDtoPaymentProvider = typeof InvoiceDtoPaymentProvider[keyof typeof InvoiceDtoPaymentProvider] | null;
8752
+ export declare const InvoiceDtoPaymentProvider: {
8753
+ readonly manual: "manual";
8754
+ readonly stripe: "stripe";
8755
+ };
8495
8756
  export interface InvoiceDto {
8496
8757
  invoiceId: string;
8497
8758
  tenantId: string;
@@ -8532,6 +8793,18 @@ export interface InvoiceDto {
8532
8793
  * @nullable
8533
8794
  */
8534
8795
  paymentLinkUrl: string | null;
8796
+ /** Where this invoice is bookkept: `manual` until POST /sync queues its Fortnox push, `fortnox` from then on. An imported invoice carries the provider it was imported with, so `fortnox` can come with syncStatus `not_required`. The invoice's own value, not the billing account's. Whether to offer Bookkeep is still decided by syncStatus. */
8797
+ accountingProvider: InvoiceDtoAccountingProvider;
8798
+ /**
8799
+ * The rail the invoice is sent on, frozen from the billing account when POST /send accepts it (so already set while sendStatus is `pending` or `failed`): manual = bank transfer, emailed by Fortnox; stripe = card, collected through Stripe. Null until then, except on an imported invoice, which carries its rail from the import. A later change to the billing account does not change it.
8800
+ * @nullable
8801
+ */
8802
+ paymentProvider: InvoiceDtoPaymentProvider;
8803
+ /**
8804
+ * The payment method a card-rail invoice is collected with, frozen by POST /send: the billing account's own paymentMethodId, else the tenant's default. Null on the bank rail, before POST /send, and on an imported invoice. Look it up in GET /v1/billing/payment-methods (needs billingconfig:read): its isAutoChargeable decides whether the due-date charge charges a saved card, which also takes a default saved card and the tenant's auto-charge mode `live`.
8805
+ * @nullable
8806
+ */
8807
+ paymentMethodId: string | null;
8535
8808
  /** @nullable */
8536
8809
  snapshotCompanyName: string | null;
8537
8810
  /** @nullable */
@@ -8599,6 +8872,8 @@ export interface InvoiceRowDto {
8599
8872
  vatRate: string;
8600
8873
  /** ISO 4217 currency code. */
8601
8874
  currencyCode: string;
8875
+ /** Whether the row was priced including VAT (BE-2298): its amount is then `amountExVatMinor + vatAmountMinor`, and a credit note's `refundAmountMinor` for it is stated the same way. A row priced ex VAT is credited ex VAT. Rows of one article in the two bases are separate rows. */
8876
+ pricesIncludeVat: boolean;
8602
8877
  /**
8603
8878
  * Explanation printed on the invoice line: why a floor or minimum period applied, and the title of a campaign or discount code that reduced the row, in the customer's language.
8604
8879
  * @nullable
@@ -8612,6 +8887,8 @@ export interface InvoiceRowDto {
8612
8887
  descriptionOverride: string | null;
8613
8888
  /** The line the customer sees for this row on the invoice: descriptionOverride when set, otherwise the article name followed by freeText, in the invoice's language. Show this rather than rebuilding it. */
8614
8889
  description: string;
8890
+ /** Whether the copy of the invoice the customer receives (the Stripe or the Fortnox invoice) carries this row. False only for a row priced at nothing on an article with hideOnInvoiceWhenZero on, and never for every row of an invoice. Read from the article now, so it says what a push now would send: an invoice already pushed keeps the lines it was sent with. Every row stays on the invoice and counts towards its totals; a client showing the customer's invoice leaves out rows where this is false. */
8891
+ shownToCustomer: boolean;
8615
8892
  /** Coupon benefits that reduced this row. Empty when none did. */
8616
8893
  appliedCoupons: AppliedCouponSummaryDto[];
8617
8894
  /** What kind of row this is: charge = an ordinary charge; carried = a correction of an earlier month; clawback = a campaign benefit charged back; manual = a row staff added by hand, billed as entered. A credit note row has the kind of the row it credits. */
@@ -8632,6 +8909,95 @@ export interface InvoiceRowDto {
8632
8909
  */
8633
8910
  servicedAt: string | null;
8634
8911
  }
8912
+ /**
8913
+ * `category`: a price category's amount. `start_fee`: the start fee's, a row of its own. `discount`: what the campaigns, the binding discount and the code took off the row before it, as a negative amount; it follows that row and has the same `category` and `vatRate`.
8914
+ */
8915
+ export type InvoiceDisplayLineDtoKind = typeof InvoiceDisplayLineDtoKind[keyof typeof InvoiceDisplayLineDtoKind];
8916
+ export declare const InvoiceDisplayLineDtoKind: {
8917
+ readonly category: "category";
8918
+ readonly start_fee: "start_fee";
8919
+ readonly discount: "discount";
8920
+ };
8921
+ /**
8922
+ * The price category, as checkout shows the same charge: `storage` (storage nights, their minimums and the minimum monthly fee), `transport` (a pickup's or delivery's transport, its minimums and its window and zone surcharges), `start_fee` (a pickup's or delivery's start fee, on whichever article it is billed), `packing_materials` (merchandise, and packaging material charged on a cancel), `insurance`, `services` (every other charge: a service, a recycling fee, a row staff added).
8923
+ */
8924
+ export type InvoiceDisplayLineDtoCategory = typeof InvoiceDisplayLineDtoCategory[keyof typeof InvoiceDisplayLineDtoCategory];
8925
+ export declare const InvoiceDisplayLineDtoCategory: {
8926
+ readonly storage: "storage";
8927
+ readonly transport: "transport";
8928
+ readonly start_fee: "start_fee";
8929
+ readonly packing_materials: "packing_materials";
8930
+ readonly insurance: "insurance";
8931
+ readonly services: "services";
8932
+ };
8933
+ /**
8934
+ * `pcs`: items, the only unit an invoice states (`m3` is the quote's). Null exactly when `quantity` is.
8935
+ * @nullable
8936
+ */
8937
+ export type InvoiceDisplayLineDtoUnit = typeof InvoiceDisplayLineDtoUnit[keyof typeof InvoiceDisplayLineDtoUnit] | null;
8938
+ export declare const InvoiceDisplayLineDtoUnit: {
8939
+ readonly m3: "m3";
8940
+ readonly pcs: "pcs";
8941
+ };
8942
+ export interface InvoiceDisplayLineDto {
8943
+ /** `category`: a price category's amount. `start_fee`: the start fee's, a row of its own. `discount`: what the campaigns, the binding discount and the code took off the row before it, as a negative amount; it follows that row and has the same `category` and `vatRate`. */
8944
+ kind: InvoiceDisplayLineDtoKind;
8945
+ /** The price category, as checkout shows the same charge: `storage` (storage nights, their minimums and the minimum monthly fee), `transport` (a pickup's or delivery's transport, its minimums and its window and zone surcharges), `start_fee` (a pickup's or delivery's start fee, on whichever article it is billed), `packing_materials` (merchandise, and packaging material charged on a cancel), `insurance`, `services` (every other charge: a service, a recycling fee, a row staff added). */
8946
+ category: InvoiceDisplayLineDtoCategory;
8947
+ /** The row's label in the invoice's language (the organization's preferred language, else the billing account's country's): the category's name, or that category's discount. */
8948
+ description: string;
8949
+ /**
8950
+ * The number of packing-material items. Null on every other row: an invoice states no m³ for storage or transport, whose volume can change during the month.
8951
+ * @nullable
8952
+ */
8953
+ quantity: number | null;
8954
+ /**
8955
+ * `pcs`: items, the only unit an invoice states (`m3` is the quote's). Null exactly when `quantity` is.
8956
+ * @nullable
8957
+ */
8958
+ unit: InvoiceDisplayLineDtoUnit;
8959
+ /** The row's amount excluding VAT, integer minor units. A category row is before every reduction when a discount row follows it, after them otherwise; a discount row is negative. */
8960
+ amountExVatMinor: number;
8961
+ /** The row's amount including VAT, integer minor units, on the same basis as `amountExVatMinor`. Whether a discount row is shown is decided in the basis the prices are written in (including VAT where they include it). A discount row is never above zero in either figure, but a reduction smaller than a VAT rounding can leave the other one at 0. */
8962
+ amountIncVatMinor: number;
8963
+ /** VAT rate as a percentage (25 = 25%). A category whose rows carry different rates is split into one row per rate. */
8964
+ vatRate: number;
8965
+ }
8966
+ export interface InvoiceDisplayTotalsDto {
8967
+ /** Sum of `displayLines[].amountExVatMinor`, minor units */
8968
+ exVatMinor: number;
8969
+ /** `incVatMinor` − `exVatMinor`, minor units */
8970
+ vatMinor: number;
8971
+ /** Sum of `displayLines[].amountIncVatMinor`, minor units: what the rows the customer's copy shows add up to including VAT, the stored rows' amounts and VAT exactly. */
8972
+ incVatMinor: number;
8973
+ }
8974
+ /**
8975
+ * Where this invoice is bookkept: `manual` until POST /sync queues its Fortnox push, `fortnox` from then on. An imported invoice carries the provider it was imported with, so `fortnox` can come with syncStatus `not_required`. The invoice's own value, not the billing account's. Whether to offer Bookkeep is still decided by syncStatus.
8976
+ */
8977
+ export type InvoiceDetailDtoAccountingProvider = typeof InvoiceDetailDtoAccountingProvider[keyof typeof InvoiceDetailDtoAccountingProvider];
8978
+ export declare const InvoiceDetailDtoAccountingProvider: {
8979
+ readonly manual: "manual";
8980
+ readonly fortnox: "fortnox";
8981
+ readonly stripe: "stripe";
8982
+ };
8983
+ /**
8984
+ * The rail the invoice is sent on, frozen from the billing account when POST /send accepts it (so already set while sendStatus is `pending` or `failed`): manual = bank transfer, emailed by Fortnox; stripe = card, collected through Stripe. Null until then, except on an imported invoice, which carries its rail from the import. A later change to the billing account does not change it.
8985
+ * @nullable
8986
+ */
8987
+ export type InvoiceDetailDtoPaymentProvider = typeof InvoiceDetailDtoPaymentProvider[keyof typeof InvoiceDetailDtoPaymentProvider] | null;
8988
+ export declare const InvoiceDetailDtoPaymentProvider: {
8989
+ readonly manual: "manual";
8990
+ readonly stripe: "stripe";
8991
+ };
8992
+ /**
8993
+ * How the customer's copy of the invoice presents its prices, which decides `displayLines`. Frozen when the invoice is sent: the tenant's price presentation setting for an invoice sent as a Stripe invoice, `detailed` otherwise. An invoice not yet sent shows what sending it now would freeze; one sent before the setting reached invoices, a credit note, an adjustment and a voided invoice are `detailed`. `detailed`: show `rows` (those with `shownToCustomer`); `displayLines` is empty. `category_with_discounts`: one row per price category before its reductions, then a discount row per category one reduced. `category_net`: one row per category after them.
8994
+ */
8995
+ export type InvoiceDetailDtoPresentationMode = typeof InvoiceDetailDtoPresentationMode[keyof typeof InvoiceDetailDtoPresentationMode];
8996
+ export declare const InvoiceDetailDtoPresentationMode: {
8997
+ readonly detailed: "detailed";
8998
+ readonly category_with_discounts: "category_with_discounts";
8999
+ readonly category_net: "category_net";
9000
+ };
8635
9001
  export interface InvoiceDetailDto {
8636
9002
  invoiceId: string;
8637
9003
  tenantId: string;
@@ -8672,6 +9038,18 @@ export interface InvoiceDetailDto {
8672
9038
  * @nullable
8673
9039
  */
8674
9040
  paymentLinkUrl: string | null;
9041
+ /** Where this invoice is bookkept: `manual` until POST /sync queues its Fortnox push, `fortnox` from then on. An imported invoice carries the provider it was imported with, so `fortnox` can come with syncStatus `not_required`. The invoice's own value, not the billing account's. Whether to offer Bookkeep is still decided by syncStatus. */
9042
+ accountingProvider: InvoiceDetailDtoAccountingProvider;
9043
+ /**
9044
+ * The rail the invoice is sent on, frozen from the billing account when POST /send accepts it (so already set while sendStatus is `pending` or `failed`): manual = bank transfer, emailed by Fortnox; stripe = card, collected through Stripe. Null until then, except on an imported invoice, which carries its rail from the import. A later change to the billing account does not change it.
9045
+ * @nullable
9046
+ */
9047
+ paymentProvider: InvoiceDetailDtoPaymentProvider;
9048
+ /**
9049
+ * The payment method a card-rail invoice is collected with, frozen by POST /send: the billing account's own paymentMethodId, else the tenant's default. Null on the bank rail, before POST /send, and on an imported invoice. Look it up in GET /v1/billing/payment-methods (needs billingconfig:read): its isAutoChargeable decides whether the due-date charge charges a saved card, which also takes a default saved card and the tenant's auto-charge mode `live`.
9050
+ * @nullable
9051
+ */
9052
+ paymentMethodId: string | null;
8675
9053
  /** @nullable */
8676
9054
  snapshotCompanyName: string | null;
8677
9055
  /** @nullable */
@@ -8687,6 +9065,15 @@ export interface InvoiceDetailDto {
8687
9065
  /** @nullable */
8688
9066
  snapshotCorporateIdentityNumber: string | null;
8689
9067
  rows: InvoiceRowDto[];
9068
+ /** How the customer's copy of the invoice presents its prices, which decides `displayLines`. Frozen when the invoice is sent: the tenant's price presentation setting for an invoice sent as a Stripe invoice, `detailed` otherwise. An invoice not yet sent shows what sending it now would freeze; one sent before the setting reached invoices, a credit note, an adjustment and a voided invoice are `detailed`. `detailed`: show `rows` (those with `shownToCustomer`); `displayLines` is empty. `category_with_discounts`: one row per price category before its reductions, then a discount row per category one reduced. `category_net`: one row per category after them. */
9069
+ presentationMode: InvoiceDetailDtoPresentationMode;
9070
+ /** The rows the customer's copy shows, regrouped as `presentationMode` says, in the order to show them: storage, transport, start fee, packing materials, insurance, services, each by VAT rate, each followed by its discount row. The same rows the Stripe invoice is sent with. Built from the stored rows when read; the stored rows, totals and Fortnox copy are unchanged. Next to the minimum monthly fee, a storage discount row shows only what a reduction took off what is paid. Storage and transport rows state no quantity; packing materials state their item count. Empty in `detailed` mode. */
9071
+ displayLines: InvoiceDisplayLineDto[];
9072
+ /**
9073
+ * What `displayLines` add up to. Null in `detailed` mode.
9074
+ * @nullable
9075
+ */
9076
+ displayTotals: InvoiceDisplayTotalsDto | null;
8690
9077
  }
8691
9078
  export interface VoidInvoiceDto {
8692
9079
  /** Why the invoice is being voided (required, recorded on the row). */
@@ -8763,7 +9150,7 @@ export interface SetInvoiceRowDescriptionDto {
8763
9150
  }
8764
9151
  export interface CreditNoteRowDto {
8765
9152
  invoiceRowId: string;
8766
- /** Amount (excl. VAT, minor units, POSITIVE magnitude) to refund off this row. The service writes it as a negative credit-note row. */
9153
+ /** Amount (minor units, POSITIVE magnitude) to refund off this row, in the row's price basis: excl. VAT, unless the row was priced including VAT, when it includes VAT. The service writes it as a negative credit-note row. */
8767
9154
  refundAmountMinor: number;
8768
9155
  }
8769
9156
  export interface IssueCreditNoteDto {
@@ -8831,6 +9218,47 @@ export interface SendInvoiceResponseDto {
8831
9218
  /** The routing token enqueued for the Worker's InvoiceSendProcessor — derived from paymentProvider (manual → fortnox-email, stripe → stripe-payment). */
8832
9219
  rail: SendInvoiceResponseDtoRail;
8833
9220
  }
9221
+ export interface CollectionHoldCreditNoteDto {
9222
+ /** The credit note's own id; read it with GET /v1/billing/invoices/{id}. */
9223
+ invoiceId: string;
9224
+ /** Invoice status enum: CREATED or READY while a draft, SENT or later once sent. */
9225
+ invoiceStatus: string;
9226
+ /** The credit note's total in minor currency units, negative as the credit note stores it. */
9227
+ totalMinor: number;
9228
+ /** When the credit note was created. */
9229
+ createdAt: string;
9230
+ }
9231
+ /**
9232
+ * DRAFT_CREDIT_NOTE: every credit note against the invoice is a draft (CREATED or READY). While one is, the due-date charge neither charges the card nor moves the invoice to OVERDUE; one already OVERDUE stays so. Send the draft or void it: once it is voided, the charge treats the invoice as if the credit note had never existed. CREDITED: a credit note against the invoice has been sent. The due-date charge has stopped for good: it never charges the card or moves the invoice to OVERDUE, and one already OVERDUE stays so. With remainingMinor > 0 the rest is collected by hand; with remainingMinor <= 0 nothing is owed, but the Stripe invoice still asks for its full amount until it is voided in Stripe. Either way the invoice stays listed while its status is SENT, PARTIALLY_PAID or OVERDUE.
9233
+ */
9234
+ export type CollectionHoldDtoReason = typeof CollectionHoldDtoReason[keyof typeof CollectionHoldDtoReason];
9235
+ export declare const CollectionHoldDtoReason: {
9236
+ readonly DRAFT_CREDIT_NOTE: "DRAFT_CREDIT_NOTE";
9237
+ readonly CREDITED: "CREDITED";
9238
+ };
9239
+ export interface CollectionHoldDto {
9240
+ invoice: InvoiceDto;
9241
+ /** DRAFT_CREDIT_NOTE: every credit note against the invoice is a draft (CREATED or READY). While one is, the due-date charge neither charges the card nor moves the invoice to OVERDUE; one already OVERDUE stays so. Send the draft or void it: once it is voided, the charge treats the invoice as if the credit note had never existed. CREDITED: a credit note against the invoice has been sent. The due-date charge has stopped for good: it never charges the card or moves the invoice to OVERDUE, and one already OVERDUE stays so. With remainingMinor > 0 the rest is collected by hand; with remainingMinor <= 0 nothing is owed, but the Stripe invoice still asks for its full amount until it is voided in Stripe. Either way the invoice stays listed while its status is SENT, PARTIALLY_PAID or OVERDUE. */
9242
+ reason: CollectionHoldDtoReason;
9243
+ /** Every credit note against the invoice that is not voided, oldest first. */
9244
+ creditNotes: CollectionHoldCreditNoteDto[];
9245
+ /** What the sent credit notes credit, in minor currency units, as a positive amount. Drafts are not counted. */
9246
+ creditedMinor: number;
9247
+ /** The payments recorded against the invoice, in minor currency units. */
9248
+ paidMinor: number;
9249
+ /** invoice.totalMinor − creditedMinor − paidMinor, in minor currency units. Zero or negative when nothing is owed. */
9250
+ remainingMinor: number;
9251
+ }
9252
+ export interface PaginatedCollectionHoldsDto {
9253
+ /** The page of rows. */
9254
+ items: CollectionHoldDto[];
9255
+ /** Exact count of all rows matching the filter, pre-pagination (RLS-scoped). */
9256
+ total: number;
9257
+ /** Effective max rows applied (after defaults/clamp). */
9258
+ limit: number;
9259
+ /** Effective rows skipped applied. */
9260
+ offset: number;
9261
+ }
8834
9262
  export interface ArticleTranslationDto {
8835
9263
  /** @maxLength 80 */
8836
9264
  name: string;
@@ -8861,6 +9289,8 @@ export interface ArticleDto {
8861
9289
  vatInclusiveDefault: boolean;
8862
9290
  rutEligible: boolean;
8863
9291
  isActive: boolean;
9292
+ /** Leave this article's rows off the customer's copy of an invoice (the Stripe or the Fortnox invoice) when they were priced at nothing: zero in both amounts, not reduced by a campaign, a code or a discount rule, not added or reworded by staff, carrying no labour hours, and with another line of the invoice still printed. The invoice itself keeps every row, so totals do not change, and its rows say which ones the customer gets (`shownToCustomer`). Read when an invoice is pushed: a change reaches every invoice not yet pushed, and one already pushed keeps its lines. */
9293
+ hideOnInvoiceWhenZero: boolean;
8864
9294
  createdAt: string;
8865
9295
  updatedAt: string;
8866
9296
  }
@@ -8895,6 +9325,8 @@ export interface CreateArticleDto {
8895
9325
  vatInclusiveDefault?: boolean;
8896
9326
  rutEligible?: boolean;
8897
9327
  isActive?: boolean;
9328
+ /** Leave this article's rows off the customer's copy of an invoice (the Stripe or the Fortnox invoice) when they were priced at nothing: zero in both amounts, not reduced by a campaign, a code or a discount rule, not added or reworded by staff, carrying no labour hours, and with another line of the invoice still printed. The invoice itself keeps every row, so totals do not change, and its rows say which ones the customer gets (`shownToCustomer`). Read when an invoice is pushed: a change reaches every invoice not yet pushed, and one already pushed keeps its lines. Omitted stores false. */
9329
+ hideOnInvoiceWhenZero?: boolean;
8898
9330
  /** Default VAT rate, a percentage (numeric column → string): 25.0000 for 25 %, 25.5000 for 25.5 %. Invoice rows priced on this article take their VAT from it. */
8899
9331
  vatRateDefault: string;
8900
9332
  }
@@ -8914,6 +9346,8 @@ export interface UpdateArticleDto {
8914
9346
  vatInclusiveDefault?: boolean;
8915
9347
  rutEligible?: boolean;
8916
9348
  isActive?: boolean;
9349
+ /** Leave this article's rows off the customer's copy of an invoice (the Stripe or the Fortnox invoice) when they were priced at nothing: zero in both amounts, not reduced by a campaign, a code or a discount rule, not added or reworded by staff, carrying no labour hours, and with another line of the invoice still printed. The invoice itself keeps every row, so totals do not change, and its rows say which ones the customer gets (`shownToCustomer`). Read when an invoice is pushed: a change reaches every invoice not yet pushed, and one already pushed keeps its lines. Omitted leaves it as it is. */
9350
+ hideOnInvoiceWhenZero?: boolean;
8917
9351
  /** Default VAT rate (numeric column → string, e.g. 25.0000). */
8918
9352
  vatRateDefault?: string;
8919
9353
  }
@@ -8957,6 +9391,8 @@ export interface TenantBillingConfigDto {
8957
9391
  timezone: string;
8958
9392
  /** When one-off charges (a transport, its start fee, a failed-transport or packaging fee) are invoiced: `per_charge` (on an invoice of their own, the day after they are incurred) or `monthly` (on the calendar month's invoice beside storage, once the month has closed). Storage, subscription and recurring charges are invoiced monthly either way. Defaults to `per_charge`. Written by platform admins only. */
8959
9393
  oneOffInvoicing: TenantBillingConfigDtoOneOffInvoicing;
9394
+ /** Whether the tenant's prices are written including VAT: the basis every price book price, per-customer price and merchandise price written from now on is stated in. A price of 29,90 € including VAT at 25,5 % bills 23,82 € and 6,08 € VAT. Each price keeps the basis it was written in (`pricesIncludeVat` on each rule), so changing this re-prices nothing. Defaults to false. Changed by a tenant admin. */
9395
+ pricesIncludeVat: boolean;
8960
9396
  createdAt: string;
8961
9397
  updatedAt: string;
8962
9398
  enabledCurrencies: EnabledCurrencyDto[];
@@ -8970,6 +9406,7 @@ export declare const UpdateTenantBillingConfigDtoOneOffInvoicing: {
8970
9406
  readonly monthly: "monthly";
8971
9407
  };
8972
9408
  export interface UpdateTenantBillingConfigDto {
9409
+ /** The payment method of every billing account without its own: a Stripe-collected invoice's saved card is charged on its due date when this method is auto-chargeable. A change must name an active, undeleted payment method of this tenant, of any provider; anything else gets 400 with `code` `payment_method_not_found`, `payment_method_deleted` or `payment_method_inactive`, and nothing is written. Sending the current value back is accepted, even if that method has since gone inactive. */
8973
9410
  defaultPaymentMethodId?: string;
8974
9411
  defaultPaymentTermId?: string;
8975
9412
  defaultBillingFrequencyId?: string;
@@ -8980,6 +9417,8 @@ export interface UpdateTenantBillingConfigDto {
8980
9417
  timezone?: string;
8981
9418
  /** When one-off charges are invoiced (see the read model). **Changed by platform admins only**: anyone else sending a value that differs from the current one gets 403 and nothing is written. Sending the current value back — a form that round-trips the object — is accepted. A change applies to the charges not yet invoiced; nothing already invoiced moves. */
8982
9419
  oneOffInvoicing?: UpdateTenantBillingConfigDtoOneOffInvoicing;
9420
+ /** Whether prices are written including VAT from now on (see the read model). Nothing already written is re-priced: switch the price book with a change set effective on the 1st of a month after setting this. **Changed by tenant admins only**: anyone else sending a value that differs from the current one gets 403. A change is refused with 409 while a price book draft is open (`prices_include_vat_price_book_draft_open`: publish or discard it first, since its prices were written in the old basis), and turning it on is refused while the tenant's default accounting provider or any billing account's is Fortnox (`prices_include_vat_fortnox_in_use`: the Fortnox push sends prices ex VAT). Sending the current value back is accepted. */
9421
+ pricesIncludeVat?: boolean;
8983
9422
  changeReason?: string;
8984
9423
  }
8985
9424
  export interface EnabledCurrencyInputDto {
@@ -8992,30 +9431,245 @@ export interface EnabledCurrencyInputDto {
8992
9431
  export interface ReplaceEnabledCurrenciesDto {
8993
9432
  currencies: EnabledCurrencyInputDto[];
8994
9433
  }
8995
- export interface CustomerSubscriptionConfigDto {
8996
- customerSubscriptionConfigId: string;
8997
- tenantId: string;
8998
- organizationId: string;
8999
- billingAccountId: string;
9000
- /** @nullable */
9001
- billingFrequencyId: string | null;
9002
- /** @nullable */
9003
- bindingPlanId: string | null;
9434
+ export type InvoiceTextLocaleDtoLocale = typeof InvoiceTextLocaleDtoLocale[keyof typeof InvoiceTextLocaleDtoLocale];
9435
+ export declare const InvoiceTextLocaleDtoLocale: {
9436
+ readonly 'sv-SE': "sv-SE";
9437
+ readonly 'en-GB': "en-GB";
9438
+ readonly 'fi-FI': "fi-FI";
9439
+ };
9440
+ export interface InvoiceTextLocaleDto {
9441
+ locale: InvoiceTextLocaleDtoLocale;
9442
+ /** What an invoice built now is labelled with in this locale: the tenant's text, else the platform's. */
9443
+ text: string;
9444
+ /** The platform's text in this locale, which a cleared text goes back to. */
9445
+ platformDefault: string;
9446
+ /** Whether the tenant has its own text in this locale. */
9447
+ overridden: boolean;
9448
+ }
9449
+ /**
9450
+ * floor_quantity / floor_fee: a contracted minimum quantity or charge applied; minimum_period: days billed for the minimum storage period; carried: a correction for an earlier month; clawback: a campaign benefit charged back, followed by the campaign's title; minimum_monthly_fee: the lift to the minimum monthly storage fee.
9451
+ */
9452
+ export type InvoiceTextDtoKey = typeof InvoiceTextDtoKey[keyof typeof InvoiceTextDtoKey];
9453
+ export declare const InvoiceTextDtoKey: {
9454
+ readonly floor_quantity: "floor_quantity";
9455
+ readonly floor_fee: "floor_fee";
9456
+ readonly minimum_period: "minimum_period";
9457
+ readonly carried: "carried";
9458
+ readonly clawback: "clawback";
9459
+ readonly minimum_monthly_fee: "minimum_monthly_fee";
9460
+ };
9461
+ export interface InvoiceTextDto {
9462
+ /** floor_quantity / floor_fee: a contracted minimum quantity or charge applied; minimum_period: days billed for the minimum storage period; carried: a correction for an earlier month; clawback: a campaign benefit charged back, followed by the campaign's title; minimum_monthly_fee: the lift to the minimum monthly storage fee. */
9463
+ key: InvoiceTextDtoKey;
9464
+ /** The longest text accepted for this label. It leaves room on the 200-character invoice line for an article name of up to 80 characters, and for clawback also a campaign title. A campaign or code title after another label is cut when a long label leaves it no room. */
9465
+ maxLength: number;
9466
+ locales: InvoiceTextLocaleDto[];
9467
+ }
9468
+ export interface InvoiceTextLocalesInputDto {
9004
9469
  /**
9005
- * Engine-managed binding discount snapshot (basis points).
9470
+ * Omitted or null: the platform's text in this locale.
9471
+ * @maxLength 119
9006
9472
  * @nullable
9007
9473
  */
9008
- bindingDiscountSnapshotBps: number | null;
9474
+ 'sv-SE'?: string | null;
9009
9475
  /**
9010
- * Engine-managed binding discount snapshot timestamp.
9476
+ * Omitted or null: the platform's text in this locale.
9477
+ * @maxLength 119
9011
9478
  * @nullable
9012
9479
  */
9013
- bindingDiscountSnapshotAt: string | null;
9014
- /** @nullable */
9015
- volume: number | null;
9016
- /** @nullable */
9017
- billableVolume: number | null;
9018
- /** @nullable */
9480
+ 'en-GB'?: string | null;
9481
+ /**
9482
+ * Omitted or null: the platform's text in this locale.
9483
+ * @maxLength 119
9484
+ * @nullable
9485
+ */
9486
+ 'fi-FI'?: string | null;
9487
+ }
9488
+ export interface ClawbackInvoiceTextLocalesInputDto {
9489
+ /**
9490
+ * Omitted or null: the platform's text in this locale.
9491
+ * @maxLength 38
9492
+ * @nullable
9493
+ */
9494
+ 'sv-SE'?: string | null;
9495
+ /**
9496
+ * Omitted or null: the platform's text in this locale.
9497
+ * @maxLength 38
9498
+ * @nullable
9499
+ */
9500
+ 'en-GB'?: string | null;
9501
+ /**
9502
+ * Omitted or null: the platform's text in this locale.
9503
+ * @maxLength 38
9504
+ * @nullable
9505
+ */
9506
+ 'fi-FI'?: string | null;
9507
+ }
9508
+ export interface InvoiceTextsInputDto {
9509
+ /**
9510
+ * Omitted or null: the platform's text in every locale.
9511
+ * @nullable
9512
+ */
9513
+ floor_quantity?: InvoiceTextLocalesInputDto | null;
9514
+ /**
9515
+ * Omitted or null: the platform's text in every locale.
9516
+ * @nullable
9517
+ */
9518
+ floor_fee?: InvoiceTextLocalesInputDto | null;
9519
+ /**
9520
+ * Omitted or null: the platform's text in every locale.
9521
+ * @nullable
9522
+ */
9523
+ minimum_period?: InvoiceTextLocalesInputDto | null;
9524
+ /**
9525
+ * Omitted or null: the platform's text in every locale.
9526
+ * @nullable
9527
+ */
9528
+ carried?: InvoiceTextLocalesInputDto | null;
9529
+ /**
9530
+ * Omitted or null: the platform's text in every locale.
9531
+ * @nullable
9532
+ */
9533
+ clawback?: ClawbackInvoiceTextLocalesInputDto | null;
9534
+ /**
9535
+ * Omitted or null: the platform's text in every locale.
9536
+ * @nullable
9537
+ */
9538
+ minimum_monthly_fee?: InvoiceTextLocalesInputDto | null;
9539
+ }
9540
+ export interface ReplaceInvoiceTextsDto {
9541
+ /** The tenant's text for each label and locale, replacing every text it had. A label or locale left out, or null, reads the platform's text in that locale; `{}` resets every label. */
9542
+ texts: InvoiceTextsInputDto;
9543
+ }
9544
+ /**
9545
+ * How the tenant's prices are presented to its customers. `detailed` (the default): the pricing engine's lines, each minimum and surcharge on a line of its own. `category_with_discounts`: one row per price category (storage, transport, the start fee, packing materials, insurance, services) at its price before every campaign, binding discount and code, then a discount row per category one of them reduced. `category_net`: one row per category at its price after them. Every minimum folds into its category and the window and zone surcharges into transport; nothing is priced differently.
9546
+ */
9547
+ export type PricePresentationDtoMode = typeof PricePresentationDtoMode[keyof typeof PricePresentationDtoMode];
9548
+ export declare const PricePresentationDtoMode: {
9549
+ readonly detailed: "detailed";
9550
+ readonly category_with_discounts: "category_with_discounts";
9551
+ readonly category_net: "category_net";
9552
+ };
9553
+ export interface PricePresentationDto {
9554
+ /** How the tenant's prices are presented to its customers. `detailed` (the default): the pricing engine's lines, each minimum and surcharge on a line of its own. `category_with_discounts`: one row per price category (storage, transport, the start fee, packing materials, insurance, services) at its price before every campaign, binding discount and code, then a discount row per category one of them reduced. `category_net`: one row per category at its price after them. Every minimum folds into its category and the window and zone surcharges into transport; nothing is priced differently. */
9555
+ mode: PricePresentationDtoMode;
9556
+ }
9557
+ /**
9558
+ * The mode in force. `off` — the job does nothing for the tenant: no charge, no move to OVERDUE. Invoices keep their schedule and are acted on, late, once the mode is `live` again. `shadow` (the default) — it logs what it would do and calls nothing in Stripe and writes nothing. `live` — it charges the saved card on the due date and moves an invoice still unpaid afterwards to OVERDUE.
9559
+ */
9560
+ export type InvoiceAutoChargeModeDtoMode = typeof InvoiceAutoChargeModeDtoMode[keyof typeof InvoiceAutoChargeModeDtoMode];
9561
+ export declare const InvoiceAutoChargeModeDtoMode: {
9562
+ readonly off: "off";
9563
+ readonly shadow: "shadow";
9564
+ readonly live: "live";
9565
+ };
9566
+ export interface InvoiceAutoChargeModeDto {
9567
+ /** The mode in force. `off` — the job does nothing for the tenant: no charge, no move to OVERDUE. Invoices keep their schedule and are acted on, late, once the mode is `live` again. `shadow` (the default) — it logs what it would do and calls nothing in Stripe and writes nothing. `live` — it charges the saved card on the due date and moves an invoice still unpaid afterwards to OVERDUE. */
9568
+ mode: InvoiceAutoChargeModeDtoMode;
9569
+ /** Whether the tenant has a stored mode. False means `mode` is the `shadow` default, which nobody has chosen. */
9570
+ configured: boolean;
9571
+ /**
9572
+ * Keycloak `sub` of whoever set the stored mode through this API. Null when nothing is stored, and when the stored mode is not the one the newest change through this API set: it was then set directly in the database, which records no actor.
9573
+ * @nullable
9574
+ */
9575
+ changedByUserSub: string | null;
9576
+ /**
9577
+ * When that change was made. Null whenever `changedByUserSub` is.
9578
+ * @nullable
9579
+ */
9580
+ changedAt: string | null;
9581
+ /**
9582
+ * The reason recorded with that change. Null whenever `changedByUserSub` is.
9583
+ * @nullable
9584
+ */
9585
+ changeReason: string | null;
9586
+ }
9587
+ /**
9588
+ * `off` — the job does nothing for the tenant: no charge, no move to OVERDUE. Invoices keep their schedule and are acted on, late, once the mode is `live` again. `shadow` (the default) — it logs what it would do and calls nothing in Stripe and writes nothing. `live` — it charges the saved card on the due date and moves an invoice still unpaid afterwards to OVERDUE.
9589
+ */
9590
+ export type SetInvoiceAutoChargeModeDtoMode = typeof SetInvoiceAutoChargeModeDtoMode[keyof typeof SetInvoiceAutoChargeModeDtoMode];
9591
+ export declare const SetInvoiceAutoChargeModeDtoMode: {
9592
+ readonly off: "off";
9593
+ readonly shadow: "shadow";
9594
+ readonly live: "live";
9595
+ };
9596
+ export interface SetInvoiceAutoChargeModeDto {
9597
+ /** `off` — the job does nothing for the tenant: no charge, no move to OVERDUE. Invoices keep their schedule and are acted on, late, once the mode is `live` again. `shadow` (the default) — it logs what it would do and calls nothing in Stripe and writes nothing. `live` — it charges the saved card on the due date and moves an invoice still unpaid afterwards to OVERDUE. */
9598
+ mode: SetInvoiceAutoChargeModeDtoMode;
9599
+ /** Why the mode is changing. Recorded in the admin action. */
9600
+ reason: string;
9601
+ }
9602
+ /**
9603
+ * The mode in force. `off` — the job does nothing for the tenant: no charge, no move to OVERDUE. Invoices keep their schedule and are acted on, late, once the mode is `live` again. `shadow` (the default) — it logs what it would do and calls nothing in Stripe and writes nothing. `live` — it charges the saved card on the due date and moves an invoice still unpaid afterwards to OVERDUE.
9604
+ */
9605
+ export type SetInvoiceAutoChargeModeResultDtoMode = typeof SetInvoiceAutoChargeModeResultDtoMode[keyof typeof SetInvoiceAutoChargeModeResultDtoMode];
9606
+ export declare const SetInvoiceAutoChargeModeResultDtoMode: {
9607
+ readonly off: "off";
9608
+ readonly shadow: "shadow";
9609
+ readonly live: "live";
9610
+ };
9611
+ /**
9612
+ * The mode this call replaced. Null when the tenant had no stored mode, i.e. it was on the `shadow` default.
9613
+ * @nullable
9614
+ */
9615
+ export type SetInvoiceAutoChargeModeResultDtoPreviousMode = typeof SetInvoiceAutoChargeModeResultDtoPreviousMode[keyof typeof SetInvoiceAutoChargeModeResultDtoPreviousMode] | null;
9616
+ export declare const SetInvoiceAutoChargeModeResultDtoPreviousMode: {
9617
+ readonly off: "off";
9618
+ readonly shadow: "shadow";
9619
+ readonly live: "live";
9620
+ };
9621
+ export interface SetInvoiceAutoChargeModeResultDto {
9622
+ /** The mode in force. `off` — the job does nothing for the tenant: no charge, no move to OVERDUE. Invoices keep their schedule and are acted on, late, once the mode is `live` again. `shadow` (the default) — it logs what it would do and calls nothing in Stripe and writes nothing. `live` — it charges the saved card on the due date and moves an invoice still unpaid afterwards to OVERDUE. */
9623
+ mode: SetInvoiceAutoChargeModeResultDtoMode;
9624
+ /** Whether the tenant has a stored mode. False means `mode` is the `shadow` default, which nobody has chosen. */
9625
+ configured: boolean;
9626
+ /**
9627
+ * Keycloak `sub` of whoever set the stored mode through this API. Null when nothing is stored, and when the stored mode is not the one the newest change through this API set: it was then set directly in the database, which records no actor.
9628
+ * @nullable
9629
+ */
9630
+ changedByUserSub: string | null;
9631
+ /**
9632
+ * When that change was made. Null whenever `changedByUserSub` is.
9633
+ * @nullable
9634
+ */
9635
+ changedAt: string | null;
9636
+ /**
9637
+ * The reason recorded with that change. Null whenever `changedByUserSub` is.
9638
+ * @nullable
9639
+ */
9640
+ changeReason: string | null;
9641
+ /**
9642
+ * The mode this call replaced. Null when the tenant had no stored mode, i.e. it was on the `shadow` default.
9643
+ * @nullable
9644
+ */
9645
+ previousMode: SetInvoiceAutoChargeModeResultDtoPreviousMode;
9646
+ /** True when this call replayed a prior result for the same Idempotency-Key and wrote nothing. */
9647
+ idempotent: boolean;
9648
+ }
9649
+ export interface CustomerSubscriptionConfigDto {
9650
+ customerSubscriptionConfigId: string;
9651
+ tenantId: string;
9652
+ organizationId: string;
9653
+ billingAccountId: string;
9654
+ /** @nullable */
9655
+ billingFrequencyId: string | null;
9656
+ /** @nullable */
9657
+ bindingPlanId: string | null;
9658
+ /**
9659
+ * Engine-managed binding discount snapshot (basis points).
9660
+ * @nullable
9661
+ */
9662
+ bindingDiscountSnapshotBps: number | null;
9663
+ /**
9664
+ * Engine-managed binding discount snapshot timestamp.
9665
+ * @nullable
9666
+ */
9667
+ bindingDiscountSnapshotAt: string | null;
9668
+ /** @nullable */
9669
+ volume: number | null;
9670
+ /** @nullable */
9671
+ billableVolume: number | null;
9672
+ /** @nullable */
9019
9673
  bindingPeriodEnd: string | null;
9020
9674
  /** @nullable */
9021
9675
  bindingVolume: number | null;
@@ -9946,6 +10600,8 @@ export interface PricingRuleDto {
9946
10600
  calculationMethod: string;
9947
10601
  /** Method-specific parameters (JSON). */
9948
10602
  parameters: PricingRuleDtoParameters;
10603
+ /** Whether the amounts in `parameters` include VAT (BE-2298): stamped from the tenant's `pricesIncludeVat` whenever the parameters are written, and kept when the tenant's changes. A price that includes VAT bills its amount with the VAT taken out of it (29,90 € at 25,5 % is 23,82 € and 6,08 € VAT); one that excludes it is taxed on top. */
10604
+ pricesIncludeVat: boolean;
9949
10605
  /** Rule scope: order / product / shipment / storage / time / material. */
9950
10606
  ruleScope: string;
9951
10607
  /** Engine stage (lower runs first; layered rules differ). */
@@ -10067,7 +10723,10 @@ export interface SimulatedBasisRowDto {
10067
10723
  quantity: number;
10068
10724
  unitOfMeasureId: string;
10069
10725
  unitCode: string;
10070
- /** @nullable */
10726
+ /**
10727
+ * The rule's unit price, in the row's basis (`pricesIncludeVat`).
10728
+ * @nullable
10729
+ */
10071
10730
  unitPriceMinor: number | null;
10072
10731
  /** Amount excl. VAT in minor currency units. */
10073
10732
  amountExVatMinor: number;
@@ -10075,6 +10734,8 @@ export interface SimulatedBasisRowDto {
10075
10734
  vatRate: number;
10076
10735
  /** Pre-discount VAT in minor currency units. */
10077
10736
  vatAmountMinor: number;
10737
+ /** Whether the row's price includes VAT (BE-2298): its amount is then `amountExVatMinor + vatAmountMinor`, split out of the price, and a reduction applies to the two together. A template is simulated in the tenant's basis, which is what applying it would stamp; a self-cost-plus-markup row is ex VAT whatever the basis. */
10738
+ pricesIncludeVat: boolean;
10078
10739
  currencyCode: string;
10079
10740
  ruleScope: string;
10080
10741
  componentCode: string;
@@ -10092,6 +10753,8 @@ export interface ProjectedInvoiceRowDto {
10092
10753
  amountExVatMinor: number;
10093
10754
  /** VAT amount in minor currency units, BEFORE discounts. */
10094
10755
  vatAmountMinor: number;
10756
+ /** Whether the row's price includes VAT (BE-2298). Rows of one article in the two bases are projected onto separate invoice rows, as the invoice bills them. */
10757
+ pricesIncludeVat: boolean;
10095
10758
  rutEligible: boolean;
10096
10759
  /** @nullable */
10097
10760
  periodStart: string | null;
@@ -10192,7 +10855,7 @@ export interface SimulatedQuoteDeferralDto {
10192
10855
  export interface SimulatedQuoteDto {
10193
10856
  /** ISO 4217 — the currency all amounts are expressed in */
10194
10857
  currencyCode: string;
10195
- /** One line per priced component, as the cart lists them: the transport base, a zone surcharge, a window surcharge, the start fee, storage, and each floor (`floorKind` quantity or fee) on a line of its own. Each campaign's reduction is on the line it reduces (`campaignDiscountExVatMinor`). */
10858
+ /** One line per priced component, as the cart lists them: the transport base, a zone surcharge, a window surcharge, the start fee, storage, and each floor (`floorKind` quantity or fee) on a line of its own. Each campaign's reduction is on the line it reduces (`campaignDiscountExVatMinor`). A preview has no cart lines, so no line carries `floorItems`. */
10196
10859
  lines: QuoteLineDto[];
10197
10860
  volume: QuoteVolumeDto;
10198
10861
  /** The automatic campaigns applied (newCustomerInCampaignWindow); status is qualifies. */
@@ -10654,6 +11317,8 @@ export interface PriceBookDto {
10654
11317
  * @nullable
10655
11318
  */
10656
11319
  currencyCode: string | null;
11320
+ /** Whether the tenant's prices are written including VAT (the tenant billing config's `pricesIncludeVat`, BE-2298): the basis a section written now is stated in. Each rule carries its own basis (`pricesIncludeVat`), which differs from this one for a rule written before the tenant's changed. */
11321
+ pricesIncludeVat: boolean;
10657
11322
  sections: PriceBookSectionDto[];
10658
11323
  /**
10659
11324
  * The tenant's open draft, or null.
@@ -11048,6 +11713,11 @@ export interface ExportedProfileDto {
11048
11713
  deletedAt: string | null;
11049
11714
  /** @nullable */
11050
11715
  forgottenAt: string | null;
11716
+ /**
11717
+ * The personnummer, null when none is held. Absent when `notIncluded` lists `personal_identity_number`: the tenant has no credential to read it with.
11718
+ * @nullable
11719
+ */
11720
+ personalIdentityNumber?: string | null;
11051
11721
  }
11052
11722
  export interface ExportedMembershipDto {
11053
11723
  organizationId: string;
@@ -11099,6 +11769,209 @@ export interface ExportedConsentDto {
11099
11769
  consentVersion: string;
11100
11770
  acceptedAt: string;
11101
11771
  }
11772
+ export type ExportedOrdersDtoOrderGroupsItem = {
11773
+ [key: string]: unknown;
11774
+ };
11775
+ export type ExportedOrdersDtoSalesOrdersItem = {
11776
+ [key: string]: unknown;
11777
+ };
11778
+ export type ExportedOrdersDtoEstimatesItem = {
11779
+ [key: string]: unknown;
11780
+ };
11781
+ export type ExportedOrdersDtoProductsItem = {
11782
+ [key: string]: unknown;
11783
+ };
11784
+ export type ExportedOrdersDtoMerchandiseItem = {
11785
+ [key: string]: unknown;
11786
+ };
11787
+ export type ExportedOrdersDtoTransportLegsItem = {
11788
+ [key: string]: unknown;
11789
+ };
11790
+ export type ExportedOrdersDtoCarrierBookingsItem = {
11791
+ [key: string]: unknown;
11792
+ };
11793
+ export type ExportedOrdersDtoWarehouseOrdersItem = {
11794
+ [key: string]: unknown;
11795
+ };
11796
+ export type ExportedOrdersDtoWarehouseOrderProductsItem = {
11797
+ [key: string]: unknown;
11798
+ };
11799
+ export type ExportedOrdersDtoWarehouseOrderContainersItem = {
11800
+ [key: string]: unknown;
11801
+ };
11802
+ export interface ExportedOrdersDto {
11803
+ /** `public.order_group` rows, live and soft-deleted. */
11804
+ orderGroups: ExportedOrdersDtoOrderGroupsItem[];
11805
+ /** `public.sales_order` rows, live and soft-deleted. */
11806
+ salesOrders: ExportedOrdersDtoSalesOrdersItem[];
11807
+ /** `public.sales_order_estimate` rows, live and soft-deleted. */
11808
+ estimates: ExportedOrdersDtoEstimatesItem[];
11809
+ /** `public.sales_order_product` rows, live and soft-deleted. */
11810
+ products: ExportedOrdersDtoProductsItem[];
11811
+ /** `public.sales_order_merchandise` rows, live and soft-deleted. */
11812
+ merchandise: ExportedOrdersDtoMerchandiseItem[];
11813
+ /** `public.order_transport_leg` rows, live and soft-deleted. */
11814
+ transportLegs: ExportedOrdersDtoTransportLegsItem[];
11815
+ /** `public.carrier_booking` rows, live and soft-deleted. */
11816
+ carrierBookings: ExportedOrdersDtoCarrierBookingsItem[];
11817
+ /** `public.warehouse_order` rows, live and soft-deleted. */
11818
+ warehouseOrders: ExportedOrdersDtoWarehouseOrdersItem[];
11819
+ /** `public.warehouse_order_product` rows, live and soft-deleted. */
11820
+ warehouseOrderProducts: ExportedOrdersDtoWarehouseOrderProductsItem[];
11821
+ /** `public.warehouse_order_container` rows, live and soft-deleted. */
11822
+ warehouseOrderContainers: ExportedOrdersDtoWarehouseOrderContainersItem[];
11823
+ }
11824
+ export type ExportedCartsDtoCartsItem = {
11825
+ [key: string]: unknown;
11826
+ };
11827
+ export type ExportedCartsDtoProductsItem = {
11828
+ [key: string]: unknown;
11829
+ };
11830
+ export type ExportedCartsDtoMerchandiseItem = {
11831
+ [key: string]: unknown;
11832
+ };
11833
+ export interface ExportedCartsDto {
11834
+ /** `public.cart` rows, placed or not, live and soft-deleted. */
11835
+ carts: ExportedCartsDtoCartsItem[];
11836
+ /** `public.cart_product` rows, live and soft-deleted. */
11837
+ products: ExportedCartsDtoProductsItem[];
11838
+ /** `public.cart_merchandise` rows, live and soft-deleted. */
11839
+ merchandise: ExportedCartsDtoMerchandiseItem[];
11840
+ }
11841
+ export type ExportedStoredGoodsDtoProductsItem = {
11842
+ [key: string]: unknown;
11843
+ };
11844
+ export type ExportedStoredGoodsDtoFoldersItem = {
11845
+ [key: string]: unknown;
11846
+ };
11847
+ export type ExportedStoredGoodsDtoProductImagesItem = {
11848
+ [key: string]: unknown;
11849
+ };
11850
+ export type ExportedStoredGoodsDtoItemsItem = {
11851
+ [key: string]: unknown;
11852
+ };
11853
+ export type ExportedStoredGoodsDtoPodsItem = {
11854
+ [key: string]: unknown;
11855
+ };
11856
+ export type ExportedStoredGoodsDtoDamageReportsItem = {
11857
+ [key: string]: unknown;
11858
+ };
11859
+ export type ExportedStoredGoodsDtoDamageReportImagesItem = {
11860
+ [key: string]: unknown;
11861
+ };
11862
+ export type ExportedStoredGoodsDtoFileAssetsItem = {
11863
+ [key: string]: unknown;
11864
+ };
11865
+ export type ExportedStoredGoodsDtoFileLinksItem = {
11866
+ [key: string]: unknown;
11867
+ };
11868
+ export interface ExportedStoredGoodsDto {
11869
+ /** `public.product` rows, live and soft-deleted. */
11870
+ products: ExportedStoredGoodsDtoProductsItem[];
11871
+ /** `public.folder` rows, live and soft-deleted: the product folders, nested by `parentFolderId`. A product's `folderId` names one. */
11872
+ folders: ExportedStoredGoodsDtoFoldersItem[];
11873
+ /** `public.product_image` rows the customer can see, live and soft-deleted. Files are storage keys, served by `GET /v1/images`. */
11874
+ productImages: ExportedStoredGoodsDtoProductImagesItem[];
11875
+ /** `public.item` rows, live and soft-deleted. */
11876
+ items: ExportedStoredGoodsDtoItemsItem[];
11877
+ /** `public.pod` rows, live and soft-deleted. */
11878
+ pods: ExportedStoredGoodsDtoPodsItem[];
11879
+ /** `public.damage_report` rows, live and soft-deleted. */
11880
+ damageReports: ExportedStoredGoodsDtoDamageReportsItem[];
11881
+ /** `public.damage_report_image` rows, live and soft-deleted. */
11882
+ damageReportImages: ExportedStoredGoodsDtoDamageReportImagesItem[];
11883
+ /** `public.file_asset` rows, live and soft-deleted. */
11884
+ fileAssets: ExportedStoredGoodsDtoFileAssetsItem[];
11885
+ /** `public.entity_file` rows: which record each file asset is attached to. */
11886
+ fileLinks: ExportedStoredGoodsDtoFileLinksItem[];
11887
+ }
11888
+ export type ExportedBillingDtoBillingAccountsItem = {
11889
+ [key: string]: unknown;
11890
+ };
11891
+ export type ExportedBillingDtoInvoicesItem = {
11892
+ [key: string]: unknown;
11893
+ };
11894
+ export type ExportedBillingDtoInvoiceRowsItem = {
11895
+ [key: string]: unknown;
11896
+ };
11897
+ export type ExportedBillingDtoPaymentInstrumentsItem = {
11898
+ [key: string]: unknown;
11899
+ };
11900
+ export type ExportedBillingDtoSubscriptionConfigsItem = {
11901
+ [key: string]: unknown;
11902
+ };
11903
+ export type ExportedBillingDtoContractsItem = {
11904
+ [key: string]: unknown;
11905
+ };
11906
+ export type ExportedBillingDtoAccountCreditsItem = {
11907
+ [key: string]: unknown;
11908
+ };
11909
+ export type ExportedBillingDtoCouponRedemptionsItem = {
11910
+ [key: string]: unknown;
11911
+ };
11912
+ export interface ExportedBillingDto {
11913
+ /** `billing.billing_account` rows, live and soft-deleted. */
11914
+ billingAccounts: ExportedBillingDtoBillingAccountsItem[];
11915
+ /** `billing.invoice` rows, credit notes included (`invoiceType` `credit_note`, naming the invoice in `correctsInvoiceId`). */
11916
+ invoices: ExportedBillingDtoInvoicesItem[];
11917
+ /** `billing.invoice_row` rows, live and soft-deleted. */
11918
+ invoiceRows: ExportedBillingDtoInvoiceRowsItem[];
11919
+ /** `billing.payment_instrument` rows: saved cards, as brand, last four digits and expiry. */
11920
+ paymentInstruments: ExportedBillingDtoPaymentInstrumentsItem[];
11921
+ /** `billing.customer_subscription_config` rows, live and soft-deleted. */
11922
+ subscriptionConfigs: ExportedBillingDtoSubscriptionConfigsItem[];
11923
+ /** `public.organization_contract` rows, live and soft-deleted. */
11924
+ contracts: ExportedBillingDtoContractsItem[];
11925
+ /** `billing.account_credit` rows, live and soft-deleted. */
11926
+ accountCredits: ExportedBillingDtoAccountCreditsItem[];
11927
+ /** `billing.coupon_redemption` rows, live and soft-deleted. */
11928
+ couponRedemptions: ExportedBillingDtoCouponRedemptionsItem[];
11929
+ }
11930
+ /**
11931
+ * The `public.organization` row. Its `personalIdentityNumber` is absent when `notIncluded` lists `personal_identity_number`.
11932
+ * @nullable
11933
+ */
11934
+ export type ExportedPersonalOrganizationDtoOrganization = {
11935
+ [key: string]: unknown;
11936
+ } | null;
11937
+ export type ExportedPersonalOrganizationDtoContactsItem = {
11938
+ [key: string]: unknown;
11939
+ };
11940
+ export type ExportedPersonalOrganizationDtoAddressesItem = {
11941
+ [key: string]: unknown;
11942
+ };
11943
+ export interface ExportedPersonalOrganizationDto {
11944
+ /**
11945
+ * The `public.organization` row. Its `personalIdentityNumber` is absent when `notIncluded` lists `personal_identity_number`.
11946
+ * @nullable
11947
+ */
11948
+ organization: ExportedPersonalOrganizationDtoOrganization;
11949
+ /** `public.organization_contact` rows, live and soft-deleted. */
11950
+ contacts: ExportedPersonalOrganizationDtoContactsItem[];
11951
+ /** `public.address` rows, live and soft-deleted. */
11952
+ addresses: ExportedPersonalOrganizationDtoAddressesItem[];
11953
+ orders: ExportedOrdersDto;
11954
+ carts: ExportedCartsDto;
11955
+ storedGoods: ExportedStoredGoodsDto;
11956
+ billing: ExportedBillingDto;
11957
+ }
11958
+ export type ExportedMessagingDtoDispatchesItem = {
11959
+ [key: string]: unknown;
11960
+ };
11961
+ export type ExportedMessagingDtoPreferencesItem = {
11962
+ [key: string]: unknown;
11963
+ };
11964
+ export type ExportedMessagingDtoSuppressionsItem = {
11965
+ [key: string]: unknown;
11966
+ };
11967
+ export interface ExportedMessagingDto {
11968
+ /** `messaging.notification_dispatch` rows sent to a personal organization's own people (the customer, a recipient they entered, an organization contact), or to the target's own email from any organization; never staff alerts or tenant mailboxes. The profile phone is not matched: it is not verified. Only what the 13-month retention keeps. Each row carries `bodyRetained`: `renderedBody` follows the dispatch log's rule and is null when the tenant does not store bodies or the dispatch is older than 90 days. */
11969
+ dispatches: ExportedMessagingDtoDispatchesItem[];
11970
+ /** `messaging.notification_preference` rows by the target's sub or email. */
11971
+ preferences: ExportedMessagingDtoPreferencesItem[];
11972
+ /** `messaging.suppression` rows on the target's email. */
11973
+ suppressions: ExportedMessagingDtoSuppressionsItem[];
11974
+ }
11102
11975
  export interface ExportUserDataResultDto {
11103
11976
  /** The exported user's Keycloak subject. */
11104
11977
  sub: string;
@@ -11109,7 +11982,10 @@ export interface ExportUserDataResultDto {
11109
11982
  employeeAssignments: ExportedAssignmentDto[];
11110
11983
  externalIdentities: ExportedExternalIdentityDto[];
11111
11984
  consents: ExportedConsentDto[];
11112
- /** Personal data categories this export deliberately does NOT include (e.g. the sensitive personnummer column, billing/invoice records, order history, audit history) — this is Core API's identity-domain slice of a GDPR Article 15 fulfilment, not the complete record. */
11985
+ /** One entry per personal organization of the target's. Empty for a person with none, such as a staff member. */
11986
+ personalOrganizations: ExportedPersonalOrganizationDto[];
11987
+ messaging: ExportedMessagingDto;
11988
+ /** Personal data categories this export does NOT include: audit history, the records business organizations hold about the target, and the notes staff write for staff. Staff identifiers are left out too: they are other people's data. `personal_identity_number` is listed when the tenant has no credential to read the personnummer on the profile and the personal organizations; the billing accounts' and invoices' are included either way, as are the RUT identity numbers on carts and orders. */
11113
11989
  notIncluded: string[];
11114
11990
  }
11115
11991
  export type EmployeeAssignmentDtoKind = typeof EmployeeAssignmentDtoKind[keyof typeof EmployeeAssignmentDtoKind];
@@ -12954,10 +13830,20 @@ export interface TenantGoodsDto {
12954
13830
  /** The SKU's text per locale, keyed by BCP-47 tag (sv-SE, en-GB, fi-FI). `name` and `description` are the default: show `translations[locale]?.name ?? name` and `translations[locale]?.description ?? description`, each field on its own. `{}` when the SKU has no translations. */
12955
13831
  translations: TenantGoodsTranslationsDto;
12956
13832
  /**
12957
- * The SKU's price ex VAT as a decimal string, read from its pricing rule: the open-ended rule, which is the latest price set even when it starts in the future. Null when the SKU has no open-ended price.
13833
+ * The SKU's price ex VAT as a decimal string, read from its pricing rule: the open-ended rule, which is the latest price set even when it starts in the future. A price entered including VAT shows its net part (2,99 € at 25,5 % → "2.38"), which does not multiply back to it. Null when the SKU has no open-ended price.
12958
13834
  * @nullable
12959
13835
  */
12960
13836
  retailPriceExVat?: string | null;
13837
+ /**
13838
+ * The same price including VAT, as a decimal string: as entered when the price includes VAT (`pricesIncludeVat`), else the ex-VAT price with its VAT. Null when the SKU has no open-ended price.
13839
+ * @nullable
13840
+ */
13841
+ retailPriceIncVat?: string | null;
13842
+ /**
13843
+ * Whether the price was entered including VAT (`unitPriceIncVatMinor`). Null when the SKU has no open-ended price.
13844
+ * @nullable
13845
+ */
13846
+ pricesIncludeVat?: boolean | null;
12961
13847
  /** @nullable */
12962
13848
  currencyCode?: string | null;
12963
13849
  /** The billing.article this SKU prices through. Created by the SKU command; not caller-supplied. */
@@ -13022,10 +13908,15 @@ export interface CreateTenantGoodsDto {
13022
13908
  /** The name and description per locale (sv-SE, en-GB, fi-FI); `name` and `description` above stay the default for a locale with none. Defaults to none. */
13023
13909
  translations?: TenantGoodsTranslationsInputDto;
13024
13910
  /**
13025
- * Price per unit ex VAT, in minor units (öre/cent). 0 is allowed — a free item still needs a rule so the sale produces an invoice line.
13911
+ * Price per unit ex VAT, in minor units (öre/cent). 0 is allowed — a free item still needs a rule so the sale produces an invoice line. Required on a tenant whose prices exclude VAT; on one whose prices include VAT (`pricesIncludeVat` on the tenant billing config) it is refused with 400 `merchandise_price_basis_mismatch`: give `unitPriceIncVatMinor` instead.
13026
13912
  * @minimum 0
13027
13913
  */
13028
- unitPriceExVatMinor: number;
13914
+ unitPriceExVatMinor?: number;
13915
+ /**
13916
+ * Price per unit INCLUDING VAT, in minor units, on a tenant whose prices include VAT: 10 at 299 bill 29,90 € (23,82 € and 6,08 € VAT at 25,5 %). Required there and refused with 400 `merchandise_price_basis_mismatch` anywhere else.
13917
+ * @minimum 0
13918
+ */
13919
+ unitPriceIncVatMinor?: number;
13029
13920
  /** ISO 4217. Required even though the SKU column is nullable: the pricing rule's currency is NOT NULL and must be enabled for the tenant (billing.tenant_enabled_currency), so a SKU without one could not be priced. */
13030
13921
  currencyCode: string;
13031
13922
  /** VAT rate for the SKU's article, a percentage (numeric → string): 25.0000 for 25 %, 25.5000 for 25.5 %. A code that restores a deleted SKU keeps that SKU's article, and so its rate; change it through PATCH /v1/billing/articles/:id. */
@@ -13067,10 +13958,15 @@ export interface UpdateTenantGoodsDto {
13067
13958
  /** Replaces the SKU's per-locale texts WHOLE: a locale left out loses its entry, and `{}` removes them all. Omitted leaves them alone. */
13068
13959
  translations?: TenantGoodsTranslationsInputDto;
13069
13960
  /**
13070
- * New price per unit ex VAT in minor units. Equal to the current price is a no-op; different closes the live rule's window and opens a new one.
13961
+ * New price per unit ex VAT in minor units. Equal to the current price is a no-op; different closes the live rule's window and opens a new one. On a tenant whose prices include VAT it is refused with 400 `merchandise_price_basis_mismatch`: give `unitPriceIncVatMinor` instead.
13071
13962
  * @minimum 0
13072
13963
  */
13073
13964
  unitPriceExVatMinor?: number;
13965
+ /**
13966
+ * New price per unit INCLUDING VAT in minor units, on a tenant whose prices include VAT. Equal to the current price, in the same basis, is a no-op; anything else, including the same amount on a price that was entered ex VAT, closes the live rule's window and opens a new one. Refused with 400 `merchandise_price_basis_mismatch` on a tenant whose prices exclude VAT.
13967
+ * @minimum 0
13968
+ */
13969
+ unitPriceIncVatMinor?: number;
13074
13970
  /** Date the new price takes effect (YYYY-MM-DD). Defaults to today. Must be strictly AFTER the live rule's effective_from: an earlier date would build an inverted date range and a same-day one an empty range, which the EXCLUDE constraint silently accepts and nothing can ever price. */
13075
13971
  effectiveFrom?: string;
13076
13972
  category?: string;
@@ -13222,10 +14118,15 @@ export interface CheckoutMerchandiseDto {
13222
14118
  /** The SKU's text per locale, keyed by BCP-47 tag (sv-SE, en-GB, fi-FI). `name` and `description` are the default: show `translations[locale]?.name ?? name` and `translations[locale]?.description ?? description`, each field on its own. `{}` when the SKU has no translations. */
13223
14119
  translations: TenantGoodsTranslationsDto;
13224
14120
  /**
13225
- * Price ex VAT as a decimal string: what the SKU's pricing rule charges today, in currencyCode. Null when no price is in force today.
14121
+ * Price ex VAT as a decimal string: what the SKU's pricing rule charges today, in currencyCode. A price entered including VAT shows its net part (2,99 € at 25,5 % → "2.38"), which does not multiply back to a line. Null when no price is in force today.
13226
14122
  * @nullable
13227
14123
  */
13228
14124
  retailPriceExVat?: string | null;
14125
+ /**
14126
+ * The same price including VAT, as a decimal string: as entered when the price includes VAT ("2.99", so 10 of them are the 29,90 € the cart charges), else retailPriceExVat with its VAT. Null exactly when retailPriceExVat is.
14127
+ * @nullable
14128
+ */
14129
+ retailPriceIncVat?: string | null;
13229
14130
  /** @nullable */
13230
14131
  currencyCode?: string | null;
13231
14132
  /** @nullable */
@@ -13260,10 +14161,15 @@ export interface MerchandiseEstimateLineDto {
13260
14161
  /** The SKU's text per locale, keyed by BCP-47 tag (sv-SE, en-GB, fi-FI). `name` and `description` are the default: show `translations[locale]?.name ?? name` and `translations[locale]?.description ?? description`, each field on its own. `{}` when the SKU has no translations. */
13261
14162
  translations: TenantGoodsTranslationsDto;
13262
14163
  /**
13263
- * Price ex VAT as a decimal string: what the SKU's pricing rule charges today, in currencyCode. Null when no price is in force today.
14164
+ * Price ex VAT as a decimal string: what the SKU's pricing rule charges today, in currencyCode. A price entered including VAT shows its net part (2,99 € at 25,5 % → "2.38"), which does not multiply back to a line. Null when no price is in force today.
13264
14165
  * @nullable
13265
14166
  */
13266
14167
  retailPriceExVat?: string | null;
14168
+ /**
14169
+ * The same price including VAT, as a decimal string: as entered when the price includes VAT ("2.99", so 10 of them are the 29,90 € the cart charges), else retailPriceExVat with its VAT. Null exactly when retailPriceExVat is.
14170
+ * @nullable
14171
+ */
14172
+ retailPriceIncVat?: string | null;
13267
14173
  /** @nullable */
13268
14174
  currencyCode?: string | null;
13269
14175
  /** @nullable */
@@ -13589,6 +14495,28 @@ export interface AnalyticsVolumePerCustomerDto {
13589
14495
  /** @nullable */
13590
14496
  estimatedM3: number | null;
13591
14497
  }
14498
+ export interface AnalyticsVolumeBucketDto {
14499
+ /** Customers in the bucket. */
14500
+ count: number;
14501
+ /**
14502
+ * Average over the bucket's customers of the measured m³ each held over their stored nights. Null for an empty bucket.
14503
+ * @nullable
14504
+ */
14505
+ measuredM3: number | null;
14506
+ /**
14507
+ * The same, estimated. A stay's estimate is its average over the nights that carry one, as the stays dataset reports it; a stay with none counts at its measured average. Null for an empty bucket, or when no stay of its customers carries an estimate.
14508
+ * @nullable
14509
+ */
14510
+ estimatedM3: number | null;
14511
+ }
14512
+ export interface AnalyticsVolumeByStatusDto {
14513
+ /** Latest stay stored on the night. */
14514
+ active: AnalyticsVolumeBucketDto;
14515
+ /** Latest stay ended: empty for `stayGapNights` consecutive nights. */
14516
+ ended: AnalyticsVolumeBucketDto;
14517
+ /** Every customer who has stored, including those between stays, who are in neither bucket above. */
14518
+ all: AnalyticsVolumeBucketDto;
14519
+ }
13592
14520
  export interface AnalyticsNightsBucketDto {
13593
14521
  /** Stays, or customers, in the bucket. */
13594
14522
  count: number;
@@ -13630,12 +14558,17 @@ export interface AnalyticsLifetimeValueDto {
13630
14558
  */
13631
14559
  currencyCode: string | null;
13632
14560
  /**
13633
- * Average invoiced revenue ex VAT, minor units, of the customers whose latest stay has ended.
14561
+ * Average invoiced revenue ex VAT, minor units, of the customers whose latest stay is stored on the night.
14562
+ * @nullable
14563
+ */
14564
+ activeCustomersMinor: number | null;
14565
+ /**
14566
+ * The same over the customers whose latest stay has ended.
13634
14567
  * @nullable
13635
14568
  */
13636
14569
  endedCustomersMinor: number | null;
13637
14570
  /**
13638
- * The same over every customer who has stored.
14571
+ * The same over every customer who has stored, including those between stays.
13639
14572
  * @nullable
13640
14573
  */
13641
14574
  storingCustomersMinor: number | null;
@@ -13647,6 +14580,8 @@ export interface AnalyticsPointInTimeDto {
13647
14580
  activeCustomers: number;
13648
14581
  storedVolume: AnalyticsStoredVolumeDto;
13649
14582
  averageVolumePerActiveCustomer: AnalyticsVolumePerCustomerDto;
14583
+ /** Per customer, the average m³ they held over their stored nights across every stay, by the status of their latest stay. An active customer's is their average so far, not the night's volume, which averageVolumePerActiveCustomer gives. */
14584
+ averageVolumeWhileStoring: AnalyticsVolumeByStatusDto;
13650
14585
  /** Customers registered on or before the night, cumulative. */
13651
14586
  registeredCustomers: number;
13652
14587
  /** Customers who had stored by the night, cumulative. */
@@ -13661,6 +14596,8 @@ export interface AnalyticsPointInTimeSetDto {
13661
14596
  previousMonthEnd: AnalyticsPointInTimeDto;
13662
14597
  /** asOf a month earlier, clamped to that month's last day (31 Oct → 30 Sep). */
13663
14598
  sameDayLastMonth: AnalyticsPointInTimeDto;
14599
+ /** The last night of the range the requested one is compared with, `range.previous.to`: the night to compare a point-in-time figure with, range against range. */
14600
+ previousRangeEnd: AnalyticsPointInTimeDto;
13664
14601
  }
13665
14602
  export interface AnalyticsRevenueCategoryDto {
13666
14603
  /**
@@ -13679,7 +14616,10 @@ export interface AnalyticsRevenueArticleDto {
13679
14616
  articleId: string | null;
13680
14617
  /** @nullable */
13681
14618
  code: string | null;
13682
- /** @nullable */
14619
+ /**
14620
+ * The article's name in the requested `locale`, else its default name. Null for a row with no article.
14621
+ * @nullable
14622
+ */
13683
14623
  name: string | null;
13684
14624
  /** @nullable */
13685
14625
  category: string | null;
@@ -13714,6 +14654,46 @@ export interface AnalyticsPeriodSetDto {
13714
14654
  /** The month before that. */
13715
14655
  monthBefore: AnalyticsPeriodDto;
13716
14656
  }
14657
+ export interface AnalyticsCohortLifetimeValueDto {
14658
+ /**
14659
+ * The tenant's default currency, which lifetime revenue is counted in; revenue in any other currency is not in it. Null before the first build or for a tenant with no default currency.
14660
+ * @nullable
14661
+ */
14662
+ currencyCode: string | null;
14663
+ /**
14664
+ * Average invoiced revenue ex VAT to date, minor units, of the cohort's customers whose latest stay is stored as of the latest nightly build. Revenue invoiced after the range counts, so an earlier range's cohort has had longer to earn. Null when none is.
14665
+ * @nullable
14666
+ */
14667
+ activeCustomersMinor: number | null;
14668
+ /**
14669
+ * The same over the cohort's customers whose latest stay has ended.
14670
+ * @nullable
14671
+ */
14672
+ endedCustomersMinor: number | null;
14673
+ /**
14674
+ * The same over the whole cohort, including customers between stays. Null when the cohort is empty.
14675
+ * @nullable
14676
+ */
14677
+ storingCustomersMinor: number | null;
14678
+ }
14679
+ export interface AnalyticsRangePeriodDto {
14680
+ from: string;
14681
+ /** Included. */
14682
+ to: string;
14683
+ /** Customers registered in the window. */
14684
+ newRegisteredCustomers: number;
14685
+ /** Customers whose first stay started in the window. */
14686
+ newStoringCustomers: number;
14687
+ /** Invoiced revenue by invoice date, one entry per currency, never summed across currencies. Invoices sent, paid, overdue or written off; credit notes net against them. */
14688
+ revenue: AnalyticsRevenueDto[];
14689
+ cohortLifetimeValue: AnalyticsCohortLifetimeValueDto;
14690
+ }
14691
+ export interface AnalyticsRangeSetDto {
14692
+ /** The range asked for, `from` through `to`. */
14693
+ current: AnalyticsRangePeriodDto;
14694
+ /** The range it is compared with. A range starting on a 1st compares with the same span as many calendar months earlier as it spans, ending on a month's last day when it does: October with September, a quarter with the quarter before, 1–10 Nov with 1–10 Oct. Any other range compares with as many days immediately before it. */
14695
+ previous: AnalyticsRangePeriodDto;
14696
+ }
13717
14697
  export interface AnalyticsRevenueTotalDto {
13718
14698
  currencyCode: string;
13719
14699
  /** Revenue ex VAT, minor units. */
@@ -13757,6 +14737,36 @@ export interface AnalyticsPricePerM3Dto {
13757
14737
  /** The service month before it. */
13758
14738
  monthBefore: AnalyticsPricePerM3MonthDto;
13759
14739
  }
14740
+ export interface AnalyticsPricePerM3TrendMonthDto {
14741
+ /** First day of the service month. */
14742
+ serviceMonth: string;
14743
+ /** Storage-category revenue ex VAT for the service month, minor units. */
14744
+ storageRevenueMinor: number;
14745
+ /** Average m³ stored over the month's nights, measured. */
14746
+ averageMeasuredM3: number;
14747
+ /**
14748
+ * The same, estimated; null when no night of the month carries an estimate.
14749
+ * @nullable
14750
+ */
14751
+ averageEstimatedM3: number | null;
14752
+ /**
14753
+ * Minor units per measured m³; null when nothing measured was stored.
14754
+ * @nullable
14755
+ */
14756
+ pricePerMeasuredM3Minor: number | null;
14757
+ /**
14758
+ * Minor units per estimated m³.
14759
+ * @nullable
14760
+ */
14761
+ pricePerEstimatedM3Minor: number | null;
14762
+ /** None of the month's storage charges in this currency is still unbilled or on a draft — the rule lastInvoicedServiceMonth is chosen by. Both prices are null unless the month is fully invoiced and has storage revenue in this currency: never estimated. Until then storageRevenueMinor is what has been invoiced so far. Revenue is as of the latest nightly build, so on the day a month's last storage invoices are sent its price can read short until the next build. */
14763
+ fullyInvoiced: boolean;
14764
+ }
14765
+ export interface AnalyticsPricePerM3TrendDto {
14766
+ currencyCode: string;
14767
+ /** The twelve service months before asOf's, oldest first, every one listed. averagePricePerM3's lastInvoicedServiceMonth can be older than all of them. */
14768
+ months: AnalyticsPricePerM3TrendMonthDto[];
14769
+ }
13760
14770
  export interface AnalyticsEstimateCategoryDto {
13761
14771
  /** @nullable */
13762
14772
  category: string | null;
@@ -13787,6 +14797,57 @@ export interface AnalyticsEstimateCurrencyDto {
13787
14797
  lastMonthActualMinor: number;
13788
14798
  byCategory: AnalyticsEstimateCategoryDto[];
13789
14799
  }
14800
+ /**
14801
+ * `cold_start` when fewer than `minPods` pods were measured in the window, so the ratio is 1 and no correction was applied.
14802
+ */
14803
+ export type AnalyticsForecastRatioDtoSource = typeof AnalyticsForecastRatioDtoSource[keyof typeof AnalyticsForecastRatioDtoSource];
14804
+ export declare const AnalyticsForecastRatioDtoSource: {
14805
+ readonly measured: "measured";
14806
+ readonly cold_start: "cold_start";
14807
+ };
14808
+ export interface AnalyticsForecastRatioDto {
14809
+ /** What an estimated volume is multiplied by to read as the warehouse will measure it: measured volume over estimated volume of the pods measured in the window, four decimals. Not clamped: above 1 means estimates run short. Exactly 1 when `source` is `cold_start`. */
14810
+ value: number;
14811
+ /** `cold_start` when fewer than `minPods` pods were measured in the window, so the ratio is 1 and no correction was applied. */
14812
+ source: AnalyticsForecastRatioDtoSource;
14813
+ /** Pods measured in the window that carry both a measurement and an estimate. */
14814
+ measuredPods: number;
14815
+ /** The fewest measured pods the ratio is computed from. */
14816
+ minPods: number;
14817
+ /** Days of measurements the ratio reads, ending at `windowTo`. */
14818
+ windowDays: number;
14819
+ windowFrom: string;
14820
+ windowTo: string;
14821
+ }
14822
+ export interface AnalyticsInvoiceForecastCategoryDto {
14823
+ /** @nullable */
14824
+ category: string | null;
14825
+ /** Net ex-VAT of the booked pickups' charges in this category, minor units, after campaigns, binding discounts and codes. */
14826
+ bookedPickupsMinor: number;
14827
+ }
14828
+ export interface AnalyticsInvoiceForecastCurrencyDto {
14829
+ currencyCode: string;
14830
+ /** Net ex-VAT of what the booked pickups add to the window's invoices, minor units: the sum of the categories'. Not part of `estimateMinor`. */
14831
+ bookedPickupsMinor: number;
14832
+ /** Pickups priced into this currency. */
14833
+ pickupsPriced: number;
14834
+ byCategory: AnalyticsInvoiceForecastCategoryDto[];
14835
+ }
14836
+ export interface AnalyticsInvoiceForecastDto {
14837
+ /** Always true: what live pickups booked for the rest of the window will add if they go ahead, priced through the pricing engine as their checkout quote was. Separate from the accrued figures and never added to them. */
14838
+ isForecast: boolean;
14839
+ ratio: AnalyticsForecastRatioDto;
14840
+ /** Live pickups planned in the window after `asOf`, not yet at the warehouse. A pickup planned earlier and still open counts from the day after `asOf`. */
14841
+ pickupsBooked: number;
14842
+ /** How many of them are priced into `currencies`. */
14843
+ pickupsPriced: number;
14844
+ /** Booked pickups left out because nothing could price them: no currency, a price book with no base rule for them, or the limit on how many are priced in one request (`truncated`). */
14845
+ pickupsUnpriced: number;
14846
+ /** True when pricing stopped at the limit on pickups or on time, so `currencies` is short by the pickups it did not reach. */
14847
+ truncated: boolean;
14848
+ /** One entry per currency. */
14849
+ currencies: AnalyticsInvoiceForecastCurrencyDto[];
14850
+ }
13790
14851
  export interface AnalyticsInvoiceEstimateDto {
13791
14852
  /** Always true: these are projections, not invoices. */
13792
14853
  isEstimate: boolean;
@@ -13804,9 +14865,11 @@ export interface AnalyticsInvoiceEstimateDto {
13804
14865
  lastMonthComplete: boolean;
13805
14866
  /** One entry per currency. */
13806
14867
  currencies: AnalyticsEstimateCurrencyDto[];
14868
+ /** What live pickups booked for the rest of the window add on top of this estimate, priced through the pricing engine. Never part of `estimateMinor` or any figure above: the client shows it beside them, or adds it up. */
14869
+ forecast: AnalyticsInvoiceForecastDto;
13807
14870
  }
13808
14871
  export interface AnalyticsOverviewDto {
13809
- /** The night the figures describe. */
14872
+ /** The night the figures describe: the range's last night, `to`. */
13810
14873
  asOf: string;
13811
14874
  /**
13812
14875
  * When the nightly analytics build these figures read was computed; null before the first.
@@ -13817,11 +14880,54 @@ export interface AnalyticsOverviewDto {
13817
14880
  stayGapNights: number;
13818
14881
  pointInTime: AnalyticsPointInTimeSetDto;
13819
14882
  periods: AnalyticsPeriodSetDto;
14883
+ /** The period figures over the requested range and the range it is compared with, each with the lifetime value of its acquisition cohort. */
14884
+ range: AnalyticsRangeSetDto;
13820
14885
  revenueYearToDate: AnalyticsRevenueYearToDateDto;
13821
14886
  /** One entry per currency with a fully invoiced storage month. */
13822
14887
  averagePricePerM3: AnalyticsPricePerM3Dto[];
14888
+ /** The price per m³ month by month, one entry per currency with storage revenue in any of the twelve service months before asOf's, including a currency with no fully invoiced month yet. */
14889
+ averagePricePerM3Trend: AnalyticsPricePerM3TrendDto[];
13823
14890
  estimatedInvoicesThisMonth: AnalyticsInvoiceEstimateDto;
13824
14891
  }
14892
+ export interface AnalyticsStorageForecastDayDto {
14893
+ date: string;
14894
+ /** m³ in storage when the day ends: the day before's, plus what booked pickups bring on the day, less what booked deliveries take out. Never below 0. */
14895
+ projectedM3: number;
14896
+ /** m³ the pickups planned on the day bring in, estimated volume times the correction ratio. */
14897
+ incomingM3: number;
14898
+ /** m³ the deliveries planned on the day take out. */
14899
+ outgoingM3: number;
14900
+ /** Pickups planned on the day. */
14901
+ bookedPickups: number;
14902
+ /** Deliveries planned on the day. */
14903
+ bookedDeliveries: number;
14904
+ }
14905
+ /**
14906
+ * Which volume `startM3` is: the estimated volume the dashboard charts, or the measured volume when no night carries an estimate.
14907
+ */
14908
+ export type AnalyticsStorageForecastDtoStartBasis = typeof AnalyticsStorageForecastDtoStartBasis[keyof typeof AnalyticsStorageForecastDtoStartBasis];
14909
+ export declare const AnalyticsStorageForecastDtoStartBasis: {
14910
+ readonly estimated: "estimated";
14911
+ readonly measured: "measured";
14912
+ };
14913
+ export interface AnalyticsStorageForecastDto {
14914
+ /** The latest night built: the forecast starts from how it ended. */
14915
+ asOf: string;
14916
+ /**
14917
+ * When the nightly analytics build these figures read was computed; null before the first.
14918
+ * @nullable
14919
+ */
14920
+ computedAt: string | null;
14921
+ /** Days forecast, from the day after `asOf`. */
14922
+ horizonDays: number;
14923
+ /** m³ in storage when `asOf` ended, the figure the forecast continues from. */
14924
+ startM3: number;
14925
+ /** Which volume `startM3` is: the estimated volume the dashboard charts, or the measured volume when no night carries an estimate. */
14926
+ startBasis: AnalyticsStorageForecastDtoStartBasis;
14927
+ ratio: AnalyticsForecastRatioDto;
14928
+ /** One entry per day, in date order, every day listed. */
14929
+ days: AnalyticsStorageForecastDayDto[];
14930
+ }
13825
14931
  export interface AnalyticsDailyRowDto {
13826
14932
  date: string;
13827
14933
  /** Customers with goods in storage that night. */
@@ -13954,6 +15060,103 @@ export interface AnalyticsCustomerMonthPageDto {
13954
15060
  */
13955
15061
  nextCursor: string | null;
13956
15062
  }
15063
+ export type AnalyticsOrderRowDtoType = typeof AnalyticsOrderRowDtoType[keyof typeof AnalyticsOrderRowDtoType];
15064
+ export declare const AnalyticsOrderRowDtoType: {
15065
+ readonly PICKUP: "PICKUP";
15066
+ readonly DELIVERY: "DELIVERY";
15067
+ readonly MOVE: "MOVE";
15068
+ readonly DROP_OFF: "DROP_OFF";
15069
+ readonly TRANSFER: "TRANSFER";
15070
+ readonly PICKING: "PICKING";
15071
+ readonly MERCHANDISE_SALE: "MERCHANDISE_SALE";
15072
+ };
15073
+ /**
15074
+ * The order's status today, not mapped to the pilot's values.
15075
+ */
15076
+ export type AnalyticsOrderRowDtoStatus = typeof AnalyticsOrderRowDtoStatus[keyof typeof AnalyticsOrderRowDtoStatus];
15077
+ export declare const AnalyticsOrderRowDtoStatus: {
15078
+ readonly CREATED: "CREATED";
15079
+ readonly CONFIRMED: "CONFIRMED";
15080
+ readonly REQUESTED: "REQUESTED";
15081
+ readonly PROCESSING: "PROCESSING";
15082
+ readonly PROCESSED: "PROCESSED";
15083
+ readonly IN_TRANSIT: "IN_TRANSIT";
15084
+ readonly AT_CUSTOMER: "AT_CUSTOMER";
15085
+ readonly RECEIVED: "RECEIVED";
15086
+ readonly COMPLETED: "COMPLETED";
15087
+ readonly CANCELLED: "CANCELLED";
15088
+ readonly FAILED: "FAILED";
15089
+ };
15090
+ export interface AnalyticsOrderRowDto {
15091
+ /** Pilot `user/customer_number`. */
15092
+ customerKey: string;
15093
+ /** The order's job number, unique per order. Pilot `order_id`. */
15094
+ jobNumber: number;
15095
+ type: AnalyticsOrderRowDtoType;
15096
+ /** When the order was placed. */
15097
+ createdAt: string;
15098
+ /**
15099
+ * Start of the customer leg's booked window. Pilot `preferred_transport_from`.
15100
+ * @nullable
15101
+ */
15102
+ plannedWindowStart: string | null;
15103
+ /**
15104
+ * End of the customer leg's booked window. Pilot `preferred_transport_to`.
15105
+ * @nullable
15106
+ */
15107
+ plannedWindowEnd: string | null;
15108
+ /** The order's status today, not mapped to the pilot's values. */
15109
+ status: AnalyticsOrderRowDtoStatus;
15110
+ /**
15111
+ * Minutes the driver spent at the customer leg's stop, from arriving to completing it. Null until measured. Pilot `sales_order_transports/0/handle_time_at_customer`.
15112
+ * @nullable
15113
+ */
15114
+ handleTimeAtCustomerMinutes: number | null;
15115
+ /** Product lines on the order. Pilot `product_count`. */
15116
+ productCount: number;
15117
+ /**
15118
+ * Measured volume, cm³, set when the order completes. Pilot `actual_volume`.
15119
+ * @nullable
15120
+ */
15121
+ actualVolumeCm3: number | null;
15122
+ /**
15123
+ * Billable volume, cm³, set when the order completes. Pilot `billable_volume`.
15124
+ * @nullable
15125
+ */
15126
+ billableVolumeCm3: number | null;
15127
+ /** Units on the product lines whose product is a moving box. Pilot `movingBoxes/aggregate/count`. */
15128
+ movingBoxCount: number;
15129
+ /** Units over the product lines. Pilot `totalItems/aggregate/count`. */
15130
+ itemCount: number;
15131
+ /**
15132
+ * Items the customer estimated at booking. Pilot `sales_order_estimates/0/items`.
15133
+ * @nullable
15134
+ */
15135
+ estimatedItemCount: number | null;
15136
+ /**
15137
+ * Volume the customer estimated at booking, cm³. Pilot `sales_order_estimates/0/volume`.
15138
+ * @nullable
15139
+ */
15140
+ estimatedVolumeCm3: number | null;
15141
+ /**
15142
+ * The customer's stay the goods arrived in or left, as the `stays` dataset numbers it. Joins to it on (`customerKey`, `stayNumber`).
15143
+ * @nullable
15144
+ */
15145
+ stayNumber: number | null;
15146
+ /**
15147
+ * When the order's goods arrived in storage or left it.
15148
+ * @nullable
15149
+ */
15150
+ goodsMovedAt: string | null;
15151
+ }
15152
+ export interface AnalyticsOrderPageDto {
15153
+ items: AnalyticsOrderRowDto[];
15154
+ /**
15155
+ * Pass as `cursor` for the next page; null on the last page.
15156
+ * @nullable
15157
+ */
15158
+ nextCursor: string | null;
15159
+ }
13957
15160
  export interface AnalyticsRevenueRowDto {
13958
15161
  /** First day of the invoice's month. */
13959
15162
  invoiceMonth: string;
@@ -14156,7 +15359,34 @@ export type OrganizationsControllerListV1Params = {
14156
15359
  */
14157
15360
  search?: string;
14158
15361
  /**
14159
- * Batch-fetch by id (repeatable — ?ids=a&ids=b, max 100). When present this is the ONLY filter applied (type/search above are ignored) and pagination (limit/offset) is ignored — every matching, RLS-visible organization is returned, in no particular order (callers key by id). An id that doesn't exist, or isn't visible to the caller, is silently omitted rather than causing an error.
15362
+ * Created at or after this instant, inclusive: a date (YYYY-MM-DD) or an ISO-8601 date-time with its offset, to the millisecond. A date alone is midnight UTC at the start of that day.
15363
+ * @pattern ^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}(:\d{2}(\.\d{1,3})?)?(Z|[+-]\d{2}:\d{2}))?$
15364
+ */
15365
+ createdFrom?: string;
15366
+ /**
15367
+ * Created at or before this instant, inclusive: a date (YYYY-MM-DD) or an ISO-8601 date-time with its offset, to the millisecond. A date alone is midnight UTC at the start of that day, so `2026-11-11` leaves out what was created later that day: send the next day, or a full timestamp, to include it.
15368
+ * @pattern ^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}(:\d{2}(\.\d{1,3})?)?(Z|[+-]\d{2}:\d{2}))?$
15369
+ */
15370
+ createdTo?: string;
15371
+ /**
15372
+ * Filter by the organization's preferred warehouse (`preferredWarehouseId`), not by where its goods are stored.
15373
+ */
15374
+ warehouseId?: string;
15375
+ /**
15376
+ * Filter by how the customer pays: the code of their billing account's payment method, else the tenant's default (as `paymentMethod.code` on each row). A customer with no billing account never matches. Requires `billingaccount:read`: anyone else is refused with 403 `payment_method_filter_requires_billing_account_read`.
15377
+ * @pattern ^[a-z0-9_]{1,64}$
15378
+ */
15379
+ paymentMethod?: string;
15380
+ /**
15381
+ * Sort key. Rows that tie on it are ordered by organization id, in the same direction.
15382
+ */
15383
+ sort?: OrganizationsControllerListV1Sort;
15384
+ /**
15385
+ * Sort direction. When omitted: `asc` for `sort=name`, `desc` for `sort=createdAt` (newest first). Without `sort`, it applies to `createdAt`.
15386
+ */
15387
+ order?: OrganizationsControllerListV1Order;
15388
+ /**
15389
+ * Batch-fetch by id (repeatable — ?ids=a&ids=b, max 100). When present this is the ONLY filter applied (every filter above is ignored) and pagination (limit/offset) and sort/order are ignored — every matching, RLS-visible organization is returned, in no particular order (callers key by id). An id that doesn't exist, or isn't visible to the caller, is silently omitted rather than causing an error.
14160
15390
  */
14161
15391
  ids?: string[];
14162
15392
  };
@@ -14165,16 +15395,45 @@ export declare const OrganizationsControllerListV1Type: {
14165
15395
  readonly business: "business";
14166
15396
  readonly personal: "personal";
14167
15397
  };
15398
+ export type OrganizationsControllerListV1Sort = typeof OrganizationsControllerListV1Sort[keyof typeof OrganizationsControllerListV1Sort];
15399
+ export declare const OrganizationsControllerListV1Sort: {
15400
+ readonly name: "name";
15401
+ readonly createdAt: "createdAt";
15402
+ };
15403
+ export type OrganizationsControllerListV1Order = typeof OrganizationsControllerListV1Order[keyof typeof OrganizationsControllerListV1Order];
15404
+ export declare const OrganizationsControllerListV1Order: {
15405
+ readonly asc: "asc";
15406
+ readonly desc: "desc";
15407
+ };
14168
15408
  export type OrganizationsControllerStatsV1Params = {
14169
15409
  /**
14170
15410
  * Filter by organization type.
14171
15411
  */
14172
15412
  type?: OrganizationsControllerStatsV1Type;
14173
15413
  /**
14174
- * Case-insensitive substring search. Always matches the organization name, its corporate identity number (orgnr) and, given a whole id, the organization id. For tenant staff with `member:read`, and platform-admin, it also matches any live member's email, display name, first name, last name, "first last", and phone, and the billing account's invoice email; the member matched need not be the one shown as `owner`. Other callers, org users included, are not matched on those fields. Matches exactly what GET /v1/organizations matches for the same caller.
15414
+ * Case-insensitive substring search. Always matches the organization name, its corporate identity number (orgnr) and, given a whole id, the organization id. For tenant staff with `member:read`, and platform-admin, it also matches any live member's email, display name, first name, last name, "first last", and phone, and the billing account's invoice email; the member matched need not be the one shown as `owner`. Other callers, org users included, are not matched on those fields.
14175
15415
  * @maxLength 200
14176
15416
  */
14177
15417
  search?: string;
15418
+ /**
15419
+ * Created at or after this instant, inclusive: a date (YYYY-MM-DD) or an ISO-8601 date-time with its offset, to the millisecond. A date alone is midnight UTC at the start of that day.
15420
+ * @pattern ^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}(:\d{2}(\.\d{1,3})?)?(Z|[+-]\d{2}:\d{2}))?$
15421
+ */
15422
+ createdFrom?: string;
15423
+ /**
15424
+ * Created at or before this instant, inclusive: a date (YYYY-MM-DD) or an ISO-8601 date-time with its offset, to the millisecond. A date alone is midnight UTC at the start of that day, so `2026-11-11` leaves out what was created later that day: send the next day, or a full timestamp, to include it.
15425
+ * @pattern ^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}(:\d{2}(\.\d{1,3})?)?(Z|[+-]\d{2}:\d{2}))?$
15426
+ */
15427
+ createdTo?: string;
15428
+ /**
15429
+ * Filter by the organization's preferred warehouse (`preferredWarehouseId`), not by where its goods are stored.
15430
+ */
15431
+ warehouseId?: string;
15432
+ /**
15433
+ * Filter by how the customer pays: the code of their billing account's payment method, else the tenant's default (as `paymentMethod.code` on each row). A customer with no billing account never matches. Requires `billingaccount:read`: anyone else is refused with 403 `payment_method_filter_requires_billing_account_read`.
15434
+ * @pattern ^[a-z0-9_]{1,64}$
15435
+ */
15436
+ paymentMethod?: string;
14178
15437
  };
14179
15438
  export type OrganizationsControllerStatsV1Type = typeof OrganizationsControllerStatsV1Type[keyof typeof OrganizationsControllerStatsV1Type];
14180
15439
  export declare const OrganizationsControllerStatsV1Type: {
@@ -15071,6 +16330,28 @@ export type InvoicesControllerListCorrectionsV1Params = {
15071
16330
  */
15072
16331
  offset?: number;
15073
16332
  };
16333
+ export type CollectionHoldsControllerListCollectionHoldsV1Params = {
16334
+ /**
16335
+ * Max rows to return (1–100).
16336
+ * @minimum 1
16337
+ * @maximum 100
16338
+ */
16339
+ limit?: number;
16340
+ /**
16341
+ * Rows to skip.
16342
+ * @minimum 0
16343
+ */
16344
+ offset?: number;
16345
+ /**
16346
+ * Only the invoices held for this reason.
16347
+ */
16348
+ reason?: CollectionHoldsControllerListCollectionHoldsV1Reason;
16349
+ };
16350
+ export type CollectionHoldsControllerListCollectionHoldsV1Reason = typeof CollectionHoldsControllerListCollectionHoldsV1Reason[keyof typeof CollectionHoldsControllerListCollectionHoldsV1Reason];
16351
+ export declare const CollectionHoldsControllerListCollectionHoldsV1Reason: {
16352
+ readonly DRAFT_CREDIT_NOTE: "DRAFT_CREDIT_NOTE";
16353
+ readonly CREDITED: "CREDITED";
16354
+ };
15074
16355
  export type ArticlesControllerListArticlesV1Params = {
15075
16356
  /**
15076
16357
  * Max rows to return (1–100).
@@ -15797,9 +17078,35 @@ export type TransportOptionsControllerListV1Params = {
15797
17078
  };
15798
17079
  export type AnalyticsControllerOverviewV1Params = {
15799
17080
  /**
15800
- * The night the figures describe (YYYY-MM-DD), in the tenant's billing calendar. Defaults to the latest night the nightly analytics build covers, normally last night. A later night is 400 as_of_not_built.
17081
+ * The night the figures describe (YYYY-MM-DD), in the tenant's billing calendar: the range's last night, `to` by its older name, so give one or the other (400 as_of_and_to_exclusive). Defaults to the latest night the nightly analytics build covers, normally last night. A later night is 400 as_of_not_built.
15801
17082
  */
15802
17083
  asOf?: string;
17084
+ /**
17085
+ * First day of the range (YYYY-MM-DD), in the billing calendar. Defaults to the 1st of `to`'s month, so the range is the month to date. 400 date_range_required when it is after `to`; the range may span at most 25 calendar months (400 date_range_too_wide).
17086
+ */
17087
+ from?: string;
17088
+ /**
17089
+ * Last day of the range, included, and the night the point-in-time figures are read at. Defaults to, and may not be after, the latest night the nightly build covers (400 date_range_not_built).
17090
+ */
17091
+ to?: string;
17092
+ /**
17093
+ * Language of the article names in `byArticle`: the page's language. Each name is the article's name in this locale, or its default name when it has none. Omit it to get every article's default name.
17094
+ */
17095
+ locale?: AnalyticsControllerOverviewV1Locale;
17096
+ };
17097
+ export type AnalyticsControllerOverviewV1Locale = typeof AnalyticsControllerOverviewV1Locale[keyof typeof AnalyticsControllerOverviewV1Locale];
17098
+ export declare const AnalyticsControllerOverviewV1Locale: {
17099
+ readonly 'sv-SE': "sv-SE";
17100
+ readonly 'en-GB': "en-GB";
17101
+ readonly 'fi-FI': "fi-FI";
17102
+ };
17103
+ export type AnalyticsControllerStorageForecastV1Params = {
17104
+ /**
17105
+ * Days to forecast, from the day after the latest night built (1–60).
17106
+ * @minimum 1
17107
+ * @maximum 60
17108
+ */
17109
+ days?: number;
15803
17110
  };
15804
17111
  export type AnalyticsControllerDailyV1Params = {
15805
17112
  /**
@@ -15865,6 +17172,26 @@ export type AnalyticsControllerCustomerMonthsV1Params = {
15865
17172
  */
15866
17173
  to?: string;
15867
17174
  };
17175
+ export type AnalyticsControllerOrdersV1Params = {
17176
+ /**
17177
+ * The `nextCursor` of the previous page. Omit for the first page.
17178
+ */
17179
+ cursor?: string;
17180
+ /**
17181
+ * Rows per page (1–5000).
17182
+ * @minimum 1
17183
+ * @maximum 5000
17184
+ */
17185
+ limit?: number;
17186
+ /**
17187
+ * First day (YYYY-MM-DD), in the billing calendar. Defaults to the 1st of the month twelve months before `to`'s. A monthly dataset covers `from`'s month.
17188
+ */
17189
+ from?: string;
17190
+ /**
17191
+ * Last day, included. Defaults to, and may not be after, the latest night the nightly build covers. The range may span at most 25 calendar months.
17192
+ */
17193
+ to?: string;
17194
+ };
15868
17195
  export type AnalyticsControllerRevenueV1Params = {
15869
17196
  /**
15870
17197
  * The `nextCursor` of the previous page. Omit for the first page.