@epilot/sdk 2.20.27 → 2.20.29

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 (135) hide show
  1. package/definitions/pricing-runtime.json +1 -1
  2. package/definitions/pricing.json +865 -3585
  3. package/dist/apis/access-token.cjs +6 -6
  4. package/dist/apis/access-token.js +1 -1
  5. package/dist/apis/address-suggestions.cjs +6 -6
  6. package/dist/apis/address-suggestions.js +1 -1
  7. package/dist/apis/address.cjs +6 -6
  8. package/dist/apis/address.js +1 -1
  9. package/dist/apis/ai-agents.cjs +6 -6
  10. package/dist/apis/ai-agents.js +1 -1
  11. package/dist/apis/app.cjs +6 -6
  12. package/dist/apis/app.js +1 -1
  13. package/dist/apis/audit-logs.cjs +6 -6
  14. package/dist/apis/audit-logs.js +1 -1
  15. package/dist/apis/automation.cjs +6 -6
  16. package/dist/apis/automation.js +1 -1
  17. package/dist/apis/billing.cjs +6 -6
  18. package/dist/apis/billing.js +1 -1
  19. package/dist/apis/blueprint-manifest.cjs +6 -6
  20. package/dist/apis/blueprint-manifest.js +1 -1
  21. package/dist/apis/calendar.cjs +6 -6
  22. package/dist/apis/calendar.js +1 -1
  23. package/dist/apis/chat.cjs +6 -6
  24. package/dist/apis/chat.d.cts +2 -2
  25. package/dist/apis/chat.d.ts +2 -2
  26. package/dist/apis/chat.js +1 -1
  27. package/dist/apis/configuration-hub.cjs +6 -6
  28. package/dist/apis/configuration-hub.js +1 -1
  29. package/dist/apis/consent.cjs +6 -6
  30. package/dist/apis/consent.js +1 -1
  31. package/dist/apis/customer-portal.cjs +6 -6
  32. package/dist/apis/customer-portal.js +1 -1
  33. package/dist/apis/dashboard.cjs +6 -6
  34. package/dist/apis/dashboard.js +1 -1
  35. package/dist/apis/data-governance.cjs +6 -6
  36. package/dist/apis/data-governance.js +1 -1
  37. package/dist/apis/deduplication.cjs +6 -6
  38. package/dist/apis/deduplication.js +1 -1
  39. package/dist/apis/design.cjs +6 -6
  40. package/dist/apis/design.js +1 -1
  41. package/dist/apis/document.cjs +6 -6
  42. package/dist/apis/document.js +1 -1
  43. package/dist/apis/email-settings.cjs +6 -6
  44. package/dist/apis/email-settings.js +1 -1
  45. package/dist/apis/email-template.cjs +6 -6
  46. package/dist/apis/email-template.js +1 -1
  47. package/dist/apis/entity-mapping.cjs +6 -6
  48. package/dist/apis/entity-mapping.js +1 -1
  49. package/dist/apis/entity.cjs +6 -6
  50. package/dist/apis/entity.js +1 -1
  51. package/dist/apis/environments.cjs +6 -6
  52. package/dist/apis/environments.js +1 -1
  53. package/dist/apis/event-catalog.cjs +6 -6
  54. package/dist/apis/event-catalog.js +1 -1
  55. package/dist/apis/file.cjs +6 -6
  56. package/dist/apis/file.js +1 -1
  57. package/dist/apis/iban.cjs +6 -6
  58. package/dist/apis/iban.js +1 -1
  59. package/dist/apis/integration-toolkit.cjs +6 -6
  60. package/dist/apis/integration-toolkit.js +1 -1
  61. package/dist/apis/journey.cjs +6 -6
  62. package/dist/apis/journey.js +1 -1
  63. package/dist/apis/kanban.cjs +6 -6
  64. package/dist/apis/kanban.js +1 -1
  65. package/dist/apis/message.cjs +6 -6
  66. package/dist/apis/message.js +1 -1
  67. package/dist/apis/metering.cjs +6 -6
  68. package/dist/apis/metering.js +1 -1
  69. package/dist/apis/notes.cjs +6 -6
  70. package/dist/apis/notes.js +1 -1
  71. package/dist/apis/notification.cjs +6 -6
  72. package/dist/apis/notification.js +1 -1
  73. package/dist/apis/organization.cjs +6 -6
  74. package/dist/apis/organization.js +1 -1
  75. package/dist/apis/partner-directory.cjs +6 -6
  76. package/dist/apis/partner-directory.js +1 -1
  77. package/dist/apis/permissions.cjs +6 -6
  78. package/dist/apis/permissions.js +1 -1
  79. package/dist/apis/pricing-tier.cjs +6 -6
  80. package/dist/apis/pricing-tier.js +1 -1
  81. package/dist/apis/pricing.cjs +8 -8
  82. package/dist/apis/pricing.d.cts +2 -2
  83. package/dist/apis/pricing.d.ts +2 -2
  84. package/dist/apis/pricing.js +2 -2
  85. package/dist/apis/purpose.cjs +6 -6
  86. package/dist/apis/purpose.js +1 -1
  87. package/dist/apis/query.cjs +6 -6
  88. package/dist/apis/query.js +1 -1
  89. package/dist/apis/sandbox.cjs +6 -6
  90. package/dist/apis/sandbox.js +1 -1
  91. package/dist/apis/sharing.cjs +6 -6
  92. package/dist/apis/sharing.js +1 -1
  93. package/dist/apis/snapshot.cjs +6 -6
  94. package/dist/apis/snapshot.js +1 -1
  95. package/dist/apis/submission.cjs +6 -6
  96. package/dist/apis/submission.js +1 -1
  97. package/dist/apis/target.cjs +6 -6
  98. package/dist/apis/target.js +1 -1
  99. package/dist/apis/targeting.cjs +6 -6
  100. package/dist/apis/targeting.js +1 -1
  101. package/dist/apis/template-variables.cjs +6 -6
  102. package/dist/apis/template-variables.js +1 -1
  103. package/dist/apis/user.cjs +6 -6
  104. package/dist/apis/user.js +1 -1
  105. package/dist/apis/validation-rules.cjs +6 -6
  106. package/dist/apis/validation-rules.js +1 -1
  107. package/dist/apis/webhooks.cjs +6 -6
  108. package/dist/apis/webhooks.js +1 -1
  109. package/dist/apis/workflow-definition.cjs +6 -6
  110. package/dist/apis/workflow-definition.js +1 -1
  111. package/dist/apis/workflow.cjs +6 -6
  112. package/dist/apis/workflow.js +1 -1
  113. package/dist/{chat.d-CQ5eRtNU.d.cts → chat.d-0w0TaT-a.d.cts} +20 -20
  114. package/dist/{chat.d-CQ5eRtNU.d.ts → chat.d-0w0TaT-a.d.ts} +20 -20
  115. package/dist/{chunk-W5PMKQO7.js → chunk-7ET7OIFW.js} +2 -2
  116. package/dist/{chunk-UM53DB6T.cjs → chunk-ARH4YLVV.cjs} +2 -2
  117. package/dist/{chunk-7Q3JW72Y.js → chunk-OHYTCUUB.js} +1 -1
  118. package/dist/{chunk-QLWDOKGE.cjs → chunk-UKHR33EL.cjs} +1 -1
  119. package/dist/index.cjs +10 -10
  120. package/dist/index.d.cts +2 -2
  121. package/dist/index.d.ts +2 -2
  122. package/dist/index.js +2 -2
  123. package/dist/js-yaml-DLCVPJ7G.js +0 -0
  124. package/dist/pricing-QERD2QHS.cjs +7 -0
  125. package/dist/pricing-XJ7PKOWG.js +7 -0
  126. package/dist/{pricing-runtime-MJAIO4AY.js → pricing-runtime-AT27C3BP.js} +1 -1
  127. package/dist/{pricing-runtime-NMRZO6J4.cjs → pricing-runtime-PFVTRERK.cjs} +2 -2
  128. package/dist/{pricing.d-CuF7KcXt.d.cts → pricing.d-BKrHrQxy.d.cts} +2780 -11112
  129. package/dist/{pricing.d-CuF7KcXt.d.ts → pricing.d-BKrHrQxy.d.ts} +2780 -11112
  130. package/docs/pricing.md +292 -1412
  131. package/package.json +11 -12
  132. package/definitions/erp-integration-runtime.json +0 -1
  133. package/definitions/erp-integration.json +0 -7936
  134. package/dist/pricing-WMGQHFJV.cjs +0 -7
  135. package/dist/pricing-WNSMDD5D.js +0 -7
