askell-mcp 0.4.12 → 0.4.14

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.
@@ -58,7 +58,11 @@
58
58
  },
59
59
  {
60
60
  "name": "V2 Fulfillment",
61
- "description": "Subscription V2 fulfillment order read APIs for warehouse integrations, requires secret api key."
61
+ "description": "Subscription V2 fulfillment order APIs for warehouse integrations: read the orders, and report back when your own system has shipped or cancelled one. Requires secret api key."
62
+ },
63
+ {
64
+ "name": "V2 Coupons",
65
+ "description": "Coupon and promotion code management APIs, requires secret api key."
62
66
  }
63
67
  ],
64
68
  "paths": {
@@ -1789,165 +1793,633 @@
1789
1793
  }
1790
1794
  ]
1791
1795
  }
1792
- }
1793
- },
1794
- "components": {
1795
- "schemas": {
1796
- "V2ValidationError": {
1797
- "type": "object",
1798
- "additionalProperties": true,
1799
- "example": {
1800
- "non_field_errors": "Provide exactly one input mode: `bundle_template` or `items`."
1801
- }
1802
- },
1803
- "V2Metadata": {
1804
- "type": "object",
1805
- "additionalProperties": true
1806
- },
1807
- "V2BillingScheduleRule": {
1808
- "type": "object",
1809
- "properties": {
1810
- "month": {
1811
- "type": "integer",
1812
- "nullable": true
1813
- },
1814
- "day": {
1815
- "type": "integer",
1816
- "nullable": true
1817
- },
1818
- "label": {
1819
- "type": "string",
1820
- "nullable": true
1821
- },
1822
- "display_order": {
1823
- "type": "integer"
1796
+ },
1797
+ "/v2/fulfillment-orders/{fulfillmentOrderId}/fulfill/": {
1798
+ "post": {
1799
+ "tags": [
1800
+ "V2 Fulfillment"
1801
+ ],
1802
+ "summary": "Report a fulfillment order as shipped",
1803
+ "description": "Records a shipment your own system made and completes the order: every line is marked fulfilled, the order moves to `fulfilled`, the customer is sent the shipped notification and the `fulfillment_order.fulfilled` webhook fires, exactly as when an order is fulfilled from the dashboard. The body is optional — a seller who delivers by hand has no tracking details to report. Idempotent: an order that is already fulfilled comes back unchanged with `200` and nothing is created, emailed or dispatched again. Available whether the account fulfills in Áskell or in an external system, but not while fulfillment is switched off for the account. Requires a secret key.",
1804
+ "parameters": [
1805
+ {
1806
+ "$ref": "#/components/parameters/V2FulfillmentOrderId"
1824
1807
  }
1825
- }
1826
- },
1827
- "V2CatalogPrice": {
1828
- "type": "object",
1829
- "properties": {
1830
- "id": {
1831
- "type": "integer"
1832
- },
1833
- "product_id": {
1834
- "type": "integer"
1835
- },
1836
- "product_name": {
1837
- "type": "string"
1838
- },
1839
- "product_reference": {
1840
- "type": "string",
1841
- "nullable": true
1842
- },
1843
- "currency": {
1844
- "type": "string",
1845
- "example": "ISK"
1846
- },
1847
- "unit_amount": {
1848
- "type": "string",
1849
- "format": "decimal",
1850
- "example": "1990.0000"
1851
- },
1852
- "billing_type": {
1853
- "type": "string",
1854
- "enum": [
1855
- "recurring",
1856
- "one_time"
1857
- ]
1858
- },
1859
- "recurrence_type": {
1860
- "type": "string",
1861
- "nullable": true
1808
+ ],
1809
+ "requestBody": {
1810
+ "content": {
1811
+ "application/json": {
1812
+ "schema": {
1813
+ "$ref": "#/components/schemas/V2FulfillmentOrderFulfill"
1814
+ }
1815
+ }
1862
1816
  },
1863
- "interval": {
1864
- "type": "string",
1865
- "nullable": true
1817
+ "required": false
1818
+ },
1819
+ "responses": {
1820
+ "200": {
1821
+ "$ref": "#/components/responses/V2FulfillmentOrder"
1866
1822
  },
1867
- "interval_count": {
1868
- "type": "integer",
1869
- "nullable": true
1823
+ "400": {
1824
+ "$ref": "#/components/responses/V2ValidationError"
1870
1825
  },
1871
- "billing_day_of_month": {
1872
- "type": "integer",
1873
- "nullable": true
1826
+ "403": {
1827
+ "$ref": "#/components/responses/V2PermissionDenied"
1874
1828
  },
1875
- "billing_schedule_id": {
1876
- "type": "integer",
1877
- "nullable": true
1829
+ "404": {
1830
+ "$ref": "#/components/responses/V2NotFound"
1878
1831
  },
1879
- "billing_schedule_name": {
1880
- "type": "string",
1881
- "nullable": true
1832
+ "409": {
1833
+ "$ref": "#/components/responses/V2FulfillmentOrderConflict"
1834
+ }
1835
+ },
1836
+ "security": [
1837
+ {
1838
+ "Secret-Api-Key": []
1839
+ }
1840
+ ]
1841
+ }
1842
+ },
1843
+ "/v2/fulfillment-orders/{fulfillmentOrderId}/cancel/": {
1844
+ "post": {
1845
+ "tags": [
1846
+ "V2 Fulfillment"
1847
+ ],
1848
+ "summary": "Cancel a fulfillment order",
1849
+ "description": "Cancels an order that is not going to be shipped. A booking that has not left the provider's hands is retired on the Áskell side and flagged for you to cancel with the carrier itself. Takes no body. Idempotent: an order that is already cancelled comes back with `200` and the `fulfillment_order.cancelled` webhook is not sent again. Requires a secret key and that fulfillment is enabled for the account.",
1850
+ "parameters": [
1851
+ {
1852
+ "$ref": "#/components/parameters/V2FulfillmentOrderId"
1853
+ }
1854
+ ],
1855
+ "responses": {
1856
+ "200": {
1857
+ "$ref": "#/components/responses/V2FulfillmentOrder"
1882
1858
  },
1883
- "billing_schedule_timezone": {
1884
- "type": "string",
1885
- "nullable": true
1859
+ "403": {
1860
+ "$ref": "#/components/responses/V2PermissionDenied"
1886
1861
  },
1887
- "billing_schedule_rules": {
1888
- "type": "array",
1889
- "items": {
1890
- "$ref": "#/components/schemas/V2BillingScheduleRule"
1891
- }
1862
+ "404": {
1863
+ "$ref": "#/components/responses/V2NotFound"
1892
1864
  },
1893
- "next_occurrences": {
1894
- "type": "array",
1895
- "items": {
1865
+ "409": {
1866
+ "$ref": "#/components/responses/V2FulfillmentOrderConflict"
1867
+ }
1868
+ },
1869
+ "security": [
1870
+ {
1871
+ "Secret-Api-Key": []
1872
+ }
1873
+ ]
1874
+ }
1875
+ },
1876
+ "/v2/coupons/": {
1877
+ "get": {
1878
+ "tags": [
1879
+ "V2 Coupons"
1880
+ ],
1881
+ "summary": "List V2 coupons",
1882
+ "description": "Lists coupons for the authenticated account. Soft-deleted resources are never returned. Requires a secret key.",
1883
+ "parameters": [
1884
+ {
1885
+ "in": "query",
1886
+ "name": "valid",
1887
+ "schema": {
1896
1888
  "type": "string",
1897
- "format": "date-time"
1898
- }
1899
- },
1900
- "active": {
1901
- "type": "boolean"
1902
- },
1903
- "currently_effective": {
1904
- "type": "boolean"
1889
+ "enum": [
1890
+ "true",
1891
+ "false"
1892
+ ]
1893
+ },
1894
+ "description": "Filter by whether the coupon can currently be redeemed (live, not expired, redemptions left)."
1905
1895
  },
1906
- "effective_from": {
1907
- "type": "string",
1908
- "format": "date-time",
1909
- "nullable": true
1896
+ {
1897
+ "in": "query",
1898
+ "name": "duration",
1899
+ "schema": {
1900
+ "type": "string",
1901
+ "enum": [
1902
+ "forever",
1903
+ "once",
1904
+ "repeating"
1905
+ ]
1906
+ },
1907
+ "description": "Filter by duration."
1910
1908
  },
1911
- "effective_to": {
1912
- "type": "string",
1913
- "format": "date-time",
1914
- "nullable": true
1909
+ {
1910
+ "in": "query",
1911
+ "name": "currency",
1912
+ "schema": {
1913
+ "type": "string"
1914
+ },
1915
+ "description": "Filter amount-off coupons by three-letter ISO currency code."
1915
1916
  },
1916
- "metadata": {
1917
- "$ref": "#/components/schemas/V2Metadata"
1917
+ {
1918
+ "in": "query",
1919
+ "name": "name",
1920
+ "schema": {
1921
+ "type": "string"
1922
+ },
1923
+ "description": "Case-insensitive substring match on the coupon name."
1918
1924
  },
1919
- "created_at": {
1920
- "type": "string",
1921
- "format": "date-time"
1925
+ {
1926
+ "$ref": "#/components/parameters/PageSizeFilter"
1927
+ }
1928
+ ],
1929
+ "responses": {
1930
+ "200": {
1931
+ "$ref": "#/components/responses/V2CouponList"
1922
1932
  },
1923
- "updated_at": {
1924
- "type": "string",
1925
- "format": "date-time"
1933
+ "400": {
1934
+ "$ref": "#/components/responses/V2ValidationError"
1926
1935
  }
1927
- }
1936
+ },
1937
+ "security": [
1938
+ {
1939
+ "Secret-Api-Key": []
1940
+ }
1941
+ ]
1928
1942
  },
1929
- "V2CatalogProduct": {
1930
- "type": "object",
1931
- "properties": {
1932
- "id": {
1933
- "type": "integer"
1934
- },
1935
- "name": {
1936
- "type": "string"
1937
- },
1938
- "description": {
1939
- "type": "string",
1940
- "nullable": true
1941
- },
1942
- "reference": {
1943
- "type": "string",
1944
- "nullable": true
1943
+ "post": {
1944
+ "tags": [
1945
+ "V2 Coupons"
1946
+ ],
1947
+ "summary": "Create a V2 coupon",
1948
+ "description": "Creates a coupon. Exactly one of `amount_off` (with `currency`) or `percent_off` must be set. `duration_in_months` is required when `duration` is `repeating` and must be omitted otherwise. `redeem_by` must be in the future. Requires a secret key.",
1949
+ "requestBody": {
1950
+ "content": {
1951
+ "application/json": {
1952
+ "schema": {
1953
+ "$ref": "#/components/schemas/V2CouponCreate"
1954
+ }
1955
+ }
1945
1956
  },
1946
- "image_url": {
1947
- "type": "string",
1948
- "nullable": true
1957
+ "required": true
1958
+ },
1959
+ "responses": {
1960
+ "201": {
1961
+ "$ref": "#/components/responses/V2Coupon"
1949
1962
  },
1950
- "active": {
1963
+ "400": {
1964
+ "$ref": "#/components/responses/V2ValidationError"
1965
+ }
1966
+ },
1967
+ "security": [
1968
+ {
1969
+ "Secret-Api-Key": []
1970
+ }
1971
+ ]
1972
+ }
1973
+ },
1974
+ "/v2/coupons/{couponId}/": {
1975
+ "get": {
1976
+ "tags": [
1977
+ "V2 Coupons"
1978
+ ],
1979
+ "summary": "Get a V2 coupon",
1980
+ "description": "Returns a single coupon for the authenticated account. Requires a secret key.",
1981
+ "parameters": [
1982
+ {
1983
+ "$ref": "#/components/parameters/V2CouponId"
1984
+ }
1985
+ ],
1986
+ "responses": {
1987
+ "200": {
1988
+ "$ref": "#/components/responses/V2Coupon"
1989
+ },
1990
+ "404": {
1991
+ "$ref": "#/components/responses/V2NotFound"
1992
+ }
1993
+ },
1994
+ "security": [
1995
+ {
1996
+ "Secret-Api-Key": []
1997
+ }
1998
+ ]
1999
+ },
2000
+ "patch": {
2001
+ "tags": [
2002
+ "V2 Coupons"
2003
+ ],
2004
+ "summary": "Update a V2 coupon",
2005
+ "description": "Partially updates a coupon. To switch from `percent_off` to `amount_off` (or back) send the old field as `null` in the same request. `id` and `times_redeemed` cannot be changed. Requires a secret key.",
2006
+ "parameters": [
2007
+ {
2008
+ "$ref": "#/components/parameters/V2CouponId"
2009
+ }
2010
+ ],
2011
+ "requestBody": {
2012
+ "content": {
2013
+ "application/json": {
2014
+ "schema": {
2015
+ "$ref": "#/components/schemas/V2CouponPatch"
2016
+ }
2017
+ }
2018
+ },
2019
+ "required": true
2020
+ },
2021
+ "responses": {
2022
+ "200": {
2023
+ "$ref": "#/components/responses/V2Coupon"
2024
+ },
2025
+ "400": {
2026
+ "$ref": "#/components/responses/V2ValidationError"
2027
+ },
2028
+ "404": {
2029
+ "$ref": "#/components/responses/V2NotFound"
2030
+ }
2031
+ },
2032
+ "security": [
2033
+ {
2034
+ "Secret-Api-Key": []
2035
+ }
2036
+ ]
2037
+ },
2038
+ "delete": {
2039
+ "tags": [
2040
+ "V2 Coupons"
2041
+ ],
2042
+ "summary": "Delete a V2 coupon",
2043
+ "description": "Soft-deletes a coupon so it can no longer be redeemed and is hidden from list and detail responses. Coupons that have already been redeemed cannot be deleted; retire them with `redeem_by` or `max_redemptions` instead. Requires a secret key.",
2044
+ "parameters": [
2045
+ {
2046
+ "$ref": "#/components/parameters/V2CouponId"
2047
+ }
2048
+ ],
2049
+ "responses": {
2050
+ "204": {
2051
+ "description": "Deleted"
2052
+ },
2053
+ "400": {
2054
+ "$ref": "#/components/responses/V2ValidationError"
2055
+ },
2056
+ "404": {
2057
+ "$ref": "#/components/responses/V2NotFound"
2058
+ }
2059
+ },
2060
+ "security": [
2061
+ {
2062
+ "Secret-Api-Key": []
2063
+ }
2064
+ ]
2065
+ }
2066
+ },
2067
+ "/v2/promotion-codes/": {
2068
+ "get": {
2069
+ "tags": [
2070
+ "V2 Coupons"
2071
+ ],
2072
+ "summary": "List V2 promotion codes",
2073
+ "description": "Lists promotion codes for the authenticated account. Soft-deleted resources are never returned. Requires a secret key.",
2074
+ "parameters": [
2075
+ {
2076
+ "in": "query",
2077
+ "name": "code",
2078
+ "schema": {
2079
+ "type": "string"
2080
+ },
2081
+ "description": "Exact, case-insensitive match on the customer-facing code."
2082
+ },
2083
+ {
2084
+ "in": "query",
2085
+ "name": "coupon",
2086
+ "schema": {
2087
+ "type": "string"
2088
+ },
2089
+ "description": "Filter by coupon id."
2090
+ },
2091
+ {
2092
+ "in": "query",
2093
+ "name": "active",
2094
+ "schema": {
2095
+ "type": "string",
2096
+ "enum": [
2097
+ "true",
2098
+ "false"
2099
+ ]
2100
+ },
2101
+ "description": "Filter by the active flag."
2102
+ },
2103
+ {
2104
+ "in": "query",
2105
+ "name": "valid",
2106
+ "schema": {
2107
+ "type": "string",
2108
+ "enum": [
2109
+ "true",
2110
+ "false"
2111
+ ]
2112
+ },
2113
+ "description": "Filter by whether the code can currently be redeemed (active, not expired, redemptions left, and coupon valid)."
2114
+ },
2115
+ {
2116
+ "in": "query",
2117
+ "name": "customer_reference",
2118
+ "schema": {
2119
+ "type": "string"
2120
+ },
2121
+ "description": "Filter codes restricted to the customer with this reference."
2122
+ },
2123
+ {
2124
+ "$ref": "#/components/parameters/PageSizeFilter"
2125
+ }
2126
+ ],
2127
+ "responses": {
2128
+ "200": {
2129
+ "$ref": "#/components/responses/V2PromotionCodeList"
2130
+ },
2131
+ "400": {
2132
+ "$ref": "#/components/responses/V2ValidationError"
2133
+ }
2134
+ },
2135
+ "security": [
2136
+ {
2137
+ "Secret-Api-Key": []
2138
+ }
2139
+ ]
2140
+ },
2141
+ "post": {
2142
+ "tags": [
2143
+ "V2 Coupons"
2144
+ ],
2145
+ "summary": "Create a V2 promotion code",
2146
+ "description": "Creates a promotion code for a coupon owned by the authenticated account. `code` is normalised to upper case and generated when omitted; it must be unique among active codes for the account. Restrict the code to one customer with either `customer` (id) or `customer_reference`. Requires a secret key.",
2147
+ "requestBody": {
2148
+ "content": {
2149
+ "application/json": {
2150
+ "schema": {
2151
+ "$ref": "#/components/schemas/V2PromotionCodeCreate"
2152
+ }
2153
+ }
2154
+ },
2155
+ "required": true
2156
+ },
2157
+ "responses": {
2158
+ "201": {
2159
+ "$ref": "#/components/responses/V2PromotionCode"
2160
+ },
2161
+ "400": {
2162
+ "$ref": "#/components/responses/V2ValidationError"
2163
+ }
2164
+ },
2165
+ "security": [
2166
+ {
2167
+ "Secret-Api-Key": []
2168
+ }
2169
+ ]
2170
+ }
2171
+ },
2172
+ "/v2/promotion-codes/{promotionCodeId}/": {
2173
+ "get": {
2174
+ "tags": [
2175
+ "V2 Coupons"
2176
+ ],
2177
+ "summary": "Get a V2 promotion code",
2178
+ "description": "Returns a single promotion code for the authenticated account. Requires a secret key.",
2179
+ "parameters": [
2180
+ {
2181
+ "$ref": "#/components/parameters/V2PromotionCodeId"
2182
+ }
2183
+ ],
2184
+ "responses": {
2185
+ "200": {
2186
+ "$ref": "#/components/responses/V2PromotionCode"
2187
+ },
2188
+ "404": {
2189
+ "$ref": "#/components/responses/V2NotFound"
2190
+ }
2191
+ },
2192
+ "security": [
2193
+ {
2194
+ "Secret-Api-Key": []
2195
+ }
2196
+ ]
2197
+ },
2198
+ "patch": {
2199
+ "tags": [
2200
+ "V2 Coupons"
2201
+ ],
2202
+ "summary": "Update a V2 promotion code",
2203
+ "description": "Partially updates a promotion code. Send `customer` or `customer_reference` as `null` to remove a customer restriction. Set `active` to `false` to retire a code without deleting it; the code can then be reused by a new promotion code. `id` and `times_redeemed` cannot be changed. Requires a secret key.",
2204
+ "parameters": [
2205
+ {
2206
+ "$ref": "#/components/parameters/V2PromotionCodeId"
2207
+ }
2208
+ ],
2209
+ "requestBody": {
2210
+ "content": {
2211
+ "application/json": {
2212
+ "schema": {
2213
+ "$ref": "#/components/schemas/V2PromotionCodePatch"
2214
+ }
2215
+ }
2216
+ },
2217
+ "required": true
2218
+ },
2219
+ "responses": {
2220
+ "200": {
2221
+ "$ref": "#/components/responses/V2PromotionCode"
2222
+ },
2223
+ "400": {
2224
+ "$ref": "#/components/responses/V2ValidationError"
2225
+ },
2226
+ "404": {
2227
+ "$ref": "#/components/responses/V2NotFound"
2228
+ }
2229
+ },
2230
+ "security": [
2231
+ {
2232
+ "Secret-Api-Key": []
2233
+ }
2234
+ ]
2235
+ },
2236
+ "delete": {
2237
+ "tags": [
2238
+ "V2 Coupons"
2239
+ ],
2240
+ "summary": "Delete a V2 promotion code",
2241
+ "description": "Soft-deletes a promotion code, freeing its code for reuse. Promotion codes that have already been redeemed cannot be deleted; set `active` to `false` instead. Requires a secret key.",
2242
+ "parameters": [
2243
+ {
2244
+ "$ref": "#/components/parameters/V2PromotionCodeId"
2245
+ }
2246
+ ],
2247
+ "responses": {
2248
+ "204": {
2249
+ "description": "Deleted"
2250
+ },
2251
+ "400": {
2252
+ "$ref": "#/components/responses/V2ValidationError"
2253
+ },
2254
+ "404": {
2255
+ "$ref": "#/components/responses/V2NotFound"
2256
+ }
2257
+ },
2258
+ "security": [
2259
+ {
2260
+ "Secret-Api-Key": []
2261
+ }
2262
+ ]
2263
+ }
2264
+ }
2265
+ },
2266
+ "components": {
2267
+ "schemas": {
2268
+ "V2ValidationError": {
2269
+ "type": "object",
2270
+ "additionalProperties": true,
2271
+ "example": {
2272
+ "non_field_errors": "Provide exactly one input mode: `bundle_template` or `items`."
2273
+ }
2274
+ },
2275
+ "V2Metadata": {
2276
+ "type": "object",
2277
+ "additionalProperties": true
2278
+ },
2279
+ "V2BillingScheduleRule": {
2280
+ "type": "object",
2281
+ "properties": {
2282
+ "month": {
2283
+ "type": "integer",
2284
+ "nullable": true
2285
+ },
2286
+ "day": {
2287
+ "type": "integer",
2288
+ "nullable": true
2289
+ },
2290
+ "label": {
2291
+ "type": "string",
2292
+ "nullable": true
2293
+ },
2294
+ "display_order": {
2295
+ "type": "integer"
2296
+ }
2297
+ }
2298
+ },
2299
+ "V2CatalogPrice": {
2300
+ "type": "object",
2301
+ "properties": {
2302
+ "id": {
2303
+ "type": "integer"
2304
+ },
2305
+ "product_id": {
2306
+ "type": "integer"
2307
+ },
2308
+ "product_name": {
2309
+ "type": "string"
2310
+ },
2311
+ "product_reference": {
2312
+ "type": "string",
2313
+ "nullable": true
2314
+ },
2315
+ "currency": {
2316
+ "type": "string",
2317
+ "example": "ISK"
2318
+ },
2319
+ "unit_amount": {
2320
+ "type": "string",
2321
+ "format": "decimal",
2322
+ "example": "1990.0000"
2323
+ },
2324
+ "billing_type": {
2325
+ "type": "string",
2326
+ "enum": [
2327
+ "recurring",
2328
+ "one_time"
2329
+ ]
2330
+ },
2331
+ "recurrence_type": {
2332
+ "type": "string",
2333
+ "nullable": true
2334
+ },
2335
+ "interval": {
2336
+ "type": "string",
2337
+ "nullable": true
2338
+ },
2339
+ "interval_count": {
2340
+ "type": "integer",
2341
+ "nullable": true
2342
+ },
2343
+ "billing_day_of_month": {
2344
+ "type": "integer",
2345
+ "nullable": true
2346
+ },
2347
+ "billing_schedule_id": {
2348
+ "type": "integer",
2349
+ "nullable": true
2350
+ },
2351
+ "billing_schedule_name": {
2352
+ "type": "string",
2353
+ "nullable": true
2354
+ },
2355
+ "billing_schedule_timezone": {
2356
+ "type": "string",
2357
+ "nullable": true
2358
+ },
2359
+ "billing_schedule_rules": {
2360
+ "type": "array",
2361
+ "items": {
2362
+ "$ref": "#/components/schemas/V2BillingScheduleRule"
2363
+ }
2364
+ },
2365
+ "next_occurrences": {
2366
+ "type": "array",
2367
+ "items": {
2368
+ "type": "string",
2369
+ "format": "date-time"
2370
+ }
2371
+ },
2372
+ "active": {
2373
+ "type": "boolean"
2374
+ },
2375
+ "currently_effective": {
2376
+ "type": "boolean"
2377
+ },
2378
+ "effective_from": {
2379
+ "type": "string",
2380
+ "format": "date-time",
2381
+ "nullable": true
2382
+ },
2383
+ "effective_to": {
2384
+ "type": "string",
2385
+ "format": "date-time",
2386
+ "nullable": true
2387
+ },
2388
+ "metadata": {
2389
+ "$ref": "#/components/schemas/V2Metadata"
2390
+ },
2391
+ "created_at": {
2392
+ "type": "string",
2393
+ "format": "date-time"
2394
+ },
2395
+ "updated_at": {
2396
+ "type": "string",
2397
+ "format": "date-time"
2398
+ }
2399
+ }
2400
+ },
2401
+ "V2CatalogProduct": {
2402
+ "type": "object",
2403
+ "properties": {
2404
+ "id": {
2405
+ "type": "integer"
2406
+ },
2407
+ "name": {
2408
+ "type": "string"
2409
+ },
2410
+ "description": {
2411
+ "type": "string",
2412
+ "nullable": true
2413
+ },
2414
+ "reference": {
2415
+ "type": "string",
2416
+ "nullable": true
2417
+ },
2418
+ "image_url": {
2419
+ "type": "string",
2420
+ "nullable": true
2421
+ },
2422
+ "active": {
1951
2423
  "type": "boolean"
1952
2424
  },
1953
2425
  "tax_policy": {
@@ -3289,6 +3761,11 @@
3289
3761
  "type": "string",
3290
3762
  "description": "The weight band that priced the selection as `min-max` in grams (`max` empty for an open-ended band), or an empty string for a flat-priced option."
3291
3763
  },
3764
+ "provider_quote": {
3765
+ "type": "object",
3766
+ "description": "The carrier quote that priced the selection, for an option priced by the carrier's own live quote; an empty object for every other option. Keys: `service_id` (the carrier's delivery service, such as `DPP108`), `booked_service_id` (the delivery service the shipment is booked under, which need not be spelled the same as the quoted one, and is empty when the selection has no service code to build it from), `name`, `gross_price` and `net_price` as decimal strings, and `request` with the `country_code`, `zip_code` and `weight_grams` the quote answered.",
3767
+ "additionalProperties": true
3768
+ },
3292
3769
  "location_id": {
3293
3770
  "type": "string"
3294
3771
  },
@@ -4790,6 +5267,44 @@
4790
5267
  }
4791
5268
  }
4792
5269
  },
5270
+ "V2FulfillmentOrderFulfill": {
5271
+ "type": "object",
5272
+ "description": "What an external fulfillment system reports back when it has shipped an order. Every field is optional; an empty object just closes the order.",
5273
+ "properties": {
5274
+ "tracking_number": {
5275
+ "type": "string",
5276
+ "maxLength": 128,
5277
+ "description": "Tracking number for the parcel. Included in the shipped notification sent to the customer.",
5278
+ "example": "PP123456789"
5279
+ },
5280
+ "tracking_url": {
5281
+ "type": "string",
5282
+ "format": "uri",
5283
+ "maxLength": 512,
5284
+ "description": "A URL the shipment can be tracked at. Stored with the shipment and served back as the shipment's `tracking_url`.",
5285
+ "example": "https://posturinn.is/track/PP123456789"
5286
+ },
5287
+ "provider_order_id": {
5288
+ "type": "string",
5289
+ "maxLength": 128,
5290
+ "description": "The carrier's own identifier for the shipment.",
5291
+ "example": "shp_8812"
5292
+ },
5293
+ "carrier": {
5294
+ "type": "string",
5295
+ "maxLength": 64,
5296
+ "description": "The carrier that took the parcel. `dropp` and `posturinn` are recognised and file the shipment under that handler; anything else is kept as free text.",
5297
+ "example": "posturinn"
5298
+ },
5299
+ "weight_grams": {
5300
+ "type": "integer",
5301
+ "minimum": 0,
5302
+ "nullable": true,
5303
+ "description": "Parcel weight in grams.",
5304
+ "example": 1000
5305
+ }
5306
+ }
5307
+ },
4793
5308
  "V2FulfillmentAddress": {
4794
5309
  "type": "object",
4795
5310
  "nullable": true,
@@ -4870,12 +5385,18 @@
4870
5385
  },
4871
5386
  "handler": {
4872
5387
  "type": "string",
5388
+ "description": "The shipping handler the shipment was booked with. Empty when an external fulfillment system shipped the order with a carrier Áskell has no integration for — read `carrier` for the name it reported.",
4873
5389
  "enum": [
4874
5390
  "dropp",
4875
5391
  "posturinn",
4876
- "store_pickup"
5392
+ "store_pickup",
5393
+ ""
4877
5394
  ]
4878
5395
  },
5396
+ "carrier": {
5397
+ "type": "string",
5398
+ "description": "What carried the parcel: the carrier an external system reported, or the handler that booked it. Empty only when neither is known."
5399
+ },
4879
5400
  "status": {
4880
5401
  "type": "string",
4881
5402
  "enum": [
@@ -4894,6 +5415,11 @@
4894
5415
  "tracking_number": {
4895
5416
  "type": "string"
4896
5417
  },
5418
+ "tracking_url": {
5419
+ "type": "string",
5420
+ "format": "uri",
5421
+ "description": "A URL the shipment can be tracked at, as reported through the fulfill endpoint. Empty when none was reported."
5422
+ },
4897
5423
  "weight_grams": {
4898
5424
  "type": "integer",
4899
5425
  "nullable": true,
@@ -5025,57 +5551,167 @@
5025
5551
  "type": "string",
5026
5552
  "nullable": true
5027
5553
  },
5028
- "interval_count": {
5029
- "type": "integer",
5554
+ "interval_count": {
5555
+ "type": "integer",
5556
+ "nullable": true
5557
+ },
5558
+ "billing_day_of_month": {
5559
+ "type": "integer",
5560
+ "nullable": true
5561
+ },
5562
+ "billing_schedule_id": {
5563
+ "type": "integer",
5564
+ "nullable": true
5565
+ },
5566
+ "billing_schedule_name": {
5567
+ "type": "string",
5568
+ "nullable": true
5569
+ }
5570
+ }
5571
+ },
5572
+ "V2SubscriptionContractPauseWindow": {
5573
+ "type": "object",
5574
+ "properties": {
5575
+ "id": {
5576
+ "type": "integer"
5577
+ },
5578
+ "start_date": {
5579
+ "type": "string",
5580
+ "format": "date"
5581
+ },
5582
+ "end_date": {
5583
+ "type": "string",
5584
+ "format": "date"
5585
+ },
5586
+ "active": {
5587
+ "type": "boolean"
5588
+ },
5589
+ "created_at": {
5590
+ "type": "string",
5591
+ "format": "date-time"
5592
+ },
5593
+ "updated_at": {
5594
+ "type": "string",
5595
+ "format": "date-time"
5596
+ }
5597
+ }
5598
+ },
5599
+ "V2EntitlementSummary": {
5600
+ "type": "object",
5601
+ "description": "Aggregate service entitlement state for a subscription contract.",
5602
+ "properties": {
5603
+ "service_active": {
5604
+ "type": "boolean"
5605
+ },
5606
+ "service_state": {
5607
+ "type": "string",
5608
+ "enum": [
5609
+ "active",
5610
+ "inactive",
5611
+ "partial",
5612
+ "past_due"
5613
+ ]
5614
+ },
5615
+ "active_service_item_count": {
5616
+ "type": "integer"
5617
+ },
5618
+ "inactive_service_item_count": {
5619
+ "type": "integer"
5620
+ },
5621
+ "past_due_service_item_count": {
5622
+ "type": "integer"
5623
+ },
5624
+ "total_active_quantity": {
5625
+ "type": "integer"
5626
+ },
5627
+ "active_product_ids": {
5628
+ "type": "array",
5629
+ "items": {
5630
+ "type": "integer"
5631
+ }
5632
+ },
5633
+ "evaluated_at": {
5634
+ "type": "string",
5635
+ "format": "date-time"
5636
+ }
5637
+ }
5638
+ },
5639
+ "V2CustomerEntitlementItem": {
5640
+ "type": "object",
5641
+ "description": "One contract item considered by the customer entitlement access check.",
5642
+ "properties": {
5643
+ "subscription_contract_id": {
5644
+ "type": "integer"
5645
+ },
5646
+ "contract_item_id": {
5647
+ "type": "integer"
5648
+ },
5649
+ "product_id": {
5650
+ "type": "integer"
5651
+ },
5652
+ "product_reference": {
5653
+ "type": "string",
5654
+ "nullable": true
5655
+ },
5656
+ "price_id": {
5657
+ "type": "integer"
5658
+ },
5659
+ "quantity": {
5660
+ "type": "integer"
5661
+ },
5662
+ "service_active": {
5663
+ "type": "boolean"
5664
+ },
5665
+ "service_state": {
5666
+ "type": "string",
5667
+ "enum": [
5668
+ "inactive",
5669
+ "active",
5670
+ "pending_payment",
5671
+ "past_due",
5672
+ "ended"
5673
+ ]
5674
+ },
5675
+ "entitled_from": {
5676
+ "type": "string",
5677
+ "format": "date-time",
5678
+ "nullable": true
5679
+ },
5680
+ "entitled_until": {
5681
+ "type": "string",
5682
+ "format": "date-time",
5683
+ "nullable": true
5684
+ },
5685
+ "current_service_period_start_at": {
5686
+ "type": "string",
5687
+ "format": "date-time",
5030
5688
  "nullable": true
5031
5689
  },
5032
- "billing_day_of_month": {
5033
- "type": "integer",
5690
+ "current_service_period_end_at": {
5691
+ "type": "string",
5692
+ "format": "date-time",
5034
5693
  "nullable": true
5035
5694
  },
5036
- "billing_schedule_id": {
5695
+ "entitlement_billing_run_id": {
5037
5696
  "type": "integer",
5038
5697
  "nullable": true
5039
- },
5040
- "billing_schedule_name": {
5041
- "type": "string",
5042
- "nullable": true
5043
5698
  }
5044
5699
  }
5045
5700
  },
5046
- "V2SubscriptionContractPauseWindow": {
5701
+ "V2CustomerEntitlements": {
5047
5702
  "type": "object",
5703
+ "description": "Customer/product service entitlement access-check response.",
5048
5704
  "properties": {
5049
- "id": {
5050
- "type": "integer"
5051
- },
5052
- "start_date": {
5053
- "type": "string",
5054
- "format": "date"
5055
- },
5056
- "end_date": {
5057
- "type": "string",
5058
- "format": "date"
5059
- },
5060
- "active": {
5061
- "type": "boolean"
5705
+ "customer_reference": {
5706
+ "type": "string"
5062
5707
  },
5063
- "created_at": {
5708
+ "product_reference": {
5064
5709
  "type": "string",
5065
- "format": "date-time"
5710
+ "nullable": true
5066
5711
  },
5067
- "updated_at": {
5068
- "type": "string",
5069
- "format": "date-time"
5070
- }
5071
- }
5072
- },
5073
- "V2EntitlementSummary": {
5074
- "type": "object",
5075
- "description": "Aggregate service entitlement state for a subscription contract.",
5076
- "properties": {
5077
5712
  "service_active": {
5078
- "type": "boolean"
5713
+ "type": "boolean",
5714
+ "description": "Simple integration-facing access flag."
5079
5715
  },
5080
5716
  "service_state": {
5081
5717
  "type": "string",
@@ -5086,15 +5722,6 @@
5086
5722
  "past_due"
5087
5723
  ]
5088
5724
  },
5089
- "active_service_item_count": {
5090
- "type": "integer"
5091
- },
5092
- "inactive_service_item_count": {
5093
- "type": "integer"
5094
- },
5095
- "past_due_service_item_count": {
5096
- "type": "integer"
5097
- },
5098
5725
  "total_active_quantity": {
5099
5726
  "type": "integer"
5100
5727
  },
@@ -5107,31 +5734,69 @@
5107
5734
  "evaluated_at": {
5108
5735
  "type": "string",
5109
5736
  "format": "date-time"
5737
+ },
5738
+ "items": {
5739
+ "type": "array",
5740
+ "items": {
5741
+ "$ref": "#/components/schemas/V2CustomerEntitlementItem"
5742
+ }
5110
5743
  }
5111
5744
  }
5112
5745
  },
5113
- "V2CustomerEntitlementItem": {
5746
+ "V2SubscriptionContract": {
5114
5747
  "type": "object",
5115
- "description": "One contract item considered by the customer entitlement access check.",
5116
5748
  "properties": {
5117
- "subscription_contract_id": {
5749
+ "id": {
5118
5750
  "type": "integer"
5119
5751
  },
5120
- "contract_item_id": {
5752
+ "customer_id": {
5121
5753
  "type": "integer"
5122
5754
  },
5123
- "product_id": {
5124
- "type": "integer"
5755
+ "customer": {
5756
+ "$ref": "#/components/schemas/V2SubscriptionContractCustomer"
5125
5757
  },
5126
- "product_reference": {
5758
+ "customer_reference": {
5759
+ "type": "string"
5760
+ },
5761
+ "shipping_selection": {
5762
+ "$ref": "#/components/schemas/V2ShippingSelection"
5763
+ },
5764
+ "discount": {
5765
+ "allOf": [
5766
+ {
5767
+ "$ref": "#/components/schemas/V2ContractDiscount"
5768
+ }
5769
+ ],
5770
+ "nullable": true,
5771
+ "description": "The active coupon discount on this contract, if any."
5772
+ },
5773
+ "state": {
5774
+ "type": "string"
5775
+ },
5776
+ "billing_anchor_at": {
5127
5777
  "type": "string",
5778
+ "format": "date-time",
5128
5779
  "nullable": true
5129
5780
  },
5130
- "price_id": {
5131
- "type": "integer"
5781
+ "billing_timezone": {
5782
+ "type": "string"
5132
5783
  },
5133
- "quantity": {
5134
- "type": "integer"
5784
+ "billing_time": {
5785
+ "type": "string"
5786
+ },
5787
+ "billing_advance_policy": {
5788
+ "type": "string",
5789
+ "enum": [
5790
+ "on_run_created",
5791
+ "on_run_succeeded"
5792
+ ]
5793
+ },
5794
+ "service_entitlement_policy": {
5795
+ "type": "string",
5796
+ "enum": [
5797
+ "on_run_created",
5798
+ "on_run_succeeded"
5799
+ ]
5135
5800
  },
5136
5801
  "service_active": {
5137
5802
  "type": "boolean"
@@ -5139,233 +5804,460 @@
5139
5804
  "service_state": {
5140
5805
  "type": "string",
5141
5806
  "enum": [
5142
- "inactive",
5143
5807
  "active",
5144
- "pending_payment",
5145
- "past_due",
5146
- "ended"
5808
+ "inactive",
5809
+ "partial",
5810
+ "past_due"
5147
5811
  ]
5148
5812
  },
5149
- "entitled_from": {
5813
+ "active_service_item_count": {
5814
+ "type": "integer"
5815
+ },
5816
+ "inactive_service_item_count": {
5817
+ "type": "integer"
5818
+ },
5819
+ "total_active_quantity": {
5820
+ "type": "integer"
5821
+ },
5822
+ "entitlement_summary": {
5823
+ "$ref": "#/components/schemas/V2EntitlementSummary"
5824
+ },
5825
+ "billing_attention_required": {
5826
+ "type": "boolean"
5827
+ },
5828
+ "trial_start_at": {
5150
5829
  "type": "string",
5151
5830
  "format": "date-time",
5152
5831
  "nullable": true
5153
5832
  },
5154
- "entitled_until": {
5833
+ "trial_end_at": {
5834
+ "type": "string",
5835
+ "format": "date-time",
5836
+ "nullable": true
5837
+ },
5838
+ "next_billing_at": {
5839
+ "type": "string",
5840
+ "format": "date-time",
5841
+ "nullable": true
5842
+ },
5843
+ "cancel_at": {
5844
+ "type": "string",
5845
+ "format": "date-time",
5846
+ "nullable": true
5847
+ },
5848
+ "cancel_at_period_end": {
5849
+ "type": "boolean"
5850
+ },
5851
+ "canceled_at": {
5852
+ "type": "string",
5853
+ "format": "date-time",
5854
+ "nullable": true
5855
+ },
5856
+ "ended_at": {
5155
5857
  "type": "string",
5156
5858
  "format": "date-time",
5157
5859
  "nullable": true
5158
5860
  },
5159
- "current_service_period_start_at": {
5160
- "type": "string",
5161
- "format": "date-time",
5861
+ "currency": {
5862
+ "type": "string"
5863
+ },
5864
+ "recurring": {
5865
+ "type": "boolean"
5866
+ },
5867
+ "has_future_pause": {
5868
+ "type": "boolean"
5869
+ },
5870
+ "paused_until": {
5871
+ "type": "string",
5872
+ "format": "date",
5873
+ "nullable": true
5874
+ },
5875
+ "payment_processor_override_id": {
5876
+ "type": "integer",
5877
+ "nullable": true
5878
+ },
5879
+ "legacy_subscription_ids": {
5880
+ "type": "array",
5881
+ "items": {
5882
+ "type": "integer"
5883
+ }
5884
+ },
5885
+ "metadata": {
5886
+ "$ref": "#/components/schemas/V2Metadata"
5887
+ },
5888
+ "subscriber_page": {
5889
+ "type": "string",
5890
+ "format": "uri",
5891
+ "nullable": true,
5892
+ "readOnly": true,
5893
+ "description": "Absolute URL of the customer-facing subscription management page for this contract."
5894
+ },
5895
+ "created_at": {
5896
+ "type": "string",
5897
+ "format": "date-time"
5898
+ },
5899
+ "updated_at": {
5900
+ "type": "string",
5901
+ "format": "date-time"
5902
+ },
5903
+ "items": {
5904
+ "type": "array",
5905
+ "items": {
5906
+ "$ref": "#/components/schemas/V2SubscriptionContractItem"
5907
+ }
5908
+ },
5909
+ "pauses": {
5910
+ "type": "array",
5911
+ "items": {
5912
+ "$ref": "#/components/schemas/V2SubscriptionContractPauseWindow"
5913
+ }
5914
+ },
5915
+ "current_pauses": {
5916
+ "type": "array",
5917
+ "items": {
5918
+ "$ref": "#/components/schemas/V2SubscriptionContractPauseWindow"
5919
+ }
5920
+ },
5921
+ "future_pauses": {
5922
+ "type": "array",
5923
+ "items": {
5924
+ "$ref": "#/components/schemas/V2SubscriptionContractPauseWindow"
5925
+ }
5926
+ },
5927
+ "past_pauses": {
5928
+ "type": "array",
5929
+ "items": {
5930
+ "$ref": "#/components/schemas/V2SubscriptionContractPauseWindow"
5931
+ }
5932
+ },
5933
+ "billing_cadence": {
5934
+ "$ref": "#/components/schemas/V2SubscriptionContractBillingCadence"
5935
+ },
5936
+ "bundle_purchases": {
5937
+ "type": "array",
5938
+ "items": {
5939
+ "$ref": "#/components/schemas/V2BundlePurchaseSummary"
5940
+ }
5941
+ },
5942
+ "bundle_purchase_id": {
5943
+ "type": "integer",
5944
+ "nullable": true
5945
+ },
5946
+ "initial_billing_run": {
5947
+ "$ref": "#/components/schemas/V2BillingRunSummary"
5948
+ },
5949
+ "initial_billing_run_id": {
5950
+ "type": "integer",
5162
5951
  "nullable": true
5163
5952
  },
5164
- "current_service_period_end_at": {
5953
+ "initial_billing_run_total_amount": {
5165
5954
  "type": "string",
5166
- "format": "date-time",
5955
+ "format": "decimal",
5167
5956
  "nullable": true
5168
5957
  },
5169
- "entitlement_billing_run_id": {
5170
- "type": "integer",
5171
- "nullable": true
5958
+ "latest_billing_run": {
5959
+ "$ref": "#/components/schemas/V2BillingRunSummary"
5172
5960
  }
5173
5961
  }
5174
5962
  },
5175
- "V2CustomerEntitlements": {
5963
+ "V2Coupon": {
5176
5964
  "type": "object",
5177
- "description": "Customer/product service entitlement access-check response.",
5178
5965
  "properties": {
5179
- "customer_reference": {
5180
- "type": "string"
5966
+ "id": {
5967
+ "type": "string",
5968
+ "example": "coup_5f3a1c2b9d8e4f6a7b8c9d0e"
5181
5969
  },
5182
- "product_reference": {
5970
+ "name": {
5183
5971
  "type": "string",
5184
5972
  "nullable": true
5185
5973
  },
5186
- "service_active": {
5187
- "type": "boolean",
5188
- "description": "Simple integration-facing access flag."
5974
+ "amount_off": {
5975
+ "type": "string",
5976
+ "format": "decimal",
5977
+ "nullable": true,
5978
+ "description": "Fixed amount taken off. Mutually exclusive with `percent_off`.",
5979
+ "example": "500.00"
5189
5980
  },
5190
- "service_state": {
5981
+ "currency": {
5982
+ "type": "string",
5983
+ "nullable": true,
5984
+ "description": "Three-letter ISO 4217 currency code. Required with `amount_off`.",
5985
+ "example": "ISK"
5986
+ },
5987
+ "percent_off": {
5988
+ "type": "string",
5989
+ "format": "decimal",
5990
+ "nullable": true,
5991
+ "description": "Percentage taken off (0.01-100). Mutually exclusive with `amount_off`.",
5992
+ "example": "10.00"
5993
+ },
5994
+ "discount_display": {
5995
+ "type": "string",
5996
+ "example": "10.00%"
5997
+ },
5998
+ "duration": {
5191
5999
  "type": "string",
5192
6000
  "enum": [
5193
- "active",
5194
- "inactive",
5195
- "partial",
5196
- "past_due"
6001
+ "forever",
6002
+ "once",
6003
+ "repeating"
5197
6004
  ]
5198
6005
  },
5199
- "total_active_quantity": {
6006
+ "duration_in_months": {
6007
+ "type": "integer",
6008
+ "nullable": true,
6009
+ "minimum": 1,
6010
+ "description": "Required when `duration` is `repeating`."
6011
+ },
6012
+ "skip_trial_period": {
6013
+ "type": "boolean",
6014
+ "description": "Bypass the plan trial period when the coupon is applied at checkout."
6015
+ },
6016
+ "max_redemptions": {
6017
+ "type": "integer",
6018
+ "nullable": true,
6019
+ "minimum": 1
6020
+ },
6021
+ "times_redeemed": {
5200
6022
  "type": "integer"
5201
6023
  },
5202
- "active_product_ids": {
5203
- "type": "array",
5204
- "items": {
5205
- "type": "integer"
5206
- }
6024
+ "redeem_by": {
6025
+ "type": "string",
6026
+ "format": "date-time",
6027
+ "nullable": true
5207
6028
  },
5208
- "evaluated_at": {
6029
+ "valid": {
6030
+ "type": "boolean",
6031
+ "description": "Whether the coupon can currently be redeemed."
6032
+ },
6033
+ "metadata": {
6034
+ "$ref": "#/components/schemas/V2Metadata"
6035
+ },
6036
+ "created_at": {
5209
6037
  "type": "string",
5210
6038
  "format": "date-time"
5211
6039
  },
5212
- "items": {
5213
- "type": "array",
5214
- "items": {
5215
- "$ref": "#/components/schemas/V2CustomerEntitlementItem"
5216
- }
6040
+ "updated_at": {
6041
+ "type": "string",
6042
+ "format": "date-time"
5217
6043
  }
5218
6044
  }
5219
6045
  },
5220
- "V2SubscriptionContract": {
6046
+ "V2CouponCreate": {
5221
6047
  "type": "object",
6048
+ "required": [
6049
+ "duration"
6050
+ ],
5222
6051
  "properties": {
5223
6052
  "id": {
5224
- "type": "integer"
6053
+ "type": "string",
6054
+ "example": "coup_5f3a1c2b9d8e4f6a7b8c9d0e",
6055
+ "description": "Optional custom id (letters, digits, underscores, hyphens and dots, max 128 characters; `.` and `..` are not allowed). Generated when omitted.",
6056
+ "pattern": "^(?!\\.{1,2}$)[A-Za-z0-9_.-]{1,128}$"
5225
6057
  },
5226
- "customer_id": {
5227
- "type": "integer"
6058
+ "name": {
6059
+ "type": "string",
6060
+ "nullable": true
5228
6061
  },
5229
- "customer": {
5230
- "$ref": "#/components/schemas/V2SubscriptionContractCustomer"
6062
+ "amount_off": {
6063
+ "type": "string",
6064
+ "format": "decimal",
6065
+ "nullable": true,
6066
+ "description": "Fixed amount taken off. Mutually exclusive with `percent_off`.",
6067
+ "example": "500.00"
5231
6068
  },
5232
- "customer_reference": {
5233
- "type": "string"
6069
+ "currency": {
6070
+ "type": "string",
6071
+ "nullable": true,
6072
+ "description": "Three-letter ISO 4217 currency code. Required with `amount_off`.",
6073
+ "example": "ISK"
5234
6074
  },
5235
- "shipping_selection": {
5236
- "$ref": "#/components/schemas/V2ShippingSelection"
6075
+ "percent_off": {
6076
+ "type": "string",
6077
+ "format": "decimal",
6078
+ "nullable": true,
6079
+ "description": "Percentage taken off (0.01-100). Mutually exclusive with `amount_off`.",
6080
+ "example": "10.00"
5237
6081
  },
5238
- "discount": {
5239
- "allOf": [
5240
- {
5241
- "$ref": "#/components/schemas/V2ContractDiscount"
5242
- }
5243
- ],
6082
+ "duration": {
6083
+ "type": "string",
6084
+ "enum": [
6085
+ "forever",
6086
+ "once",
6087
+ "repeating"
6088
+ ]
6089
+ },
6090
+ "duration_in_months": {
6091
+ "type": "integer",
5244
6092
  "nullable": true,
5245
- "description": "The active coupon discount on this contract, if any."
6093
+ "minimum": 1,
6094
+ "description": "Required when `duration` is `repeating`."
5246
6095
  },
5247
- "state": {
5248
- "type": "string"
6096
+ "skip_trial_period": {
6097
+ "type": "boolean",
6098
+ "description": "Bypass the plan trial period when the coupon is applied at checkout."
5249
6099
  },
5250
- "billing_anchor_at": {
6100
+ "max_redemptions": {
6101
+ "type": "integer",
6102
+ "nullable": true,
6103
+ "minimum": 1
6104
+ },
6105
+ "redeem_by": {
5251
6106
  "type": "string",
5252
6107
  "format": "date-time",
5253
6108
  "nullable": true
5254
6109
  },
5255
- "billing_timezone": {
5256
- "type": "string"
5257
- },
5258
- "billing_time": {
5259
- "type": "string"
6110
+ "metadata": {
6111
+ "allOf": [
6112
+ {
6113
+ "$ref": "#/components/schemas/V2Metadata"
6114
+ }
6115
+ ],
6116
+ "nullable": true
6117
+ }
6118
+ },
6119
+ "additionalProperties": false
6120
+ },
6121
+ "V2CouponPatch": {
6122
+ "type": "object",
6123
+ "properties": {
6124
+ "name": {
6125
+ "type": "string",
6126
+ "nullable": true
5260
6127
  },
5261
- "billing_advance_policy": {
6128
+ "amount_off": {
5262
6129
  "type": "string",
5263
- "enum": [
5264
- "on_run_created",
5265
- "on_run_succeeded"
5266
- ]
6130
+ "format": "decimal",
6131
+ "nullable": true,
6132
+ "description": "Fixed amount taken off. Mutually exclusive with `percent_off`.",
6133
+ "example": "500.00"
5267
6134
  },
5268
- "service_entitlement_policy": {
6135
+ "currency": {
5269
6136
  "type": "string",
5270
- "enum": [
5271
- "on_run_created",
5272
- "on_run_succeeded"
5273
- ]
6137
+ "nullable": true,
6138
+ "description": "Three-letter ISO 4217 currency code. Required with `amount_off`.",
6139
+ "example": "ISK"
5274
6140
  },
5275
- "service_active": {
5276
- "type": "boolean"
6141
+ "percent_off": {
6142
+ "type": "string",
6143
+ "format": "decimal",
6144
+ "nullable": true,
6145
+ "description": "Percentage taken off (0.01-100). Mutually exclusive with `amount_off`.",
6146
+ "example": "10.00"
5277
6147
  },
5278
- "service_state": {
6148
+ "duration": {
5279
6149
  "type": "string",
5280
6150
  "enum": [
5281
- "active",
5282
- "inactive",
5283
- "partial",
5284
- "past_due"
6151
+ "forever",
6152
+ "once",
6153
+ "repeating"
5285
6154
  ]
5286
6155
  },
5287
- "active_service_item_count": {
5288
- "type": "integer"
5289
- },
5290
- "inactive_service_item_count": {
5291
- "type": "integer"
5292
- },
5293
- "total_active_quantity": {
5294
- "type": "integer"
6156
+ "duration_in_months": {
6157
+ "type": "integer",
6158
+ "nullable": true,
6159
+ "minimum": 1,
6160
+ "description": "Required when `duration` is `repeating`."
5295
6161
  },
5296
- "entitlement_summary": {
5297
- "$ref": "#/components/schemas/V2EntitlementSummary"
6162
+ "skip_trial_period": {
6163
+ "type": "boolean",
6164
+ "description": "Bypass the plan trial period when the coupon is applied at checkout."
5298
6165
  },
5299
- "billing_attention_required": {
5300
- "type": "boolean"
6166
+ "max_redemptions": {
6167
+ "type": "integer",
6168
+ "nullable": true,
6169
+ "minimum": 1
5301
6170
  },
5302
- "trial_start_at": {
6171
+ "redeem_by": {
5303
6172
  "type": "string",
5304
6173
  "format": "date-time",
5305
6174
  "nullable": true
5306
6175
  },
5307
- "trial_end_at": {
5308
- "type": "string",
5309
- "format": "date-time",
6176
+ "metadata": {
6177
+ "allOf": [
6178
+ {
6179
+ "$ref": "#/components/schemas/V2Metadata"
6180
+ }
6181
+ ],
5310
6182
  "nullable": true
5311
- },
5312
- "next_billing_at": {
6183
+ }
6184
+ },
6185
+ "additionalProperties": false
6186
+ },
6187
+ "V2PromotionCode": {
6188
+ "type": "object",
6189
+ "properties": {
6190
+ "id": {
5313
6191
  "type": "string",
5314
- "format": "date-time",
5315
- "nullable": true
6192
+ "example": "promo_5f3a1c2b9d8e4f6a7b8c9d0e"
5316
6193
  },
5317
- "cancel_at": {
6194
+ "code": {
5318
6195
  "type": "string",
5319
- "format": "date-time",
5320
- "nullable": true
6196
+ "description": "Customer-facing code (4-50 letters, digits, hyphens or underscores). Stored in upper case.",
6197
+ "example": "SUMMER20"
5321
6198
  },
5322
- "cancel_at_period_end": {
5323
- "type": "boolean"
5324
- },
5325
- "canceled_at": {
6199
+ "coupon": {
5326
6200
  "type": "string",
5327
- "format": "date-time",
5328
- "nullable": true
6201
+ "description": "Coupon id.",
6202
+ "example": "coup_5f3a1c2b9d8e4f6a7b8c9d0e"
5329
6203
  },
5330
- "ended_at": {
6204
+ "coupon_name": {
5331
6205
  "type": "string",
5332
- "format": "date-time",
5333
6206
  "nullable": true
5334
6207
  },
5335
- "currency": {
5336
- "type": "string"
6208
+ "coupon_discount_display": {
6209
+ "type": "string",
6210
+ "example": "10.00%"
5337
6211
  },
5338
- "recurring": {
6212
+ "active": {
5339
6213
  "type": "boolean"
5340
6214
  },
5341
- "has_future_pause": {
5342
- "type": "boolean"
6215
+ "customer_id": {
6216
+ "type": "integer",
6217
+ "nullable": true
5343
6218
  },
5344
- "paused_until": {
6219
+ "customer_reference": {
5345
6220
  "type": "string",
5346
- "format": "date",
5347
6221
  "nullable": true
5348
6222
  },
5349
- "payment_processor_override_id": {
6223
+ "max_redemptions": {
5350
6224
  "type": "integer",
6225
+ "nullable": true,
6226
+ "minimum": 1
6227
+ },
6228
+ "times_redeemed": {
6229
+ "type": "integer"
6230
+ },
6231
+ "expires_at": {
6232
+ "type": "string",
6233
+ "format": "date-time",
5351
6234
  "nullable": true
5352
6235
  },
5353
- "legacy_subscription_ids": {
5354
- "type": "array",
5355
- "items": {
5356
- "type": "integer"
5357
- }
6236
+ "restrictions": {
6237
+ "type": "object",
6238
+ "description": "Redemption restrictions. Only a minimum order amount is supported; `minimum_amount` and `minimum_amount_currency` must be provided together, or send an empty object to remove the restriction.",
6239
+ "properties": {
6240
+ "minimum_amount": {
6241
+ "type": "string",
6242
+ "format": "decimal",
6243
+ "description": "Minimum amount the code can be applied to. Must be greater than zero.",
6244
+ "example": "1000"
6245
+ },
6246
+ "minimum_amount_currency": {
6247
+ "type": "string",
6248
+ "description": "Three-letter ISO 4217 code of `minimum_amount`.",
6249
+ "example": "ISK"
6250
+ }
6251
+ },
6252
+ "additionalProperties": false
6253
+ },
6254
+ "valid": {
6255
+ "type": "boolean",
6256
+ "description": "Whether the code can currently be redeemed."
5358
6257
  },
5359
6258
  "metadata": {
5360
6259
  "$ref": "#/components/schemas/V2Metadata"
5361
6260
  },
5362
- "subscriber_page": {
5363
- "type": "string",
5364
- "format": "uri",
5365
- "nullable": true,
5366
- "readOnly": true,
5367
- "description": "Absolute URL of the customer-facing subscription management page for this contract."
5368
- },
5369
6261
  "created_at": {
5370
6262
  "type": "string",
5371
6263
  "format": "date-time"
@@ -5373,66 +6265,149 @@
5373
6265
  "updated_at": {
5374
6266
  "type": "string",
5375
6267
  "format": "date-time"
6268
+ }
6269
+ }
6270
+ },
6271
+ "V2PromotionCodeCreate": {
6272
+ "type": "object",
6273
+ "required": [
6274
+ "coupon"
6275
+ ],
6276
+ "properties": {
6277
+ "id": {
6278
+ "type": "string",
6279
+ "example": "promo_5f3a1c2b9d8e4f6a7b8c9d0e",
6280
+ "description": "Optional custom id (letters, digits, underscores, hyphens and dots, max 128 characters; `.` and `..` are not allowed). Generated when omitted.",
6281
+ "pattern": "^(?!\\.{1,2}$)[A-Za-z0-9_.-]{1,128}$"
5376
6282
  },
5377
- "items": {
5378
- "type": "array",
5379
- "items": {
5380
- "$ref": "#/components/schemas/V2SubscriptionContractItem"
5381
- }
6283
+ "code": {
6284
+ "type": "string",
6285
+ "description": "Customer-facing code (4-50 letters, digits, hyphens or underscores). Stored in upper case. Generated when omitted.",
6286
+ "example": "SUMMER20"
5382
6287
  },
5383
- "pauses": {
5384
- "type": "array",
5385
- "items": {
5386
- "$ref": "#/components/schemas/V2SubscriptionContractPauseWindow"
5387
- }
6288
+ "coupon": {
6289
+ "type": "string",
6290
+ "description": "Coupon id.",
6291
+ "example": "coup_5f3a1c2b9d8e4f6a7b8c9d0e"
5388
6292
  },
5389
- "current_pauses": {
5390
- "type": "array",
5391
- "items": {
5392
- "$ref": "#/components/schemas/V2SubscriptionContractPauseWindow"
5393
- }
6293
+ "active": {
6294
+ "type": "boolean"
5394
6295
  },
5395
- "future_pauses": {
5396
- "type": "array",
5397
- "items": {
5398
- "$ref": "#/components/schemas/V2SubscriptionContractPauseWindow"
5399
- }
6296
+ "customer": {
6297
+ "type": "integer",
6298
+ "nullable": true,
6299
+ "description": "Customer id to restrict the code to. Mutually exclusive with `customer_reference`."
5400
6300
  },
5401
- "past_pauses": {
5402
- "type": "array",
5403
- "items": {
5404
- "$ref": "#/components/schemas/V2SubscriptionContractPauseWindow"
5405
- }
6301
+ "customer_reference": {
6302
+ "type": "string",
6303
+ "nullable": true,
6304
+ "description": "Customer reference to restrict the code to. Mutually exclusive with `customer`."
5406
6305
  },
5407
- "billing_cadence": {
5408
- "$ref": "#/components/schemas/V2SubscriptionContractBillingCadence"
6306
+ "max_redemptions": {
6307
+ "type": "integer",
6308
+ "nullable": true,
6309
+ "minimum": 1
5409
6310
  },
5410
- "bundle_purchases": {
5411
- "type": "array",
5412
- "items": {
5413
- "$ref": "#/components/schemas/V2BundlePurchaseSummary"
5414
- }
6311
+ "expires_at": {
6312
+ "type": "string",
6313
+ "format": "date-time",
6314
+ "nullable": true
5415
6315
  },
5416
- "bundle_purchase_id": {
5417
- "type": "integer",
6316
+ "restrictions": {
6317
+ "type": "object",
6318
+ "nullable": true,
6319
+ "description": "Redemption restrictions. Only a minimum order amount is supported; `minimum_amount` and `minimum_amount_currency` must be provided together, or send an empty object to remove the restriction.",
6320
+ "properties": {
6321
+ "minimum_amount": {
6322
+ "type": "string",
6323
+ "format": "decimal",
6324
+ "description": "Minimum amount the code can be applied to. Must be greater than zero.",
6325
+ "example": "1000"
6326
+ },
6327
+ "minimum_amount_currency": {
6328
+ "type": "string",
6329
+ "description": "Three-letter ISO 4217 code of `minimum_amount`.",
6330
+ "example": "ISK"
6331
+ }
6332
+ },
6333
+ "additionalProperties": false
6334
+ },
6335
+ "metadata": {
6336
+ "allOf": [
6337
+ {
6338
+ "$ref": "#/components/schemas/V2Metadata"
6339
+ }
6340
+ ],
5418
6341
  "nullable": true
6342
+ }
6343
+ },
6344
+ "additionalProperties": false
6345
+ },
6346
+ "V2PromotionCodePatch": {
6347
+ "type": "object",
6348
+ "properties": {
6349
+ "code": {
6350
+ "type": "string",
6351
+ "description": "Customer-facing code (4-50 letters, digits, hyphens or underscores). Stored in upper case.",
6352
+ "example": "SUMMER20"
5419
6353
  },
5420
- "initial_billing_run": {
5421
- "$ref": "#/components/schemas/V2BillingRunSummary"
6354
+ "coupon": {
6355
+ "type": "string",
6356
+ "description": "Coupon id.",
6357
+ "example": "coup_5f3a1c2b9d8e4f6a7b8c9d0e"
5422
6358
  },
5423
- "initial_billing_run_id": {
6359
+ "active": {
6360
+ "type": "boolean"
6361
+ },
6362
+ "customer": {
5424
6363
  "type": "integer",
5425
- "nullable": true
6364
+ "nullable": true,
6365
+ "description": "Customer id to restrict the code to. Mutually exclusive with `customer_reference`."
5426
6366
  },
5427
- "initial_billing_run_total_amount": {
6367
+ "customer_reference": {
5428
6368
  "type": "string",
5429
- "format": "decimal",
6369
+ "nullable": true,
6370
+ "description": "Customer reference to restrict the code to. Mutually exclusive with `customer`."
6371
+ },
6372
+ "max_redemptions": {
6373
+ "type": "integer",
6374
+ "nullable": true,
6375
+ "minimum": 1
6376
+ },
6377
+ "expires_at": {
6378
+ "type": "string",
6379
+ "format": "date-time",
5430
6380
  "nullable": true
5431
6381
  },
5432
- "latest_billing_run": {
5433
- "$ref": "#/components/schemas/V2BillingRunSummary"
6382
+ "restrictions": {
6383
+ "type": "object",
6384
+ "nullable": true,
6385
+ "description": "Redemption restrictions. Only a minimum order amount is supported; `minimum_amount` and `minimum_amount_currency` must be provided together, or send an empty object to remove the restriction.",
6386
+ "properties": {
6387
+ "minimum_amount": {
6388
+ "type": "string",
6389
+ "format": "decimal",
6390
+ "description": "Minimum amount the code can be applied to. Must be greater than zero.",
6391
+ "example": "1000"
6392
+ },
6393
+ "minimum_amount_currency": {
6394
+ "type": "string",
6395
+ "description": "Three-letter ISO 4217 code of `minimum_amount`.",
6396
+ "example": "ISK"
6397
+ }
6398
+ },
6399
+ "additionalProperties": false
6400
+ },
6401
+ "metadata": {
6402
+ "allOf": [
6403
+ {
6404
+ "$ref": "#/components/schemas/V2Metadata"
6405
+ }
6406
+ ],
6407
+ "nullable": true
5434
6408
  }
5435
- }
6409
+ },
6410
+ "additionalProperties": false
5436
6411
  }
5437
6412
  },
5438
6413
  "parameters": {
@@ -5589,6 +6564,28 @@
5589
6564
  "type": "string",
5590
6565
  "format": "uuid"
5591
6566
  }
6567
+ },
6568
+ "V2CouponId": {
6569
+ "name": "couponId",
6570
+ "in": "path",
6571
+ "description": "Coupon id.",
6572
+ "required": true,
6573
+ "style": "simple",
6574
+ "explode": false,
6575
+ "schema": {
6576
+ "type": "string"
6577
+ }
6578
+ },
6579
+ "V2PromotionCodeId": {
6580
+ "name": "promotionCodeId",
6581
+ "in": "path",
6582
+ "description": "Promotion code id.",
6583
+ "required": true,
6584
+ "style": "simple",
6585
+ "explode": false,
6586
+ "schema": {
6587
+ "type": "string"
6588
+ }
5592
6589
  }
5593
6590
  },
5594
6591
  "responses": {
@@ -5958,6 +6955,127 @@
5958
6955
  }
5959
6956
  }
5960
6957
  },
6958
+ "V2FulfillmentOrderConflict": {
6959
+ "description": "The order has already moved somewhere the action cannot take it from, or is moving there right now: `order_cancelled` when fulfilling a cancelled order, `order_fulfilled` when cancelling a fulfilled one, `booking_in_progress` when a shipment is being booked in Áskell for it — retry shortly",
6960
+ "content": {
6961
+ "application/json": {
6962
+ "schema": {
6963
+ "type": "object",
6964
+ "properties": {
6965
+ "error": {
6966
+ "type": "string"
6967
+ },
6968
+ "code": {
6969
+ "type": "string",
6970
+ "enum": [
6971
+ "order_cancelled",
6972
+ "order_fulfilled",
6973
+ "booking_in_progress"
6974
+ ]
6975
+ }
6976
+ }
6977
+ }
6978
+ }
6979
+ }
6980
+ },
6981
+ "V2Coupon": {
6982
+ "description": "V2 coupon",
6983
+ "content": {
6984
+ "application/json": {
6985
+ "schema": {
6986
+ "$ref": "#/components/schemas/V2Coupon"
6987
+ }
6988
+ }
6989
+ }
6990
+ },
6991
+ "V2CouponList": {
6992
+ "description": "V2 coupon list",
6993
+ "content": {
6994
+ "application/json": {
6995
+ "schema": {
6996
+ "anyOf": [
6997
+ {
6998
+ "type": "array",
6999
+ "items": {
7000
+ "$ref": "#/components/schemas/V2Coupon"
7001
+ }
7002
+ },
7003
+ {
7004
+ "type": "object",
7005
+ "properties": {
7006
+ "count": {
7007
+ "type": "integer"
7008
+ },
7009
+ "next": {
7010
+ "type": "string",
7011
+ "nullable": true
7012
+ },
7013
+ "previous": {
7014
+ "type": "string",
7015
+ "nullable": true
7016
+ },
7017
+ "results": {
7018
+ "type": "array",
7019
+ "items": {
7020
+ "$ref": "#/components/schemas/V2Coupon"
7021
+ }
7022
+ }
7023
+ }
7024
+ }
7025
+ ]
7026
+ }
7027
+ }
7028
+ }
7029
+ },
7030
+ "V2PromotionCode": {
7031
+ "description": "V2 promotion code",
7032
+ "content": {
7033
+ "application/json": {
7034
+ "schema": {
7035
+ "$ref": "#/components/schemas/V2PromotionCode"
7036
+ }
7037
+ }
7038
+ }
7039
+ },
7040
+ "V2PromotionCodeList": {
7041
+ "description": "V2 promotion code list",
7042
+ "content": {
7043
+ "application/json": {
7044
+ "schema": {
7045
+ "anyOf": [
7046
+ {
7047
+ "type": "array",
7048
+ "items": {
7049
+ "$ref": "#/components/schemas/V2PromotionCode"
7050
+ }
7051
+ },
7052
+ {
7053
+ "type": "object",
7054
+ "properties": {
7055
+ "count": {
7056
+ "type": "integer"
7057
+ },
7058
+ "next": {
7059
+ "type": "string",
7060
+ "nullable": true
7061
+ },
7062
+ "previous": {
7063
+ "type": "string",
7064
+ "nullable": true
7065
+ },
7066
+ "results": {
7067
+ "type": "array",
7068
+ "items": {
7069
+ "$ref": "#/components/schemas/V2PromotionCode"
7070
+ }
7071
+ }
7072
+ }
7073
+ }
7074
+ ]
7075
+ }
7076
+ }
7077
+ }
7078
+ },
5961
7079
  "V2BillingRun": {
5962
7080
  "description": "V2 billing run",
5963
7081
  "content": {