From 8d18d18280b789cd0d256b454ddae603ad952ed7 Mon Sep 17 00:00:00 2001 From: Andrea Dao Date: Fri, 6 Oct 2023 15:25:43 -0500 Subject: [PATCH 1/4] Add swagger --- reference/settings.v3.yml | 82 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) diff --git a/reference/settings.v3.yml b/reference/settings.v3.yml index d5d64c119..52ac2c980 100644 --- a/reference/settings.v3.yml +++ b/reference/settings.v3.yml @@ -37,6 +37,7 @@ tags: - name: Favicon Image - name: Store Profile - name: Storefront Product + - name: Units of Measurement paths: '/settings/analytics': parameters: @@ -1428,6 +1429,59 @@ paths: tags: - Inventory description: Update inventory settings + /settings/store/units-of-measurement: + get: + summary: Get Store Units of Measurement Notifications Settings + description: |- + Get a store's notification settings for its units of measurements. + tags: + - Units of Measurement + responses: + '200': + description: 'OK, null indicates that a particular field has not been overridden on a channel level when channel level settings are requested' + content: + application/json: + schema: + type: object + properties: + data: + $ref: '#/components/schemas/MeasurementUnitsSettings' + meta: + type: object + '422': + description: Provided settings could not be applied for some reason - detailed errors in the response. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + parameters: + - $ref: '#/components/parameters/ChannelIdParam' + put: + summary: Update Store Units of Measurements Notifications Settings + description: |- + Update a store's notification settings for its units of measurements. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MeasurementUnitsSettings' + description: null set for a particular field removes override on a channel level and means inheritance from a global level + responses: + '200': + description: 'OK, null indicates that a particular field has not been overridden on a channel level when channel level settings are requested' + content: + application/json: + schema: + type: object + properties: + data: + $ref: '#/components/schemas/MeasurementUnitsSettings' + meta: + type: object + parameters: + - $ref: '#/components/parameters/ChannelIdParam' + tags: + - Units of Measurement components: parameters: Accept: @@ -2296,6 +2350,34 @@ components: type: string title: '' x-internal: false + MeasurementUnitsSettings: + type: object + properties: + weight_measurement: + type: string + enum: + - LBS + - Ounces + - KGS + - Grams + - Tonnes + length_measurement: + type: string + enum: + - Inches + - Centimeters + decimal_token: + type: string + thousands_token: + type: string + decimal_places: + type: integer + factoring_dimension: + type: string + enum: + - depth + - height + - width responses: 200-storefront-product-settings: description: OK. `null` indicates that a particular field has not been overridden on a channel level when channel level settings are requested From 84cc0b723bc8d3bb11c4b12d6b68e7473d1a596d Mon Sep 17 00:00:00 2001 From: Andrea Dao Date: Mon, 16 Oct 2023 11:50:43 -0500 Subject: [PATCH 2/4] edit descriptions --- reference/settings.v3.yml | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/reference/settings.v3.yml b/reference/settings.v3.yml index 52ac2c980..b3b41a0da 100644 --- a/reference/settings.v3.yml +++ b/reference/settings.v3.yml @@ -1431,14 +1431,14 @@ paths: description: Update inventory settings /settings/store/units-of-measurement: get: - summary: Get Store Units of Measurement Notifications Settings + summary: Get Units of Measurement Settings description: |- - Get a store's notification settings for its units of measurements. + Get settings for [units of measurements](https://support.bigcommerce.com/s/article/Store-Settings?language=en_US#physical). tags: - Units of Measurement responses: '200': - description: 'OK, null indicates that a particular field has not been overridden on a channel level when channel level settings are requested' + description: 'OK. When you request channel-level settings, `null` indicates that a channel does not have overrides.' content: application/json: schema: @@ -1449,7 +1449,7 @@ paths: meta: type: object '422': - description: Provided settings could not be applied for some reason - detailed errors in the response. + description: The provided settings could not be applied. See detailed errors in the response. content: application/json: schema: @@ -1457,18 +1457,25 @@ paths: parameters: - $ref: '#/components/parameters/ChannelIdParam' put: - summary: Update Store Units of Measurements Notifications Settings + summary: Update Units of Measurement Settings description: |- - Update a store's notification settings for its units of measurements. + Update settings for [units of measurements](https://support.bigcommerce.com/s/article/Store-Settings?language=en_US#physical). + + The endpoint does not support partial updates. Provide all fields to update global or channel-level settings. + + Create channel-level settings, or overrides for a channel, using the `channel_id` query parameter. + + To delete overrides for a channel, supply `null` as a value for all fields. A channel then inherits global values. + + The endpoint does not support 'null' as a value for global-level settings. requestBody: content: application/json: schema: $ref: '#/components/schemas/MeasurementUnitsSettings' - description: null set for a particular field removes override on a channel level and means inheritance from a global level responses: '200': - description: 'OK, null indicates that a particular field has not been overridden on a channel level when channel level settings are requested' + description: 'OK. When you request channel-level settings, `null` indicates that a channel does not have overrides.' content: application/json: schema: From 6a5154f19d9af121bcaae0e7ca77d1da37769fd1 Mon Sep 17 00:00:00 2001 From: Andrea Dao Date: Mon, 16 Oct 2023 11:57:57 -0500 Subject: [PATCH 3/4] add response example --- reference/settings.v3.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/reference/settings.v3.yml b/reference/settings.v3.yml index b3b41a0da..4397ee402 100644 --- a/reference/settings.v3.yml +++ b/reference/settings.v3.yml @@ -2375,10 +2375,13 @@ components: - Centimeters decimal_token: type: string + example: '.' thousands_token: type: string + example: ',' decimal_places: type: integer + example: 2 factoring_dimension: type: string enum: From 25cd59e8486901d67a5f8d1f65cd005202ad9dbd Mon Sep 17 00:00:00 2001 From: Andrea Dao Date: Mon, 16 Oct 2023 12:00:52 -0500 Subject: [PATCH 4/4] add example --- reference/settings.v3.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/reference/settings.v3.yml b/reference/settings.v3.yml index 4397ee402..09f047291 100644 --- a/reference/settings.v3.yml +++ b/reference/settings.v3.yml @@ -2362,6 +2362,7 @@ components: properties: weight_measurement: type: string + example: Ounces enum: - LBS - Ounces @@ -2370,6 +2371,7 @@ components: - Tonnes length_measurement: type: string + example: Inches enum: - Inches - Centimeters @@ -2384,6 +2386,7 @@ components: example: 2 factoring_dimension: type: string + example: depth enum: - depth - height