package/docs/pricing.md CHANGED
@@ -68,20 +68,15 @@ const { data } = await pricingClient.$calculatePricingDetails(...)
68
68
  - [`$getConditionSets`](#$getconditionsets)
69
69
  - [`$resolveConditionalEntity`](#$resolveconditionalentity)
70
70
  - [`$createConditionalVariant`](#$createconditionalvariant)
71
- - [`$listConditionalVariants`](#$listconditionalvariants)
72
- - [`$getConditionalVariantTree`](#$getconditionalvarianttree)
73
71
  - [`$getActiveConditionalVariantVersion`](#$getactiveconditionalvariantversion)
74
72
  - [`$replaceActiveConditionalVariantVersion`](#$replaceactiveconditionalvariantversion)
75
73
  - [`$patchActiveConditionalVariantVersion`](#$patchactiveconditionalvariantversion)
76
74
  - [`$deleteConditionalVariant`](#$deleteconditionalvariant)
77
- - [`$listConditionalVariantVersions`](#$listconditionalvariantversions)
78
75
  - [`$appendConditionalVariantVersion`](#$appendconditionalvariantversion)
79
76
  - [`$getConditionalVariantVersion`](#$getconditionalvariantversion)
80
77
  - [`$replaceConditionalVariantVersion`](#$replaceconditionalvariantversion)
81
78
  - [`$patchConditionalVariantVersion`](#$patchconditionalvariantversion)
82
79
  - [`$deleteConditionalVariantVersion`](#$deleteconditionalvariantversion)
83
- - [`$batchUpsertConditionalVariants`](#$batchupsertconditionalvariants)
84
- - [`$batchDeleteConditionalVariants`](#$batchdeleteconditionalvariants)
85
80
 
86
81
  **Schemas**
87
82
  - [`IntegrationId`](#integrationid)
@@ -92,11 +87,8 @@ const { data } = await pricingClient.$calculatePricingDetails(...)
92
87
  - [`ConditionSetCatalog`](#conditionsetcatalog)
93
88
  - [`ConditionalPricingErrorCode`](#conditionalpricingerrorcode)
94
89
  - [`ResolveConditionalEntityRequest`](#resolveconditionalentityrequest)
95
- - [`ResolveByContextRequest`](#resolvebycontextrequest)
96
- - [`ResolveByPinRequest`](#resolvebypinrequest)
97
90
  - [`ResolveContext`](#resolvecontext)
98
91
  - [`ResolveOptions`](#resolveoptions)
99
- - [`PinnedResolveOptions`](#pinnedresolveoptions)
100
92
  - [`ResolvedVariants`](#resolvedvariants)
101
93
  - [`ResolvedVariant`](#resolvedvariant)
102
94
  - [`CreateVariantRequest`](#createvariantrequest)
@@ -104,43 +96,16 @@ const { data } = await pricingClient.$calculatePricingDetails(...)
104
96
  - [`PinnedConditions`](#pinnedconditions)
105
97
  - [`VariantValues`](#variantvalues)
106
98
  - [`CreatedVariant`](#createdvariant)
107
- - [`WriteWarning`](#writewarning)
108
- - [`VersionMoved`](#versionmoved)
109
- - [`InertOverride`](#inertoverride)
110
- - [`InertOverrideReason`](#inertoverridereason)
99
+ - [`VariantWriteWarning`](#variantwritewarning)
111
100
  - [`DeletedVariant`](#deletedvariant)
112
101
  - [`VariantVersion`](#variantversion)
113
102
  - [`WrittenVariantVersion`](#writtenvariantversion)
114
103
  - [`DeletedVariantVersion`](#deletedvariantversion)
104
+ - [`VersionWriteWarning`](#versionwritewarning)
115
105
  - [`AppendVersionRequest`](#appendversionrequest)
116
106
  - [`ReplaceVersionRequest`](#replaceversionrequest)
117
107
  - [`PatchVersionRequest`](#patchversionrequest)
118
- - [`ListVariantsRequest`](#listvariantsrequest)
119
- - [`VariantTreeRequest`](#varianttreerequest)
120
- - [`VariantConditionFilter`](#variantconditionfilter)
121
- - [`VariantList`](#variantlist)
122
- - [`VariantListRow`](#variantlistrow)
123
- - [`VariantTree`](#varianttree)
124
- - [`VariantTreeRow`](#varianttreerow)
125
- - [`VariantTreeRowStatus`](#varianttreerowstatus)
126
- - [`VariantVersionSnapshot`](#variantversionsnapshot)
127
- - [`VariantVersionList`](#variantversionlist)
128
- - [`BatchUpsertVariantsRequest`](#batchupsertvariantsrequest)
129
- - [`BatchUpsertItem`](#batchupsertitem)
130
- - [`BatchDeleteVariantsRequest`](#batchdeletevariantsrequest)
131
- - [`BatchDeleteItem`](#batchdeleteitem)
132
- - [`BatchDeleteByVariantId`](#batchdeletebyvariantid)
133
- - [`BatchDeleteByConditions`](#batchdeletebyconditions)
134
- - [`BatchUpsertResult`](#batchupsertresult)
135
- - [`BatchDeleteResult`](#batchdeleteresult)
136
- - [`BatchUpsertOutcome`](#batchupsertoutcome)
137
- - [`BatchDeleteOutcome`](#batchdeleteoutcome)
138
- - [`BatchUpsertCounts`](#batchupsertcounts)
139
- - [`BatchDeleteCounts`](#batchdeletecounts)
140
- - [`BatchUpsertResultEntry`](#batchupsertresultentry)
141
- - [`BatchDeleteResultEntry`](#batchdeleteresultentry)
142
108
  - [`Error`](#error)
143
- - [`ReportedError`](#reportederror)
144
109
  - [`ConditionalPricingError`](#conditionalpricingerror)
145
110
  - [`Product`](#product)
146
111
  - [`Opportunity`](#opportunity)
@@ -183,6 +148,7 @@ const { data } = await pricingClient.$calculatePricingDetails(...)
183
148
  - [`ComputedPriceBreakdown`](#computedpricebreakdown)
184
149
  - [`ComputedPriceComponents`](#computedpricecomponents)
185
150
  - [`ComputePriceResult`](#computepriceresult)
151
+ - [`ComputePriceInputs`](#computepriceinputs)
186
152
  - [`SpotMarketBiddingZone`](#spotmarketbiddingzone)
187
153
  - [`SpotMarketType`](#spotmarkettype)
188
154
  - [`SpotMarketDataFrequency`](#spotmarketdatafrequency)
@@ -1484,6 +1450,7 @@ const { data } = await client.$computePrice(
1484
1450
  association_id: 'string',
1485
1451
  billing_period: 'monthly',
1486
1452
  reference_date: '1970-01-01',
1453
+ city: 'string',
1487
1454
  type: 'power',
1488
1455
  meter_type: 'classic'
1489
1456
  },
@@ -1515,6 +1482,17 @@ const { data } = await client.$computePrice(
1515
1482
  "variable_ht": {},
1516
1483
  "variable_nt": {}
1517
1484
  },
1485
+ "inputs": {
1486
+ "type": "power",
1487
+ "consumptionHT": 0,
1488
+ "consumptionNT": 0,
1489
+ "consumptionType": "household",
1490
+ "zipCode": "string",
1491
+ "city": "string",
1492
+ "providerId": "string",
1493
+ "billingPeriod": "weekly",
1494
+ "referenceDate": "1970-01-01"
1495
+ },
1518
1496
  "_meta": {
1519
1497
  "signature": "string",
1520
1498
  "timestamp": 0
@@ -1784,65 +1762,30 @@ const { data } = await client.$productRecommendations(
1784
1762
  "description": "Annual internet service",
1785
1763
  "price_id": "7e24ff5d-d580-4136-a32f-19191eed039a",
1786
1764
  "product_id": "6241487f-b7fd-428b-ab92-24ee0b37fd84",
1787
- "taxes": [
1788
- {
1789
- "amount": 600,
1790
- "tax": {
1791
- "active": true,
1792
- "description": "Without Behaviour",
1793
- "rate": 6,
1794
- "region": "DE",
1795
- "type": "VAT",
1796
- "_created_at": "2022-02-07T14:49:08.831Z",
1797
- "_id": "18bbbc2e-2c37-4f91-924a-07ae60d830e4",
1798
- "_org": "739224",
1799
- "_schema": "tax",
1800
- "_title": "Tax Without Behaviour",
1801
- "_updated_at": "2022-02-07T14:49:08.831Z"
1802
- }
1803
- }
1804
- ],
1765
+ "taxes": [],
1805
1766
  "unit_amount": 10000,
1806
1767
  "unit_amount_net": 10000,
1807
1768
  "pricing_model": "per_unit",
1808
- "_price": {
1809
- "_id": "7e24ff5d-d580-4136-a32f-19191eed039a",
1810
- "unit_amount": 10000,
1811
- "unit_amount_currency": "EUR",
1812
- "unit_amount_decimal": "100.00",
1813
- "sales_tax": "standard",
1814
- "is_tax_inclusive": false,
1815
- "price_display_in_journeys": "show_price",
1816
- "type": "one_time",
1817
- "billing_period": "weekly",
1818
- "billing_duration_unit": "months",
1819
- "notice_time_unit": "months",
1820
- "termination_time_unit": "months",
1821
- "renewal_duration_unit": "months",
1822
- "_schema": "price",
1823
- "_title": "Solar Panel Module",
1824
- "description": "Solar Panel Module",
1825
- "active": true,
1826
- "tax": {
1827
- "$relation": [
1828
- {
1829
- "entity_id": "24641e82-0690-4135-8b43-ef12a9b1c5dc"
1830
- }
1831
- ]
1832
- },
1833
- "_org": "728",
1834
- "_created_at": "2022-06-03T16:04:10.369Z",
1835
- "_updated_at": "2022-06-03T16:04:10.369Z",
1836
- "pricing_model": "per_unit"
1837
- },
1838
- "_product": {
1839
- "name": "Cool box",
1840
- "type": "product",
1841
- "_id": "73f857a4-0fbc-4aa6-983f-87c0d6d410a6",
1842
- "_title": "Cool box"
1843
- }
1769
+ "_price": {},
1770
+ "_product": {}
1844
1771
  }
1845
- ]
1772
+ ],
1773
+ "source": {
1774
+ "item": {
1775
+ "amount_subtotal": 10000,
1776
+ "amount_total": 10600,
1777
+ "currency": "EUR",
1778
+ "description": "Annual internet service",
1779
+ "price_id": "7e24ff5d-d580-4136-a32f-19191eed039a",
1780
+ "product_id": "6241487f-b7fd-428b-ab92-24ee0b37fd84",
1781
+ "taxes": [],
1782
+ "unit_amount": 10000,
1783
+ "unit_amount_net": 10000,
1784
+ "pricing_model": "per_unit",
1785
+ "_price": {},
1786
+ "_product": {}
1787
+ }
1788
+ }
1846
1789
  }
1847
1790
  ```
1848
1791
 
@@ -1876,17 +1819,11 @@ const { data } = await client.$getConditionSets({
1876
1819
  "description": "string",
1877
1820
  "conditions": [
1878
1821
  {
1879
- "id": "d5839b94-ba20-4225-a78e-76951d352bd6",
1880
1822
  "name": "postal_code",
1881
1823
  "label": "Postal Code",
1882
1824
  "type": "string",
1883
- "options": [
1884
- "private",
1885
- {
1886
- "value": "commercial",
1887
- "title": "Commercial customers"
1888
- }
1889
- ],
1825
+ "options": ["private", "commercial"],
1826
+ "allow_any": false,
1890
1827
  "format": "zipcode"
1891
1828
  }
1892
1829
  ]
@@ -1901,8 +1838,8 @@ const { data } = await client.$getConditionSets({
1901
1838
 
1902
1839
  ### `$resolveConditionalEntity`
1903
1840
 
1904
- Resolves which of a conditional entity's variants apply, and returns each one composed: the
1905
- base entity overlaid with the values of the version in effect at `as_of`.
1841
+ Resolves which of a conditional entity's variants apply to a situation, and returns each one
1842
+ composed: the base entity overlaid with the values of the version in effect at `as_of`.
1906
1843
 
1907
1844
  `POST /v1/conditional-pricing:resolve`
1908
1845
 
@@ -1920,8 +1857,7 @@ const { data } = await client.$resolveConditionalEntity(
1920
1857
  },
1921
1858
  as_of: '2027-03-15T00:00:00Z',
1922
1859
  options: {
1923
- resolve_one: false,
1924
- hydrate: false
1860
+ resolve_one: false
1925
1861
  }
1926
1862
  },
1927
1863
  )
@@ -1940,13 +1876,7 @@ const { data } = await client.$resolveConditionalEntity(
1940
1876
  "_conditions": {
1941
1877
  "postal_code": "46045",
1942
1878
  "default": false
1943
- },
1944
- "_inert_overrides": [
1945
- {
1946
- "attribute": "unit_amount",
1947
- "reason": "ATTRIBUTE_NOT_OVERRIDABLE"
1948
- }
1949
- ]
1879
+ }
1950
1880
  }
1951
1881
  ]
1952
1882
  }
@@ -1959,7 +1889,8 @@ const { data } = await client.$resolveConditionalEntity(
1959
1889
  ### `$createConditionalVariant`
1960
1890
 
1961
1891
  Creates one variant of a conditional entity, together with the first version carrying its
1962
- values: a variant always has at least one version.
1892
+ values. Never two calls: a variant that existed without a version would be an entity holding
1893
+ a condition tuple
1963
1894
 
1964
1895
  `POST /v1/conditional-pricing/{slug}/entities/{entity_id}/variants`
1965
1896
 
@@ -2007,10 +1938,8 @@ const { data } = await client.$createConditionalVariant(
2007
1938
  {
2008
1939
  "code": "VARIANT_COUNT_APPROACHING_CAP",
2009
1940
  "message": "string",
2010
- "details": {
2011
- "variant_count": 0,
2012
- "cap": 0
2013
- }
1941
+ "variant_count": 0,
1942
+ "cap": 0
2014
1943
  }
2015
1944
  ]
2016
1945
  }
@@ -2020,132 +1949,6 @@ const { data } = await client.$createConditionalVariant(
2020
1949
 
2021
1950
  ---
2022
1951
 
2023
- ### `$listConditionalVariants`
2024
-
2025
- Lists a conditional entity's variants and the conditions each one pins — the browse, filter
2026
- and search read behind the Entity UI's variant screens.
2027
-
2028
- `POST /v1/conditional-pricing/{slug}/entities/{entity_id}/variants:list`
2029
-
2030
- ```ts
2031
- const { data } = await client.$listConditionalVariants(
2032
- {
2033
- slug: 'example',
2034
- entity_id: 'example',
2035
- },
2036
- {
2037
- conditions: {
2038
- postal_code: '46045',
2039
- consumption: {
2040
- lt: 5000
2041
- }
2042
- },
2043
- search: '460',
2044
- sort: 'conditions.postal_code:asc',
2045
- from: 0,
2046
- size: 10,
2047
- cursor: 'eyJmcm9tIjoyNSwibGlzdGluZyI6IjNmOWMxZTJhIn0'
2048
- },
2049
- )
2050
- ```
2051
-
2052
- <details>
2053
- <summary>Response</summary>
2054
-
2055
- ```json
2056
- {
2057
- "hits": 8128,
2058
- "results": [
2059
- {
2060
- "variant_id": "var-46045",
2061
- "entity_id": "price-sp26d1yo",
2062
- "schema": "product",
2063
- "conditions": {
2064
- "postal_code": "46045",
2065
- "default": false
2066
- }
2067
- }
2068
- ],
2069
- "next": "eyJmcm9tIjoyNSwibGlzdGluZyI6IjNmOWMxZTJhIn0"
2070
- }
2071
- ```
2072
-
2073
- </details>
2074
-
2075
- ---
2076
-
2077
- ### `$getConditionalVariantTree`
2078
-
2079
- The variants list, each row carrying the version in effect at `as_of` — the Entity UI's main
2080
- editing screen in one call rather than one call per row.
2081
-
2082
- `POST /v1/conditional-pricing/{slug}/entities/{entity_id}/variants:tree`
2083
-
2084
- ```ts
2085
- const { data } = await client.$getConditionalVariantTree(
2086
- {
2087
- slug: 'example',
2088
- entity_id: 'example',
2089
- },
2090
- {
2091
- conditions: {
2092
- postal_code: '46045',
2093
- consumption: {
2094
- lt: 5000
2095
- }
2096
- },
2097
- search: '460',
2098
- sort: 'conditions.postal_code:asc',
2099
- from: 0,
2100
- size: 10,
2101
- cursor: 'eyJmcm9tIjoyNSwibGlzdGluZyI6IjNmOWMxZTJhIn0',
2102
- as_of: '2027-03-15T00:00:00Z'
2103
- },
2104
- )
2105
- ```
2106
-
2107
- <details>
2108
- <summary>Response</summary>
2109
-
2110
- ```json
2111
- {
2112
- "hits": 8128,
2113
- "results": [
2114
- {
2115
- "variant_id": "var-46045",
2116
- "entity_id": "price-sp26d1yo",
2117
- "schema": "product",
2118
- "conditions": {
2119
- "postal_code": "46045",
2120
- "default": false
2121
- },
2122
- "status": "active",
2123
- "version": {
2124
- "variant_id": "var-46045",
2125
- "entity_id": "price-sp26d1yo",
2126
- "schema": "product",
2127
- "conditions": {
2128
- "postal_code": "46045",
2129
- "default": false
2130
- },
2131
- "valid_from": "2027-01-01T00:00:00.000Z",
2132
- "values": {
2133
- "unit_amount": 2499,
2134
- "unit_amount_decimal": "24.99"
2135
- },
2136
- "_created_at": "string",
2137
- "_updated_at": "string"
2138
- }
2139
- }
2140
- ],
2141
- "next": "eyJmcm9tIjoyNSwibGlzdGluZyI6IjNmOWMxZTJhIn0"
2142
- }
2143
- ```
2144
-
2145
- </details>
2146
-
2147
- ---
2148
-
2149
1952
  ### `$getActiveConditionalVariantVersion`
2150
1953
 
2151
1954
  Returns the version of this variant that is currently in effect — the one with the latest
@@ -2237,12 +2040,10 @@ const { data } = await client.$replaceActiveConditionalVariantVersion(
2237
2040
  "_revision": 3,
2238
2041
  "warnings": [
2239
2042
  {
2240
- "code": "VARIANT_COUNT_APPROACHING_CAP",
2043
+ "code": "ACTIVE_VERSION_REPLACED",
2241
2044
  "message": "string",
2242
- "details": {
2243
- "variant_count": 0,
2244
- "cap": 0
2245
- }
2045
+ "valid_from": "2026-08-01T00:00:00.000Z",
2046
+ "active_valid_from": "2026-01-01T00:00:00.000Z"
2246
2047
  }
2247
2048
  ]
2248
2049
  }
@@ -2301,12 +2102,10 @@ const { data } = await client.$patchActiveConditionalVariantVersion(
2301
2102
  "_revision": 3,
2302
2103
  "warnings": [
2303
2104
  {
2304
- "code": "VARIANT_COUNT_APPROACHING_CAP",
2105
+ "code": "ACTIVE_VERSION_REPLACED",
2305
2106
  "message": "string",
2306
- "details": {
2307
- "variant_count": 0,
2308
- "cap": 0
2309
- }
2107
+ "valid_from": "2026-08-01T00:00:00.000Z",
2108
+ "active_valid_from": "2026-01-01T00:00:00.000Z"
2310
2109
  }
2311
2110
  ]
2312
2111
  }
@@ -2348,55 +2147,6 @@ const { data } = await client.$deleteConditionalVariant({
2348
2147
 
2349
2148
  ---
2350
2149
 
2351
- ### `$listConditionalVariantVersions`
2352
-
2353
- Lists one variant's versions — its whole timeline, oldest first, which is what expanding a row
2354
- of the tree loads.
2355
-
2356
- `GET /v1/conditional-pricing/{slug}/entities/{entity_id}/variants/{variant_id}/versions`
2357
-
2358
- ```ts
2359
- const { data } = await client.$listConditionalVariantVersions({
2360
- slug: 'example',
2361
- entity_id: 'example',
2362
- variant_id: 'example',
2363
- limit: 1,
2364
- order: 'example',
2365
- cursor: 'example',
2366
- })
2367
- ```
2368
-
2369
- <details>
2370
- <summary>Response</summary>
2371
-
2372
- ```json
2373
- {
2374
- "results": [
2375
- {
2376
- "variant_id": "var-46045",
2377
- "entity_id": "price-sp26d1yo",
2378
- "schema": "product",
2379
- "conditions": {
2380
- "postal_code": "46045",
2381
- "default": false
2382
- },
2383
- "valid_from": "2027-01-01T00:00:00.000Z",
2384
- "values": {
2385
- "unit_amount": 2499,
2386
- "unit_amount_decimal": "24.99"
2387
- },
2388
- "_created_at": "string",
2389
- "_updated_at": "string"
2390
- }
2391
- ],
2392
- "next": "eyJzayI6IlYjcHJpY2Utc3AyNmQxeW8jdmFyLTQ2MDQ1IzIwMjYtMDEtMDFUMDA6MDA6MDAuMDAwWiIsIm9yZGVyIjoiYXNjIn0"
2393
- }
2394
- ```
2395
-
2396
- </details>
2397
-
2398
- ---
2399
-
2400
2150
  ### `$appendConditionalVariantVersion`
2401
2151
 
2402
2152
  Appends a version to a variant: a new set of values taking effect at its own instant.
@@ -2445,12 +2195,10 @@ const { data } = await client.$appendConditionalVariantVersion(
2445
2195
  "_revision": 3,
2446
2196
  "warnings": [
2447
2197
  {
2448
- "code": "VARIANT_COUNT_APPROACHING_CAP",
2198
+ "code": "ACTIVE_VERSION_REPLACED",
2449
2199
  "message": "string",
2450
- "details": {
2451
- "variant_count": 0,
2452
- "cap": 0
2453
- }
2200
+ "valid_from": "2026-08-01T00:00:00.000Z",
2201
+ "active_valid_from": "2026-01-01T00:00:00.000Z"
2454
2202
  }
2455
2203
  ]
2456
2204
  }
@@ -2553,12 +2301,10 @@ const { data } = await client.$replaceConditionalVariantVersion(
2553
2301
  "_revision": 3,
2554
2302
  "warnings": [
2555
2303
  {
2556
- "code": "VARIANT_COUNT_APPROACHING_CAP",
2304
+ "code": "ACTIVE_VERSION_REPLACED",
2557
2305
  "message": "string",
2558
- "details": {
2559
- "variant_count": 0,
2560
- "cap": 0
2561
- }
2306
+ "valid_from": "2026-08-01T00:00:00.000Z",
2307
+ "active_valid_from": "2026-01-01T00:00:00.000Z"
2562
2308
  }
2563
2309
  ]
2564
2310
  }
@@ -2618,12 +2364,10 @@ const { data } = await client.$patchConditionalVariantVersion(
2618
2364
  "_revision": 3,
2619
2365
  "warnings": [
2620
2366
  {
2621
- "code": "VARIANT_COUNT_APPROACHING_CAP",
2367
+ "code": "ACTIVE_VERSION_REPLACED",
2622
2368
  "message": "string",
2623
- "details": {
2624
- "variant_count": 0,
2625
- "cap": 0
2626
- }
2369
+ "valid_from": "2026-08-01T00:00:00.000Z",
2370
+ "active_valid_from": "2026-01-01T00:00:00.000Z"
2627
2371
  }
2628
2372
  ]
2629
2373
  }
@@ -2660,157 +2404,10 @@ const { data } = await client.$deleteConditionalVariantVersion({
2660
2404
  "valid_from": "2027-01-01T00:00:00.000Z",
2661
2405
  "warnings": [
2662
2406
  {
2663
- "code": "VARIANT_COUNT_APPROACHING_CAP",
2407
+ "code": "ACTIVE_VERSION_REPLACED",
2664
2408
  "message": "string",
2665
- "details": {
2666
- "variant_count": 0,
2667
- "cap": 0
2668
- }
2669
- }
2670
- ]
2671
- }
2672
- ```
2673
-
2674
- </details>
2675
-
2676
- ---
2677
-
2678
- ### `$batchUpsertConditionalVariants`
2679
-
2680
- Writes up to 100 variants or versions in one call — the endpoint a bulk importer drives a
2681
- refresh cycle through, so hundreds of thousands of keys are a stream of calls rather than a
2682
- call per key.
2683
-
2684
- `POST /v1/conditional-pricing/{slug}/variants:batchUpsert`
2685
-
2686
- ```ts
2687
- const { data } = await client.$batchUpsertConditionalVariants(
2688
- {
2689
- slug: 'example',
2690
- },
2691
- {
2692
- correlation_id: 'tariff-refresh-2027-01',
2693
- items: [
2694
- {
2695
- entity_id: 'price-sp26d1yo',
2696
- conditions: {
2697
- postal_code: '46045'
2698
- },
2699
- default: false,
2700
- valid_from: '2027-01-01T00:00:00Z',
2701
- values: {
2702
- unit_amount: 2499,
2703
- unit_amount_decimal: '24.99'
2704
- }
2705
- }
2706
- ]
2707
- },
2708
- )
2709
- ```
2710
-
2711
- <details>
2712
- <summary>Response</summary>
2713
-
2714
- ```json
2715
- {
2716
- "correlation_id": "tariff-refresh-2027-01",
2717
- "counts": {
2718
- "variant_created": 1,
2719
- "version_created": 1,
2720
- "updated": 1,
2721
- "skipped": 1,
2722
- "error": 1
2723
- },
2724
- "results": [
2725
- {
2726
- "outcome": "variant_created",
2727
- "entity_id": "price-sp26d1yo",
2728
- "variant_id": "var-46045",
2729
- "valid_from": "2027-01-01T00:00:00.000Z",
2730
- "warnings": [
2731
- {
2732
- "code": "VARIANT_COUNT_APPROACHING_CAP",
2733
- "message": "string",
2734
- "details": {
2735
- "variant_count": 0,
2736
- "cap": 0
2737
- }
2738
- }
2739
- ],
2740
- "error": {
2741
- "code": "SCHEMA_NOT_FOUND",
2742
- "details": {
2743
- "schema": "price"
2744
- }
2745
- }
2746
- }
2747
- ]
2748
- }
2749
- ```
2750
-
2751
- </details>
2752
-
2753
- ---
2754
-
2755
- ### `$batchDeleteConditionalVariants`
2756
-
2757
- Removes up to 100 variants or versions in one call — the symmetric bulk withdrawal, so
2758
- retiring a generation of variants, or a scheduled adjustment across many of them, is as
2759
- cheap as creating it was.
2760
-
2761
- `POST /v1/conditional-pricing/{slug}/variants:batchDelete`
2762
-
2763
- ```ts
2764
- const { data } = await client.$batchDeleteConditionalVariants(
2765
- {
2766
- slug: 'example',
2767
- },
2768
- {
2769
- correlation_id: 'postal-code-cleanup-2026-09',
2770
- items: [
2771
- {
2772
- entity_id: 'price-sp26d1yo',
2773
- variant_id: 'var-46045',
2774
- valid_from: '2027-01-01T00:00:00Z'
2775
- }
2776
- ]
2777
- },
2778
- )
2779
- ```
2780
-
2781
- <details>
2782
- <summary>Response</summary>
2783
-
2784
- ```json
2785
- {
2786
- "correlation_id": "postal-code-cleanup-2026-09",
2787
- "counts": {
2788
- "deleted": 1,
2789
- "skipped": 1,
2790
- "error": 1
2791
- },
2792
- "results": [
2793
- {
2794
- "outcome": "deleted",
2795
- "entity_id": "price-sp26d1yo",
2796
- "variant_id": "var-46045",
2797
- "valid_from": "2027-01-01T00:00:00.000Z",
2798
- "warnings": [
2799
- {
2800
- "code": "VARIANT_COUNT_APPROACHING_CAP",
2801
- "message": "string",
2802
- "details": {
2803
- "variant_count": 0,
2804
- "cap": 0
2805
- }
2806
- }
2807
- ],
2808
- "error": {
2809
- "code": "SCHEMA_NOT_FOUND",
2810
- "details": {
2811
- "schema": "price"
2812
- }
2813
- }
2409
+ "valid_from": "2026-08-01T00:00:00.000Z",
2410
+ "active_valid_from": "2026-01-01T00:00:00.000Z"
2814
2411
  }
2815
2412
  ]
2816
2413
  }
@@ -2860,7 +2457,6 @@ verbatim.
2860
2457
 
2861
2458
  ```ts
2862
2459
  type ConditionDefinition = {
2863
- id: string // uuid
2864
2460
  name: string
2865
2461
  label: string
2866
2462
  type: "string" | "number" | "date" | "daterange" | "boolean" | "select" | "location"
@@ -2868,7 +2464,8 @@ type ConditionDefinition = {
2868
2464
  value: string
2869
2465
  title?: string
2870
2466
  }>
2871
- format?: "zipcode" | "zipcode_town"
2467
+ allow_any?: boolean
2468
+ format?: "zipcode" | "zipcode + town"
2872
2469
  }
2873
2470
  ```
2874
2471
 
@@ -2882,7 +2479,6 @@ type ConditionSet = {
2882
2479
  label: string
2883
2480
  description: string
2884
2481
  conditions: Array<{
2885
- id: string // uuid
2886
2482
  name: string
2887
2483
  label: string
2888
2484
  type: "string" | "number" | "date" | "daterange" | "boolean" | "select" | "location"
@@ -2890,7 +2486,8 @@ type ConditionSet = {
2890
2486
  value: { ... }
2891
2487
  title?: { ... }
2892
2488
  }>
2893
- format?: "zipcode" | "zipcode_town"
2489
+ allow_any?: boolean
2490
+ format?: "zipcode" | "zipcode + town"
2894
2491
  }>
2895
2492
  }
2896
2493
  ```
@@ -2904,11 +2501,11 @@ type ConditionSetCatalog = {
2904
2501
  label: string
2905
2502
  description: string
2906
2503
  conditions: Array<{
2907
- id: { ... }
2908
2504
  name: { ... }
2909
2505
  label: { ... }
2910
2506
  type: { ... }
2911
2507
  options?: { ... }
2508
+ allow_any?: { ... }
2912
2509
  format?: { ... }
2913
2510
  }>
2914
2511
  }>
@@ -2920,88 +2517,34 @@ type ConditionSetCatalog = {
2920
2517
  Machine-readable failure mode of a conditional-pricing operation, allowing clients
2921
2518
  to branch on the kind of failure instead of parsing the error message.
2922
2519
 
2923
- - `SCHEMA_NOT_FOUND` (404): no conditional entity type by that slug
2924
- - `ENTITY_NOT_FOUND` (404): the schema holds no entity with that id
2925
- - `ENTITY
2520
+ - `NOT_FOUND` (404): the addressed entity, variant or version does not exist
2521
+ - `AMBIGUOUS_RESOLUTION` (409): several variants match the given con
2926
2522
 
2927
2523
  ```ts
2928
- type ConditionalPricingErrorCode = "SCHEMA_NOT_FOUND" | "ENTITY_NOT_FOUND" | "ENTITY_TYPE_MISMATCH" | "ENTITY_NOT_CONDITIONAL" | "VARIANT_NOT_FOUND" | "VERSION_NOT_FOUND" | "NO_MATCHES" | "NO_ACTIVE_VERSION" | "AMBIGUOUS_RESOLUTION" | "TUPLE_CONFLICT" | "VERSION_CONFLICT" | "CONDITION_UNDEFINED" | "OPERATOR_UNSUPPORTED" | "CONTEXT_FORMAT_INVALID" | "CONDITION_VALUE_INVALID" | "TOO_MANY_MATCHES" | "WRITE_CONFLICT" | "OFFSET_WINDOW_EXCEEDED" | "CURSOR_INVALID" | "VARIANT_LIMIT_REACHED" | "PIN_FORMAT_INVALID" | "VARIANT_UNPINNED" | "LAST_VERSION_UNDELETABLE"
2524
+ type ConditionalPricingErrorCode = "NOT_FOUND" | "AMBIGUOUS_RESOLUTION" | "TUPLE_CONFLICT" | "VERSION_CONFLICT" | "CONDITION_UNDEFINED" | "OPERATOR_UNSUPPORTED" | "CONTEXT_FORMAT_INVALID" | "CONDITION_VALUE_INVALID" | "TOO_MANY_MATCHES" | "WRITE_CONFLICT"
2929
2525
  ```
2930
2526
 
2931
2527
  ### `ResolveConditionalEntityRequest`
2932
2528
 
2933
- A resolve names one conditional entity, then says which of its variants it means — one of two
2934
- ways, and never both. `context` describes a situation and asks which variants apply to it;
2935
- `variant_id` names one variant and skips matching entirely.
2936
-
2937
- A body carrying both, or neither, is a validation `400
2938
-
2939
2529
  ```ts
2940
2530
  type ResolveConditionalEntityRequest = {
2941
2531
  schema: "product" | "price" | "coupon"
2942
2532
  entity_id: string
2943
- context: Record<string, unknown>
2533
+ context?: Record<string, unknown>
2944
2534
  as_of?: string
2945
2535
  options?: {
2946
2536
  resolve_one?: boolean
2947
- hydrate?: boolean
2948
- }
2949
- } | {
2950
- schema: "product" | "price" | "coupon"
2951
- entity_id: string
2952
- variant_id: string
2953
- as_of?: string
2954
- options?: {
2955
- hydrate?: boolean
2956
2537
  }
2957
2538
  }
2958
2539
  ```
2959
2540
 
2960
- ### `ResolveByContextRequest`
2541
+ ### `ResolveContext`
2961
2542
 
2962
- Resolve by matching a situation: which of this entity's variants apply to `context`, each
2963
- composed with the version in effect at `as_of`.
2543
+ The situation to resolve for: a flat map keyed by condition name, as the entity's schema
2544
+ declares them. A condition left out of the map is not a wildcard — it matches only variants
2545
+ that leave that condition unpinned.
2964
2546
 
2965
-
2966
- ```ts
2967
- type ResolveByContextRequest = {
2968
- schema: "product" | "price" | "coupon"
2969
- entity_id: string
2970
- context: Record<string, unknown>
2971
- as_of?: string
2972
- options?: {
2973
- resolve_one?: boolean
2974
- hydrate?: boolean
2975
- }
2976
- }
2977
- ```
2978
-
2979
- ### `ResolveByPinRequest`
2980
-
2981
- Resolve by naming a variant: compose this one, whatever a context would have matched. What an
2982
- order needs to show the numbers a customer agreed to, and what a contract needs to show what
2983
- is billable now — the two differ only in whether `as_of` is supplied.
2984
-
2985
-
2986
- ```ts
2987
- type ResolveByPinRequest = {
2988
- schema: "product" | "price" | "coupon"
2989
- entity_id: string
2990
- variant_id: string
2991
- as_of?: string
2992
- options?: {
2993
- hydrate?: boolean
2994
- }
2995
- }
2996
- ```
2997
-
2998
- ### `ResolveContext`
2999
-
3000
- The situation to resolve for: a flat map keyed by condition name, as the entity's schema
3001
- declares them. A condition left out of the map is not a wildcard — it matches only variants
3002
- that leave that condition unpinned.
3003
-
3004
- Each value is either an exact value, typed by its condition, or a single-operator
2547
+ Each value is either an exact value, typed by its condition, or a single-operator
3005
2548
 
3006
2549
  ```ts
3007
2550
  type ResolveContext = Record<string, unknown>
@@ -3009,25 +2552,9 @@ type ResolveContext = Record<string, unknown>
3009
2552
 
3010
2553
  ### `ResolveOptions`
3011
2554
 
3012
- The options a context resolve accepts. A pin takes `PinnedResolveOptions` instead.
3013
-
3014
2555
  ```ts
3015
2556
  type ResolveOptions = {
3016
2557
  resolve_one?: boolean
3017
- hydrate?: boolean
3018
- }
3019
- ```
3020
-
3021
- ### `PinnedResolveOptions`
3022
-
3023
- The options a pinned resolve accepts — `hydrate` and nothing else. `resolve_one` has nothing
3024
- to change on this branch, where the answer is exactly one result or a 404, so a body sending
3025
- it is a validation `400`. `hydrate` means what `ResolveOptions.hydrate` means.
3026
-
3027
-
3028
- ```ts
3029
- type PinnedResolveOptions = {
3030
- hydrate?: boolean
3031
2558
  }
3032
2559
  ```
3033
2560
 
@@ -3042,10 +2569,6 @@ type ResolvedVariants = {
3042
2569
  _conditions: {
3043
2570
  default: { ... }
3044
2571
  }
3045
- _inert_overrides: Array<{
3046
- attribute: { ... }
3047
- reason: { ... }
3048
- }>
3049
2572
  }>
3050
2573
  }
3051
2574
  ```
@@ -3056,8 +2579,6 @@ The entity as this variant leaves it — every attribute of a plain entity read,
3056
2579
  applicable version's overrides applied — plus the discriminators saying where the numbers
3057
2580
  came from.
3058
2581
 
3059
- With `options.hydrate`, a relation attribute holds the entities it references rather than the
3060
- references thems
3061
2582
 
3062
2583
  ```ts
3063
2584
  type ResolvedVariant = {
@@ -3067,10 +2588,6 @@ type ResolvedVariant = {
3067
2588
  _conditions: {
3068
2589
  default: boolean
3069
2590
  }
3070
- _inert_overrides: Array<{
3071
- attribute: string
3072
- reason: "ATTRIBUTE_NOT_OVERRIDABLE" | "ATTRIBUTE_READONLY" | "ATTRIBUTE_HIDDEN" | "ATTRIBUTE_COMPUTED" | "ATTRIBUTE_UNDECLARED" | "TYPE_NOT_OVERRIDABLE" | "CAPABILITY_NOT_OVERRIDABLE"
3073
- }>
3074
2591
  }
3075
2592
  ```
3076
2593
 
@@ -3115,8 +2632,8 @@ type PinnedConditions = Record<string, unknown>
3115
2632
  The attribute values this version overrides on the base entity, keyed by attribute name.
3116
2633
 
3117
2634
  Only attributes currently declaring `overridable_attribute` are applied. Metadata fields
3118
- (anything underscore-prefixed), readonly attributes, hidden attributes, computed attributes,
3119
- attributes of a type no vari
2635
+ (anything underscore-prefixed), readonly attributes, hidden attributes and non-overridable
2636
+ attributes present here are ig
3120
2637
 
3121
2638
  ```ts
3122
2639
  type VariantValues = Record<string, unknown>
@@ -3140,831 +2657,149 @@ type CreatedVariant = {
3140
2657
  warnings: Array<{
3141
2658
  code: "VARIANT_COUNT_APPROACHING_CAP"
3142
2659
  message: string
3143
- details: {
3144
- variant_count: { ... }
3145
- cap: { ... }
3146
- }
3147
- } | {
3148
- code: "ACTIVE_VERSION_CHANGED"
3149
- message: string
3150
- details: {
3151
- valid_from: { ... }
3152
- active_valid_from?: { ... }
3153
- }
3154
- } | {
3155
- code: "SUPERSEDED_VERSION_WRITTEN"
3156
- message: string
3157
- details: {
3158
- valid_from: { ... }
3159
- active_valid_from?: { ... }
3160
- }
3161
- } | {
3162
- code: "ATTRIBUTES_NOT_APPLIED"
3163
- message: string
3164
- details: {
3165
- attributes: { ... }
3166
- }
3167
- }>
3168
- }
3169
- ```
3170
-
3171
- ### `WriteWarning`
3172
-
3173
- Something worth knowing that did not stop a write.
3174
-
3175
- One vocabulary for every write, so a client branches on what happened rather than on which
3176
- endpoint it called. `code` and `message` are the only two fields every code shares; everything
3177
- else lives in a `details` object typed per code, so narrowing
3178
-
3179
- ```ts
3180
- type WriteWarning = {
3181
- code: "VARIANT_COUNT_APPROACHING_CAP"
3182
- message: string
3183
- details: {
3184
2660
  variant_count: number
3185
2661
  cap: number
3186
- }
3187
- } | {
3188
- code: "ACTIVE_VERSION_CHANGED"
3189
- message: string
3190
- details: {
3191
- valid_from: string
3192
- active_valid_from?: string
3193
- }
3194
- } | {
3195
- code: "SUPERSEDED_VERSION_WRITTEN"
3196
- message: string
3197
- details: {
3198
- valid_from: string
3199
- active_valid_from?: string
3200
- }
3201
- } | {
3202
- code: "ATTRIBUTES_NOT_APPLIED"
3203
- message: string
3204
- details: {
3205
- attributes: Array<{
3206
- attribute: { ... }
3207
- reason: { ... }
3208
- }>
3209
- }
3210
- }
3211
- ```
3212
-
3213
- ### `VersionMoved`
3214
-
3215
- Which version a write moved, and which one was in effect while it did.
3216
-
3217
-
3218
- ```ts
3219
- type VersionMoved = {
3220
- valid_from: string
3221
- active_valid_from?: string
3222
- }
3223
- ```
3224
-
3225
- ### `InertOverride`
3226
-
3227
- One override that did not apply, and why.
3228
-
3229
- The same entry on both sides of the feature: a write reports the attributes in its body it did
3230
- not store, and a resolved payload reports the stored overrides composition did not apply. Those
3231
- are the same fact observed at two moments, so a client learns one
3232
-
3233
- ```ts
3234
- type InertOverride = {
3235
- attribute: string
3236
- reason: "ATTRIBUTE_NOT_OVERRIDABLE" | "ATTRIBUTE_READONLY" | "ATTRIBUTE_HIDDEN" | "ATTRIBUTE_COMPUTED" | "ATTRIBUTE_UNDECLARED" | "TYPE_NOT_OVERRIDABLE" | "CAPABILITY_NOT_OVERRIDABLE"
3237
- }
3238
- ```
3239
-
3240
- ### `InertOverrideReason`
3241
-
3242
- Why one override did not apply.
3243
-
3244
- - `ATTRIBUTE_NOT_OVERRIDABLE`: the entity's schema declares the attribute but has not granted
3245
- it `overridable_attribute`. Granting the flag is an ordinary schema edit, which makes this
3246
- the reason most often worth acting on.
3247
- - `ATTRIBUTE_READONLY`: the attribute i
3248
-
3249
- ```ts
3250
- type InertOverrideReason = "ATTRIBUTE_NOT_OVERRIDABLE" | "ATTRIBUTE_READONLY" | "ATTRIBUTE_HIDDEN" | "ATTRIBUTE_COMPUTED" | "ATTRIBUTE_UNDECLARED" | "TYPE_NOT_OVERRIDABLE" | "CAPABILITY_NOT_OVERRIDABLE"
3251
- ```
3252
-
3253
- ### `DeletedVariant`
3254
-
3255
- ```ts
3256
- type DeletedVariant = {
3257
- variant_id: string
3258
- entity_id: string
3259
- schema: "product" | "price" | "coupon"
3260
- tuple_released: boolean
3261
- versions_deleted: number
3262
- }
3263
- ```
3264
-
3265
- ### `VariantVersion`
3266
-
3267
- One version of one variant: the attribute overrides it carries, the instant it takes effect,
3268
- and the variant it belongs to.
3269
-
3270
- These are the version's **own** overrides, not the base entity overlaid with them — this is
3271
- what an editing screen loads and saves, and what it edits is the overrides. Composi
3272
-
3273
- ```ts
3274
- type VariantVersion = {
3275
- variant_id: string
3276
- entity_id: string
3277
- schema: "product" | "price" | "coupon"
3278
- conditions: {
3279
- default: boolean
3280
- }
3281
- valid_from: string
3282
- values: Record<string, unknown>
3283
- _created_at: string
3284
- _updated_at: string
3285
- _revision: number
3286
- }
3287
- ```
3288
-
3289
- ### `WrittenVariantVersion`
3290
-
3291
- A version as a write left it, together with anything the write moved.
3292
-
3293
-
3294
- ```ts
3295
- type WrittenVariantVersion = {
3296
- variant_id: string
3297
- entity_id: string
3298
- schema: "product" | "price" | "coupon"
3299
- conditions: {
3300
- default: boolean
3301
- }
3302
- valid_from: string
3303
- values: Record<string, unknown>
3304
- _created_at: string
3305
- _updated_at: string
3306
- _revision: number
3307
- warnings: Array<{
3308
- code: "VARIANT_COUNT_APPROACHING_CAP"
3309
- message: string
3310
- details: {
3311
- variant_count: { ... }
3312
- cap: { ... }
3313
- }
3314
- } | {
3315
- code: "ACTIVE_VERSION_CHANGED"
3316
- message: string
3317
- details: {
3318
- valid_from: { ... }
3319
- active_valid_from?: { ... }
3320
- }
3321
- } | {
3322
- code: "SUPERSEDED_VERSION_WRITTEN"
3323
- message: string
3324
- details: {
3325
- valid_from: { ... }
3326
- active_valid_from?: { ... }
3327
- }
3328
- } | {
3329
- code: "ATTRIBUTES_NOT_APPLIED"
3330
- message: string
3331
- details: {
3332
- attributes: { ... }
3333
- }
3334
2662
  }>
3335
2663
  }
3336
2664
  ```
3337
2665
 
3338
- ### `DeletedVariantVersion`
2666
+ ### `VariantWriteWarning`
3339
2667
 
3340
2668
  ```ts
3341
- type DeletedVariantVersion = {
3342
- variant_id: string
3343
- entity_id: string
3344
- schema: "product" | "price" | "coupon"
3345
- valid_from: string
3346
- warnings: Array<{
3347
- code: "VARIANT_COUNT_APPROACHING_CAP"
3348
- message: string
3349
- details: {
3350
- variant_count: { ... }
3351
- cap: { ... }
3352
- }
3353
- } | {
3354
- code: "ACTIVE_VERSION_CHANGED"
3355
- message: string
3356
- details: {
3357
- valid_from: { ... }
3358
- active_valid_from?: { ... }
3359
- }
3360
- } | {
3361
- code: "SUPERSEDED_VERSION_WRITTEN"
3362
- message: string
3363
- details: {
3364
- valid_from: { ... }
3365
- active_valid_from?: { ... }
3366
- }
3367
- } | {
3368
- code: "ATTRIBUTES_NOT_APPLIED"
3369
- message: string
3370
- details: {
3371
- attributes: { ... }
3372
- }
3373
- }>
3374
- }
3375
- ```
3376
-
3377
- ### `AppendVersionRequest`
3378
-
3379
- ```ts
3380
- type AppendVersionRequest = {
3381
- valid_from?: string
3382
- values: Record<string, unknown>
3383
- conditions?: Record<string, unknown>
3384
- }
3385
- ```
3386
-
3387
- ### `ReplaceVersionRequest`
3388
-
3389
- ```ts
3390
- type ReplaceVersionRequest = {
3391
- values: Record<string, unknown>
3392
- _revision: number
3393
- valid_from?: string
3394
- conditions?: Record<string, unknown>
3395
- }
3396
- ```
3397
-
3398
- ### `PatchVersionRequest`
3399
-
3400
- ```ts
3401
- type PatchVersionRequest = {
3402
- values: Record<string, unknown>
3403
- _revision: number
3404
- valid_from?: string
3405
- conditions?: Record<string, unknown>
3406
- }
3407
- ```
3408
-
3409
- ### `ListVariantsRequest`
3410
-
3411
- How to narrow and page a variant listing. Every property is optional, so `{}` is a valid body
3412
- and asks for the first ten variants of the entity in `variant_id` order — the body itself is
3413
- required, and an omitted one is a request-validation `400` rather than an unnarrowed page.
3414
-
3415
- `conditions` and `sea
3416
-
3417
- ```ts
3418
- type ListVariantsRequest = {
3419
- conditions?: Record<string, unknown>
3420
- search?: string
3421
- sort?: string
3422
- from?: number
3423
- size?: number
3424
- cursor?: string
3425
- }
3426
- ```
3427
-
3428
- ### `VariantTreeRequest`
3429
-
3430
- The variants list's request plus `as_of`, the instant each row's version is selected at.
3431
- `size` is clamped at 100 here; every other shared property means what it means on the list.
3432
-
3433
-
3434
- ```ts
3435
- type VariantTreeRequest = {
3436
- conditions?: Record<string, unknown>
3437
- search?: string
3438
- sort?: string
3439
- from?: number
3440
- size?: number
3441
- cursor?: string
3442
- as_of?: string
3443
- }
3444
- ```
3445
-
3446
- ### `VariantConditionFilter`
3447
-
3448
- Which pins a variant must carry to be listed: a flat map keyed by condition name, as the
3449
- entity's schema declares them. A condition left out of the map is not filtered on at all.
3450
-
3451
- Each value is either an exact value, typed by its condition, or a single-operator predicate
3452
- object — the same seven a re
3453
-
3454
- ```ts
3455
- type VariantConditionFilter = Record<string, unknown>
3456
- ```
3457
-
3458
- ### `VariantList`
3459
-
3460
- ```ts
3461
- type VariantList = {
3462
- hits: number
3463
- results: Array<{
3464
- variant_id: string
3465
- entity_id: string
3466
- schema: "product" | "price" | "coupon"
3467
- conditions: {
3468
- default: { ... }
3469
- }
3470
- }>
3471
- next?: string
3472
- }
3473
- ```
3474
-
3475
- ### `VariantListRow`
3476
-
3477
- One variant as a listing reports it: which variant it is and what it pins.
3478
-
3479
- No `_revision` — a write re-reads its version through that version's own `GET` — and no
3480
- `_inert_overrides`, since a listing reports what is stored and only `:resolve` honours the
3481
- schema.
3482
-
3483
-
3484
- ```ts
3485
- type VariantListRow = {
3486
- variant_id: string
3487
- entity_id: string
3488
- schema: "product" | "price" | "coupon"
3489
- conditions: {
3490
- default: boolean
3491
- }
3492
- }
3493
- ```
3494
-
3495
- ### `VariantTree`
3496
-
3497
- ```ts
3498
- type VariantTree = {
3499
- hits: number
3500
- results: Array<{
3501
- variant_id: string
3502
- entity_id: string
3503
- schema: "product" | "price" | "coupon"
3504
- conditions: {
3505
- default: { ... }
3506
- }
3507
- status: "active" | "scheduled"
3508
- version: {
3509
- variant_id: { ... }
3510
- entity_id: { ... }
3511
- schema: { ... }
3512
- conditions: { ... }
3513
- valid_from: { ... }
3514
- values: { ... }
3515
- _created_at: { ... }
3516
- _updated_at: { ... }
3517
- }
3518
- }>
3519
- next?: string
3520
- }
3521
- ```
3522
-
3523
- ### `VariantTreeRow`
3524
-
3525
- A listing row plus the one version the tree view shows for it, and the status saying which
3526
- version that is.
3527
-
3528
-
3529
- ```ts
3530
- type VariantTreeRow = {
3531
- variant_id: string
3532
- entity_id: string
3533
- schema: "product" | "price" | "coupon"
3534
- conditions: {
3535
- default: boolean
3536
- }
3537
- status: "active" | "scheduled"
3538
- version: {
3539
- variant_id: string
3540
- entity_id: string
3541
- schema: "product" | "price" | "coupon"
3542
- conditions: {
3543
- default: { ... }
3544
- }
3545
- valid_from: string
3546
- values: Record<string, unknown>
3547
- _created_at: string
3548
- _updated_at: string
3549
- }
3550
- }
3551
- ```
3552
-
3553
- ### `VariantTreeRowStatus`
3554
-
3555
- Whether a tree row's version is the one in effect at `as_of`, or one still ahead of it.
3556
-
3557
- Exactly two values, and every row has one: a variant always has at least one version, so
3558
- either a version is in effect at `as_of` or every version of that variant is still to come.
3559
-
3560
- - `active`: `version` is the
3561
-
3562
- ```ts
3563
- type VariantTreeRowStatus = "active" | "scheduled"
3564
- ```
3565
-
3566
- ### `VariantVersionSnapshot`
3567
-
3568
- One version of one variant as a listing reports it: `VariantVersion` without `_revision`.
3569
-
3570
- The revision is missing on purpose. An editing screen re-reads the one version it is about to
3571
- write through that version's own `GET`, which is strongly consistent, and writes with the
3572
- revision it gets back.
3573
-
3574
- E
3575
-
3576
- ```ts
3577
- type VariantVersionSnapshot = {
3578
- variant_id: string
3579
- entity_id: string
3580
- schema: "product" | "price" | "coupon"
3581
- conditions: {
3582
- default: boolean
3583
- }
3584
- valid_from: string
3585
- values: Record<string, unknown>
3586
- _created_at: string
3587
- _updated_at: string
3588
- }
3589
- ```
3590
-
3591
- ### `VariantVersionList`
3592
-
3593
- ```ts
3594
- type VariantVersionList = {
3595
- results: Array<{
3596
- variant_id: string
3597
- entity_id: string
3598
- schema: "product" | "price" | "coupon"
3599
- conditions: {
3600
- default: { ... }
3601
- }
3602
- valid_from: string
3603
- values: Record<string, unknown>
3604
- _created_at: string
3605
- _updated_at: string
3606
- }>
3607
- next?: string
3608
- }
3609
- ```
3610
-
3611
- ### `BatchUpsertVariantsRequest`
3612
-
3613
- A batch of variant writes under one schema, each item naming the entity it writes to.
3614
-
3615
-
3616
- ```ts
3617
- type BatchUpsertVariantsRequest = {
3618
- correlation_id?: string
3619
- items: Array<{
3620
- entity_id: string
3621
- conditions?: Record<string, unknown>
3622
- default?: boolean
3623
- valid_from?: string
3624
- values: Record<string, unknown>
3625
- }>
3626
- }
3627
- ```
3628
-
3629
- ### `BatchUpsertItem`
3630
-
3631
- One variant write: the entity it belongs to, the situation it applies to, and the values it
3632
- carries — the single-item create's body plus `entity_id`. The two differ on `conditions`: on
3633
- a create an existing tuple is `TUPLE_CONFLICT`, and here it is a version appended to the
3634
- variant already holding it
3635
-
3636
- ```ts
3637
- type BatchUpsertItem = {
3638
- entity_id: string
3639
- conditions?: Record<string, unknown>
3640
- default?: boolean
3641
- valid_from?: string
3642
- values: Record<string, unknown>
3643
- }
3644
- ```
3645
-
3646
- ### `BatchDeleteVariantsRequest`
3647
-
3648
- A batch of variant and version deletes under one schema, each item naming the entity it
3649
- removes from.
3650
-
3651
-
3652
- ```ts
3653
- type BatchDeleteVariantsRequest = {
3654
- correlation_id?: string
3655
- items: Array<{
3656
- entity_id: string
3657
- variant_id: string
3658
- valid_from?: string
3659
- } | {
3660
- entity_id: string
3661
- conditions?: Record<string, unknown>
3662
- default?: boolean
3663
- valid_from?: string
3664
- }>
3665
- }
3666
- ```
3667
-
3668
- ### `BatchDeleteItem`
3669
-
3670
- One delete: the variant, addressed by id or by the condition tuple it pins, and optionally
3671
- the one version of it to remove.
3672
-
3673
- Exactly one of the two forms. An item carrying both a `variant_id` and `conditions` matches
3674
- neither branch and is an envelope `400`, since the request validator rejects the bo
3675
-
3676
- ```ts
3677
- type BatchDeleteItem = {
3678
- entity_id: string
3679
- variant_id: string
3680
- valid_from?: string
3681
- } | {
3682
- entity_id: string
3683
- conditions?: Record<string, unknown>
3684
- default?: boolean
3685
- valid_from?: string
3686
- }
3687
- ```
3688
-
3689
- ### `BatchDeleteByVariantId`
3690
-
3691
- A delete addressing its variant by id — the form a cleanup pass uses after the schema has
3692
- drifted, since a tuple naming a condition the schema no longer declares addresses nothing.
3693
-
3694
-
3695
- ```ts
3696
- type BatchDeleteByVariantId = {
3697
- entity_id: string
3698
- variant_id: string
3699
- valid_from?: string
2669
+ type VariantWriteWarning = {
2670
+ code: "VARIANT_COUNT_APPROACHING_CAP"
2671
+ message: string
2672
+ variant_count: number
2673
+ cap: number
3700
2674
  }
3701
2675
  ```
3702
2676
 
3703
- ### `BatchDeleteByConditions`
3704
-
3705
- A delete addressing its variant by the situation it applies to — the form an importer uses
3706
- when it knows the source rows rather than the ids they produced.
3707
-
3708
- `conditions` is optional because the entity's fallback variant pins nothing: an item
3709
- addressing it sends `default: true` and no `conditions`, e
2677
+ ### `DeletedVariant`
3710
2678
 
3711
2679
  ```ts
3712
- type BatchDeleteByConditions = {
2680
+ type DeletedVariant = {
2681
+ variant_id: string
3713
2682
  entity_id: string
3714
- conditions?: Record<string, unknown>
3715
- default?: boolean
3716
- valid_from?: string
2683
+ schema: "product" | "price" | "coupon"
2684
+ tuple_released: boolean
2685
+ versions_deleted: number
3717
2686
  }
3718
2687
  ```
3719
2688
 
3720
- ### `BatchUpsertResult`
2689
+ ### `VariantVersion`
3721
2690
 
3722
- What a batch upsert did: one entry per item, in request order, and a count per outcome.
2691
+ One version of one variant: the attribute overrides it carries, the instant it takes effect,
2692
+ and the variant it belongs to.
3723
2693
 
2694
+ These are the version's **own** overrides, not the base entity overlaid with them — this is
2695
+ what an editing screen loads and saves, and what it edits is the overrides. Composi
3724
2696
 
3725
2697
  ```ts
3726
- type BatchUpsertResult = {
3727
- correlation_id?: string
3728
- counts: {
3729
- variant_created: number
3730
- version_created: number
3731
- updated: number
3732
- skipped: number
3733
- error: number
2698
+ type VariantVersion = {
2699
+ variant_id: string
2700
+ entity_id: string
2701
+ schema: "product" | "price" | "coupon"
2702
+ conditions: {
2703
+ default: boolean
3734
2704
  }
3735
- results: Array<{
3736
- outcome: "variant_created" | "version_created" | "updated" | "skipped" | "error"
3737
- entity_id: string
3738
- variant_id?: string
3739
- valid_from?: string
3740
- warnings: Array<{
3741
- code: { ... }
3742
- message: { ... }
3743
- details: { ... }
3744
- } | {
3745
- code: { ... }
3746
- message: { ... }
3747
- details: { ... }
3748
- } | {
3749
- code: { ... }
3750
- message: { ... }
3751
- details: { ... }
3752
- } | {
3753
- code: { ... }
3754
- message: { ... }
3755
- details: { ... }
3756
- }>
3757
- error?: {
3758
- message: { ... }
3759
- status?: { ... }
3760
- cause?: { ... }
3761
- error?: { ... }
3762
- }
3763
- }>
2705
+ valid_from: string
2706
+ values: Record<string, unknown>
2707
+ _created_at: string
2708
+ _updated_at: string
2709
+ _revision: number
3764
2710
  }
3765
2711
  ```
3766
2712
 
3767
- ### `BatchDeleteResult`
2713
+ ### `WrittenVariantVersion`
3768
2714
 
3769
- What a batch delete did: one entry per item, in request order, and a count per outcome.
2715
+ A version as a write left it, together with anything the write moved.
3770
2716
 
3771
2717
 
3772
2718
  ```ts
3773
- type BatchDeleteResult = {
3774
- correlation_id?: string
3775
- counts: {
3776
- deleted: number
3777
- skipped: number
3778
- error: number
2719
+ type WrittenVariantVersion = {
2720
+ variant_id: string
2721
+ entity_id: string
2722
+ schema: "product" | "price" | "coupon"
2723
+ conditions: {
2724
+ default: boolean
3779
2725
  }
3780
- results: Array<{
3781
- outcome: "deleted" | "skipped" | "error"
3782
- entity_id: string
3783
- variant_id?: string
3784
- valid_from?: string
3785
- warnings: Array<{
3786
- code: { ... }
3787
- message: { ... }
3788
- details: { ... }
3789
- } | {
3790
- code: { ... }
3791
- message: { ... }
3792
- details: { ... }
3793
- } | {
3794
- code: { ... }
3795
- message: { ... }
3796
- details: { ... }
3797
- } | {
3798
- code: { ... }
3799
- message: { ... }
3800
- details: { ... }
3801
- }>
3802
- error?: {
3803
- message: { ... }
3804
- status?: { ... }
3805
- cause?: { ... }
3806
- error?: { ... }
3807
- }
2726
+ valid_from: string
2727
+ values: Record<string, unknown>
2728
+ _created_at: string
2729
+ _updated_at: string
2730
+ _revision: number
2731
+ warnings: Array<{
2732
+ code: "ACTIVE_VERSION_REPLACED" | "SUPERSEDED_VERSION_WRITTEN"
2733
+ message: string
2734
+ valid_from: string
2735
+ active_valid_from?: string
3808
2736
  }>
3809
2737
  }
3810
2738
  ```
3811
2739
 
3812
- ### `BatchUpsertOutcome`
3813
-
3814
- What one upsert item did, derived from what was stored rather than from a mode the caller
3815
- declared.
3816
-
3817
- - `variant_created`: the condition tuple was unknown, so a variant and its first version were
3818
- created. The entry's `variant_id` is the id an order or contract pins.
3819
- - `version_created`: the tuple w
3820
-
3821
- ```ts
3822
- type BatchUpsertOutcome = "variant_created" | "version_created" | "updated" | "skipped" | "error"
3823
- ```
3824
-
3825
- ### `BatchDeleteOutcome`
3826
-
3827
- What one delete item did.
3828
-
3829
- - `deleted`: the variant, or the one version the item named, is gone.
3830
- - `skipped`: the item addressed nothing — **the variant or the version**, never the entity. An
3831
- entity that cannot answer the item is an `error` carrying `ENTITY_NOT_FOUND`,
3832
- `ENTITY_TYPE_MISMATCH` or
2740
+ ### `DeletedVariantVersion`
3833
2741
 
3834
2742
  ```ts
3835
- type BatchDeleteOutcome = "deleted" | "skipped" | "error"
2743
+ type DeletedVariantVersion = {
2744
+ variant_id: string
2745
+ entity_id: string
2746
+ schema: "product" | "price" | "coupon"
2747
+ valid_from: string
2748
+ warnings: Array<{
2749
+ code: "ACTIVE_VERSION_REPLACED" | "SUPERSEDED_VERSION_WRITTEN"
2750
+ message: string
2751
+ valid_from: string
2752
+ active_valid_from?: string
2753
+ }>
2754
+ }
3836
2755
  ```
3837
2756
 
3838
- ### `BatchUpsertCounts`
2757
+ ### `VersionWriteWarning`
3839
2758
 
3840
- How many items reached each outcome. Keyed by exactly the values of `BatchUpsertOutcome`, all
3841
- of them present, so a logger reads a count without `?? 0`.
3842
-
3843
- **They sum to the length of `results`.** There is no `total`.
2759
+ Something a version write moved. A version write is never refused for being late — backdating a
2760
+ version, and editing or deleting one that has already been superseded, are both accepted — so
2761
+ what a caller gets instead is a warning naming exactly what changed. One write can carry both
2762
+ codes.
3844
2763
 
3845
2764
 
3846
2765
  ```ts
3847
- type BatchUpsertCounts = {
3848
- variant_created: number
3849
- version_created: number
3850
- updated: number
3851
- skipped: number
3852
- error: number
2766
+ type VersionWriteWarning = {
2767
+ code: "ACTIVE_VERSION_REPLACED" | "SUPERSEDED_VERSION_WRITTEN"
2768
+ message: string
2769
+ valid_from: string
2770
+ active_valid_from?: string
3853
2771
  }
3854
2772
  ```
3855
2773
 
3856
- ### `BatchDeleteCounts`
3857
-
3858
- How many items reached each outcome. Keyed by exactly the values of `BatchDeleteOutcome`, all
3859
- of them present, and summing to the length of `results`. No `total`.
3860
-
2774
+ ### `AppendVersionRequest`
3861
2775
 
3862
2776
  ```ts
3863
- type BatchDeleteCounts = {
3864
- deleted: number
3865
- skipped: number
3866
- error: number
2777
+ type AppendVersionRequest = {
2778
+ valid_from?: string
2779
+ values: Record<string, unknown>
2780
+ conditions?: Record<string, unknown>
3867
2781
  }
3868
2782
  ```
3869
2783
 
3870
- ### `BatchUpsertResultEntry`
3871
-
3872
- What one upsert item did, and anything worth knowing about it.
3873
-
3874
- **It carries nothing else.** Position in `results` is the contract, so no entry carries an
3875
- index; nothing the caller sent is echoed back beyond `entity_id`; and there is no `_revision`
3876
- — an editing screen re-reads the version it is abou
2784
+ ### `ReplaceVersionRequest`
3877
2785
 
3878
2786
  ```ts
3879
- type BatchUpsertResultEntry = {
3880
- outcome: "variant_created" | "version_created" | "updated" | "skipped" | "error"
3881
- entity_id: string
3882
- variant_id?: string
2787
+ type ReplaceVersionRequest = {
2788
+ values: Record<string, unknown>
2789
+ _revision: number
3883
2790
  valid_from?: string
3884
- warnings: Array<{
3885
- code: "VARIANT_COUNT_APPROACHING_CAP"
3886
- message: string
3887
- details: {
3888
- variant_count: { ... }
3889
- cap: { ... }
3890
- }
3891
- } | {
3892
- code: "ACTIVE_VERSION_CHANGED"
3893
- message: string
3894
- details: {
3895
- valid_from: { ... }
3896
- active_valid_from?: { ... }
3897
- }
3898
- } | {
3899
- code: "SUPERSEDED_VERSION_WRITTEN"
3900
- message: string
3901
- details: {
3902
- valid_from: { ... }
3903
- active_valid_from?: { ... }
3904
- }
3905
- } | {
3906
- code: "ATTRIBUTES_NOT_APPLIED"
3907
- message: string
3908
- details: {
3909
- attributes: { ... }
3910
- }
3911
- }>
3912
- error?: {
3913
- message: string
3914
- status?: number
3915
- cause?: string
3916
- error?: string | Record<string, unknown>[]
3917
- }
2791
+ conditions?: Record<string, unknown>
3918
2792
  }
3919
2793
  ```
3920
2794
 
3921
- ### `BatchDeleteResultEntry`
3922
-
3923
- What one delete item did, and anything worth knowing about it.
3924
-
3925
- The same six properties as a batch upsert entry, and it carries nothing else.
3926
-
2795
+ ### `PatchVersionRequest`
3927
2796
 
3928
2797
  ```ts
3929
- type BatchDeleteResultEntry = {
3930
- outcome: "deleted" | "skipped" | "error"
3931
- entity_id: string
3932
- variant_id?: string
2798
+ type PatchVersionRequest = {
2799
+ values: Record<string, unknown>
2800
+ _revision: number
3933
2801
  valid_from?: string
3934
- warnings: Array<{
3935
- code: "VARIANT_COUNT_APPROACHING_CAP"
3936
- message: string
3937
- details: {
3938
- variant_count: { ... }
3939
- cap: { ... }
3940
- }
3941
- } | {
3942
- code: "ACTIVE_VERSION_CHANGED"
3943
- message: string
3944
- details: {
3945
- valid_from: { ... }
3946
- active_valid_from?: { ... }
3947
- }
3948
- } | {
3949
- code: "SUPERSEDED_VERSION_WRITTEN"
3950
- message: string
3951
- details: {
3952
- valid_from: { ... }
3953
- active_valid_from?: { ... }
3954
- }
3955
- } | {
3956
- code: "ATTRIBUTES_NOT_APPLIED"
3957
- message: string
3958
- details: {
3959
- attributes: { ... }
3960
- }
3961
- }>
3962
- error?: {
3963
- message: string
3964
- status?: number
3965
- cause?: string
3966
- error?: string | Record<string, unknown>[]
3967
- }
2802
+ conditions?: Record<string, unknown>
3968
2803
  }
3969
2804
  ```
3970
2805
 
@@ -3978,32 +2813,21 @@ type Error = {
3978
2813
  }
3979
2814
  ```
3980
2815
 
3981
- ### `ReportedError`
3982
-
3983
- The `error` field of an error response: the message, or — where the request itself failed
3984
- validation before any handler ran — the validation errors themselves, which those 400s put
3985
- here in place of a string.
3986
-
3987
- A conditional-pricing operation answers a body its schema rejects with the list, and
3988
- everyt
3989
-
3990
- ```ts
3991
- type ReportedError = string | Record<string, unknown>[]
3992
- ```
3993
-
3994
2816
  ### `ConditionalPricingError`
3995
2817
 
3996
- An error from a conditional-pricing operation, carrying a machine-readable `code` from the
3997
- conditional-pricing vocabulary plus the structured data that code explains, so a client can
3998
- branch on the kind of failure rather than parse the message.
3999
- Referenced only by the operations that emit these codes;
2818
+ An error from a conditional-pricing operation, carrying a machine-readable `code`
2819
+ from the conditional-pricing vocabulary plus any structured data about the failure,
2820
+ so a client can branch on the kind of failure rather than parse the message.
2821
+ Referenced only by the operations that emit these codes;
4000
2822
 
4001
2823
  ```ts
4002
2824
  type ConditionalPricingError = {
4003
2825
  message: string
4004
2826
  status?: number
4005
2827
  cause?: string
4006
- error?: string | Record<string, unknown>[]
2828
+ error?: string
2829
+ code?: "NOT_FOUND" | "AMBIGUOUS_RESOLUTION" | "TUPLE_CONFLICT" | "VERSION_CONFLICT" | "CONDITION_UNDEFINED" | "OPERATOR_UNSUPPORTED" | "CONTEXT_FORMAT_INVALID" | "CONDITION_VALUE_INVALID" | "TOO_MANY_MATCHES" | "WRITE_CONFLICT"
2830
+ details?: Record<string, unknown>
4007
2831
  }
4008
2832
  ```
4009
2833
 
@@ -4078,7 +2902,6 @@ type Product = {
4078
2902
  _tags?: { ... }
4079
2903
  }>
4080
2904
  }
4081
- is_conditional?: boolean
4082
2905
  _availability_files?: Array<{
4083
2906
  _id: string
4084
2907
  filename: string
@@ -4272,7 +3095,6 @@ type Order = {
4272
3095
  product_images?: { ... }
4273
3096
  product_downloads?: { ... }
4274
3097
  price_options?: { ... }
4275
- is_conditional?: { ... }
4276
3098
  _availability_files?: { ... }
4277
3099
  _id?: { ... }
4278
3100
  _title?: { ... }
@@ -4283,6 +3105,7 @@ type Order = {
4283
3105
  } | {
4284
3106
  metadata?: Array<{
4285
3107
  key?: { ... }
3108
+ value?: { ... }
4286
3109
  // ...
4287
3110
  }
4288
3111
  ```
@@ -4485,6 +3308,17 @@ type ExternalFeeMetadata = {
4485
3308
  unit_amount_decimal?: { ... }
4486
3309
  }>
4487
3310
  }
3311
+ inputs?: {
3312
+ type?: "power" | "gas"
3313
+ consumptionHT?: number
3314
+ consumptionNT?: number
3315
+ consumptionType?: "household" | "heating_pump" | "night_storage_heating" | "night_storage_heating_common_meter"
3316
+ zipCode?: string
3317
+ city?: string
3318
+ providerId?: string
3319
+ billingPeriod?: "weekly" | "monthly" | "every_quarter" | "every_6_months" | "yearly" | "one_time"
3320
+ referenceDate?: string // date
3321
+ }
4488
3322
  _meta?: {
4489
3323
  signature: string
4490
3324
  timestamp: number
@@ -4654,7 +3488,6 @@ type CatalogSearchResult = {
4654
3488
  price_options?: {
4655
3489
  $relation?: { ... }
4656
3490
  }
4657
- is_conditional?: boolean
4658
3491
  _availability_files?: Array<{
4659
3492
  _id: { ... }
4660
3493
  filename: { ... }
@@ -4699,7 +3532,6 @@ type CatalogSearchResult = {
4699
3532
  fixed_value_currency?: string
4700
3533
  cashback_period?: "0" | "12"
4701
3534
  active?: boolean
4702
- is_conditional?: boolean
4703
3535
  requires_promo_code?: boolean
4704
3536
  }>
4705
3537
  }
@@ -4841,6 +3673,7 @@ type ComputePriceParamsBase = {
4841
3673
  association_id?: string
4842
3674
  billing_period?: "weekly" | "monthly" | "every_quarter" | "every_6_months" | "yearly" | "one_time"
4843
3675
  reference_date?: string // date
3676
+ city?: string
4844
3677
  }
4845
3678
  ```
4846
3679
 
@@ -4856,6 +3689,7 @@ type ComputePriceParamsPower = {
4856
3689
  association_id?: string
4857
3690
  billing_period?: "weekly" | "monthly" | "every_quarter" | "every_6_months" | "yearly" | "one_time"
4858
3691
  reference_date?: string // date
3692
+ city?: string
4859
3693
  type: "power"
4860
3694
  meter_type?: "classic" | "smart" | "digital"
4861
3695
  }
@@ -4873,6 +3707,7 @@ type ComputePriceParamsGas = {
4873
3707
  association_id?: string
4874
3708
  billing_period?: "weekly" | "monthly" | "every_quarter" | "every_6_months" | "yearly" | "one_time"
4875
3709
  reference_date?: string // date
3710
+ city?: string
4876
3711
  type: "gas"
4877
3712
  concession_type?: "standard" | "special"
4878
3713
  }
@@ -4916,6 +3751,7 @@ type ComputePriceParams = {
4916
3751
  association_id?: string
4917
3752
  billing_period?: "weekly" | "monthly" | "every_quarter" | "every_6_months" | "yearly" | "one_time"
4918
3753
  reference_date?: string // date
3754
+ city?: string
4919
3755
  type: "power"
4920
3756
  meter_type?: "classic" | "smart" | "digital"
4921
3757
  } | {
@@ -4927,6 +3763,7 @@ type ComputePriceParams = {
4927
3763
  association_id?: string
4928
3764
  billing_period?: "weekly" | "monthly" | "every_quarter" | "every_6_months" | "yearly" | "one_time"
4929
3765
  reference_date?: string // date
3766
+ city?: string
4930
3767
  type: "gas"
4931
3768
  concession_type?: "standard" | "special"
4932
3769
  }
@@ -5054,6 +3891,17 @@ type ComputePriceResult = {
5054
3891
  unit_amount_decimal?: { ... }
5055
3892
  }>
5056
3893
  }
3894
+ inputs?: {
3895
+ type?: "power" | "gas"
3896
+ consumptionHT?: number
3897
+ consumptionNT?: number
3898
+ consumptionType?: "household" | "heating_pump" | "night_storage_heating" | "night_storage_heating_common_meter"
3899
+ zipCode?: string
3900
+ city?: string
3901
+ providerId?: string
3902
+ billingPeriod?: "weekly" | "monthly" | "every_quarter" | "every_6_months" | "yearly" | "one_time"
3903
+ referenceDate?: string // date
3904
+ }
5057
3905
  _meta?: {
5058
3906
  signature: string
5059
3907
  timestamp: number
@@ -5061,6 +3909,24 @@ type ComputePriceResult = {
5061
3909
  }
5062
3910
  ```
5063
3911
 
3912
+ ### `ComputePriceInputs`
3913
+
3914
+ Echo of the request parameters used to compute the price, in the caller-facing shape.
3915
+
3916
+ ```ts
3917
+ type ComputePriceInputs = {
3918
+ type?: "power" | "gas"
3919
+ consumptionHT?: number
3920
+ consumptionNT?: number
3921
+ consumptionType?: "household" | "heating_pump" | "night_storage_heating" | "night_storage_heating_common_meter"
3922
+ zipCode?: string
3923
+ city?: string
3924
+ providerId?: string
3925
+ billingPeriod?: "weekly" | "monthly" | "every_quarter" | "every_6_months" | "yearly" | "one_time"
3926
+ referenceDate?: string // date
3927
+ }
3928
+ ```
3929
+
5064
3930
  ### `SpotMarketBiddingZone`
5065
3931
 
5066
3932
  The bidding zone for a spot market price.
@@ -5505,6 +4371,7 @@ type CartDto = {
5505
4371
  currency: { ... }
5506
4372
  billing_period: { ... }
5507
4373
  breakdown: { ... }
4374
+ inputs?: { ... }
5508
4375
  _meta?: { ... }
5509
4376
  }
5510
4377
  external_location_metadata?: {
@@ -5516,7 +4383,6 @@ type CartDto = {
5516
4383
  }
5517
4384
  external_price_metadata?: {
5518
4385
  market: { ... }
5519
- bidding_zone: { ... }
5520
4386
  // ...
5521
4387
  }
5522
4388
  ```
@@ -5828,7 +4694,6 @@ type BasePriceItemCommon = {
5828
4694
  price_options?: {
5829
4695
  $relation?: { ... }
5830
4696
  }
5831
- is_conditional?: boolean
5832
4697
  _availability_files?: Array<{
5833
4698
  _id: { ... }
5834
4699
  filename: { ... }
@@ -5881,6 +4746,17 @@ type PriceItemDtoUnion = {
5881
4746
  variable_ht?: { ... }
5882
4747
  variable_nt?: { ... }
5883
4748
  }
4749
+ inputs?: {
4750
+ type?: { ... }
4751
+ consumptionHT?: { ... }
4752
+ consumptionNT?: { ... }
4753
+ consumptionType?: { ... }
4754
+ zipCode?: { ... }
4755
+ city?: { ... }
4756
+ providerId?: { ... }
4757
+ billingPeriod?: { ... }
4758
+ referenceDate?: { ... }
4759
+ }
5884
4760
  _meta?: {
5885
4761
  signature: { ... }
5886
4762
  timestamp: { ... }
@@ -5942,17 +4818,6 @@ type PriceItemDtoUnion = {
5942
4818
  amount_total?: number
5943
4819
  unit_amount_gross?: number
5944
4820
  unit_amount_net?: number
5945
- amount_tax?: number
5946
- total_details?: {
5947
- amount_shipping?: { ... }
5948
- amount_tax?: { ... }
5949
- breakdown?: { ... }
5950
- }
5951
- currency?: string
5952
- redeemed_promos?: Array<{
5953
- code: { ... }
5954
- coupons: { ... }
5955
- }>
5956
4821
  // ...
5957
4822
  }
5958
4823
  ```
@@ -5990,6 +4855,17 @@ type PriceItemsDto = Array<{
5990
4855
  variable_ht?: { ... }
5991
4856
  variable_nt?: { ... }
5992
4857
  }
4858
+ inputs?: {
4859
+ type?: { ... }
4860
+ consumptionHT?: { ... }
4861
+ consumptionNT?: { ... }
4862
+ consumptionType?: { ... }
4863
+ zipCode?: { ... }
4864
+ city?: { ... }
4865
+ providerId?: { ... }
4866
+ billingPeriod?: { ... }
4867
+ referenceDate?: { ... }
4868
+ }
5993
4869
  _meta?: {
5994
4870
  signature: { ... }
5995
4871
  timestamp: { ... }
@@ -6051,17 +4927,6 @@ type PriceItemsDto = Array<{
6051
4927
  amount_total?: number
6052
4928
  unit_amount_gross?: number
6053
4929
  unit_amount_net?: number
6054
- amount_tax?: number
6055
- total_details?: {
6056
- amount_shipping?: { ... }
6057
- amount_tax?: { ... }
6058
- breakdown?: { ... }
6059
- }
6060
- currency?: string
6061
- redeemed_promos?: Array<{
6062
- code: { ... }
6063
- coupons: { ... }
6064
- }>
6065
4930
  // ...
6066
4931
  }
6067
4932
  ```
@@ -6134,7 +4999,6 @@ type BasePriceItemDto = {
6134
4999
  price_options?: {
6135
5000
  $relation?: { ... }
6136
5001
  }
6137
- is_conditional?: boolean
6138
5002
  _availability_files?: Array<{
6139
5003
  _id: { ... }
6140
5004
  filename: { ... }
@@ -6189,6 +5053,17 @@ type PriceItemDto = {
6189
5053
  variable_ht?: { ... }
6190
5054
  variable_nt?: { ... }
6191
5055
  }
5056
+ inputs?: {
5057
+ type?: { ... }
5058
+ consumptionHT?: { ... }
5059
+ consumptionNT?: { ... }
5060
+ consumptionType?: { ... }
5061
+ zipCode?: { ... }
5062
+ city?: { ... }
5063
+ providerId?: { ... }
5064
+ billingPeriod?: { ... }
5065
+ referenceDate?: { ... }
5066
+ }
6192
5067
  _meta?: {
6193
5068
  signature: { ... }
6194
5069
  timestamp: { ... }
@@ -6250,17 +5125,6 @@ type PriceItemDto = {
6250
5125
  amount_total?: number
6251
5126
  unit_amount_gross?: number
6252
5127
  unit_amount_net?: number
6253
- amount_tax?: number
6254
- total_details?: {
6255
- amount_shipping?: { ... }
6256
- amount_tax?: { ... }
6257
- breakdown?: { ... }
6258
- }
6259
- currency?: string
6260
- redeemed_promos?: Array<{
6261
- code: { ... }
6262
- coupons: { ... }
6263
- }>
6264
5128
  // ...
6265
5129
  }
6266
5130
  ```
@@ -6298,6 +5162,17 @@ type CompositePriceItemDto = {
6298
5162
  variable_ht?: { ... }
6299
5163
  variable_nt?: { ... }
6300
5164
  }
5165
+ inputs?: {
5166
+ type?: { ... }
5167
+ consumptionHT?: { ... }
5168
+ consumptionNT?: { ... }
5169
+ consumptionType?: { ... }
5170
+ zipCode?: { ... }
5171
+ city?: { ... }
5172
+ providerId?: { ... }
5173
+ billingPeriod?: { ... }
5174
+ referenceDate?: { ... }
5175
+ }
6301
5176
  _meta?: {
6302
5177
  signature: { ... }
6303
5178
  timestamp: { ... }
@@ -6359,17 +5234,6 @@ type CompositePriceItemDto = {
6359
5234
  amount_total?: number
6360
5235
  unit_amount_gross?: number
6361
5236
  unit_amount_net?: number
6362
- amount_tax?: number
6363
- total_details?: {
6364
- amount_shipping?: { ... }
6365
- amount_tax?: { ... }
6366
- breakdown?: { ... }
6367
- }
6368
- currency?: string
6369
- redeemed_promos?: Array<{
6370
- code: { ... }
6371
- coupons: { ... }
6372
- }>
6373
5237
  // ...
6374
5238
  }
6375
5239
  ```
@@ -6501,6 +5365,7 @@ type OrderPayload = {
6501
5365
  currency: { ... }
6502
5366
  billing_period: { ... }
6503
5367
  breakdown: { ... }
5368
+ inputs?: { ... }
6504
5369
  _meta?: { ... }
6505
5370
  }
6506
5371
  external_location_metadata?: {
@@ -6568,7 +5433,6 @@ type OrderPayload = {
6568
5433
  fixed_value_currency?: { ... }
6569
5434
  cashback_period?: { ... }
6570
5435
  active?: { ... }
6571
- is_conditional?: { ... }
6572
5436
  requires_promo_code?: { ... }
6573
5437
  }>
6574
5438
  type?: "one_time" | "recurring"
@@ -6648,7 +5512,6 @@ type PriceItems = Array<{
6648
5512
  price_options?: {
6649
5513
  $relation?: { ... }
6650
5514
  }
6651
- is_conditional?: boolean
6652
5515
  _availability_files?: Array<{
6653
5516
  _id: { ... }
6654
5517
  filename: { ... }
@@ -6685,6 +5548,7 @@ type PriceItems = Array<{
6685
5548
  value?: number
6686
5549
  metadata?: Record<string, string>
6687
5550
  }>
5551
+ is_tax_inclusive?: boolean
6688
5552
  // ...
6689
5553
  }
6690
5554
  ```
@@ -6757,7 +5621,6 @@ type CompositePriceItem = {
6757
5621
  price_options?: {
6758
5622
  $relation?: { ... }
6759
5623
  }
6760
- is_conditional?: boolean
6761
5624
  _availability_files?: Array<{
6762
5625
  _id: { ... }
6763
5626
  filename: { ... }
@@ -6847,7 +5710,6 @@ type BasePriceItem = {
6847
5710
  price_options?: {
6848
5711
  $relation?: { ... }
6849
5712
  }
6850
- is_conditional?: boolean
6851
5713
  _availability_files?: Array<{
6852
5714
  _id: { ... }
6853
5715
  filename: { ... }
@@ -6997,7 +5859,6 @@ type PriceItem = {
6997
5859
  price_options?: {
6998
5860
  $relation?: { ... }
6999
5861
  }
7000
- is_conditional?: boolean
7001
5862
  _availability_files?: Array<{
7002
5863
  _id: { ... }
7003
5864
  filename: { ... }
@@ -7214,7 +6075,6 @@ type PricingDetails = {
7214
6075
  product_images?: { ... }
7215
6076
  product_downloads?: { ... }
7216
6077
  price_options?: { ... }
7217
- is_conditional?: { ... }
7218
6078
  _availability_files?: { ... }
7219
6079
  _id?: { ... }
7220
6080
  _title?: { ... }
@@ -7252,7 +6112,6 @@ type PricingDetails = {
7252
6112
  product_images?: { ... }
7253
6113
  product_downloads?: { ... }
7254
6114
  price_options?: { ... }
7255
- is_conditional?: { ... }
7256
6115
  _availability_files?: { ... }
7257
6116
  _id?: { ... }
7258
6117
  _title?: { ... }
@@ -7283,6 +6142,8 @@ type PricingDetails = {
7283
6142
  _id: { ... }
7284
6143
  _title: { ... }
7285
6144
  _org: { ... }
6145
+ _schema: { ... }
6146
+ _tags?: { ... }
7286
6147
  // ...
7287
6148
  }
7288
6149
  ```
@@ -7311,7 +6172,6 @@ type PromoCodeValidationResponse = {
7311
6172
  fixed_value_currency?: string
7312
6173
  cashback_period?: "0" | "12"
7313
6174
  active?: boolean
7314
- is_conditional?: boolean
7315
6175
  requires_promo_code?: boolean
7316
6176
  }>
7317
6177
  }
@@ -7353,7 +6213,6 @@ type PricingDetailsResponse = {
7353
6213
  product_images?: { ... }
7354
6214
  product_downloads?: { ... }
7355
6215
  price_options?: { ... }
7356
- is_conditional?: { ... }
7357
6216
  _availability_files?: { ... }
7358
6217
  _id?: { ... }
7359
6218
  _title?: { ... }
@@ -7391,7 +6250,6 @@ type PricingDetailsResponse = {
7391
6250
  product_images?: { ... }
7392
6251
  product_downloads?: { ... }
7393
6252
  price_options?: { ... }
7394
- is_conditional?: { ... }
7395
6253
  _availability_files?: { ... }
7396
6254
  _id?: { ... }
7397
6255
  _title?: { ... }
@@ -7422,6 +6280,8 @@ type PricingDetailsResponse = {
7422
6280
  _id: { ... }
7423
6281
  _title: { ... }
7424
6282
  _org: { ... }
6283
+ _schema: { ... }
6284
+ _tags?: { ... }
7425
6285
  // ...
7426
6286
  }
7427
6287
  ```
@@ -7644,7 +6504,6 @@ type BaseCouponCommon = {
7644
6504
  fixed_value_currency?: string
7645
6505
  cashback_period?: "0" | "12"
7646
6506
  active?: boolean
7647
- is_conditional?: boolean
7648
6507
  requires_promo_code?: boolean
7649
6508
  }
7650
6509
  ```
@@ -7672,7 +6531,6 @@ type CouponWithoutPromoCodes = {
7672
6531
  fixed_value_currency?: string
7673
6532
  cashback_period?: "0" | "12"
7674
6533
  active?: boolean
7675
- is_conditional?: boolean
7676
6534
  requires_promo_code?: boolean
7677
6535
  }
7678
6536
  ```
@@ -7700,7 +6558,6 @@ type Coupon = {
7700
6558
  fixed_value_currency?: string
7701
6559
  cashback_period?: "0" | "12"
7702
6560
  active?: boolean
7703
- is_conditional?: boolean
7704
6561
  requires_promo_code?: boolean
7705
6562
  }
7706
6563
  ```
@@ -7726,7 +6583,6 @@ type CouponItem = {
7726
6583
  fixed_value_currency?: string
7727
6584
  cashback_period?: "0" | "12"
7728
6585
  active?: boolean
7729
- is_conditional?: boolean
7730
6586
  requires_promo_code?: boolean
7731
6587
  }
7732
6588
  ```
@@ -7765,7 +6621,6 @@ type RedeemedPromo = {
7765
6621
  fixed_value_currency?: string
7766
6622
  cashback_period?: "0" | "12"
7767
6623
  active?: boolean
7768
- is_conditional?: boolean
7769
6624
  requires_promo_code?: boolean
7770
6625
  }>
7771
6626
  }
@@ -8235,6 +7090,31 @@ type ProductRecommendationResponse = {
8235
7090
  _created_at: string // date-time
8236
7091
  _updated_at: string // date-time
8237
7092
  }>
7093
+ source?: {
7094
+ item?: {
7095
+ metadata?: { ... }
7096
+ quantity?: { ... }
7097
+ product_id?: { ... }
7098
+ price_id?: { ... }
7099
+ description?: { ... }
7100
+ product_description?: { ... }
7101
+ product_name?: { ... }
7102
+ price_mappings?: { ... }
7103
+ is_tax_inclusive?: { ... }
7104
+ _product?: { ... }
7105
+ } | {
7106
+ metadata?: { ... }
7107
+ quantity?: { ... }
7108
+ product_id?: { ... }
7109
+ price_id?: { ... }
7110
+ description?: { ... }
7111
+ product_description?: { ... }
7112
+ product_name?: { ... }
7113
+ price_mappings?: { ... }
7114
+ is_tax_inclusive?: { ... }
7115
+ _product?: { ... }
7116
+ }
7117
+ }
8238
7118
  }
8239
7119
  ```
8240
7120