diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md
index 95daad3f..ddd19845 100644
--- a/RELEASE_NOTES.md
+++ b/RELEASE_NOTES.md
@@ -1,4 +1,4 @@
### Fixes
- - Add `brand_name` property to Product (Issue #99, thanks @guillaume-sarramegna)
+ - Fixes issue with Product Option Value API
diff --git a/docs/classes/BigCommerce-ApiV3-Api-Catalog-Products-ProductOption-ProductOptionValuesApi.html b/docs/classes/BigCommerce-ApiV3-Api-Catalog-Products-ProductOption-ProductOptionValuesApi.html
index 9a8857c4..770e4e1d 100644
--- a/docs/classes/BigCommerce-ApiV3-Api-Catalog-Products-ProductOption-ProductOptionValuesApi.html
+++ b/docs/classes/BigCommerce-ApiV3-Api-Catalog-Products-ProductOption-ProductOptionValuesApi.html
@@ -101,14 +101,13 @@
V3ApiBase
+ Referred to in the documentation as Product Variant Options Values
- Add constructors and some basic scaffolding that will work for all API classes
-regardless of which endpoints they implement
+ https://developer.bigcommerce.com/api-reference/store-management/catalog/product-variant-option-values/createoptionvalue
@@ -234,7 +233,7 @@
@@ -263,7 +262,7 @@
@@ -292,7 +291,7 @@
@@ -394,7 +393,7 @@
@@ -438,7 +437,7 @@
@@ -471,7 +470,7 @@
@@ -597,7 +596,7 @@
@@ -663,7 +662,7 @@
@@ -707,7 +706,7 @@
diff --git a/docs/classes/BigCommerce-ApiV3-ResponseModels-OptionsResponse.html b/docs/classes/BigCommerce-ApiV3-ResponseModels-OptionsResponse.html
index badb6c5f..c77a8fe5 100644
--- a/docs/classes/BigCommerce-ApiV3-ResponseModels-OptionsResponse.html
+++ b/docs/classes/BigCommerce-ApiV3-ResponseModels-OptionsResponse.html
@@ -209,7 +209,7 @@
diff --git a/docs/files/bigcommerce-api-catalog-products-productoption-productoptionvaluesapi.html b/docs/files/bigcommerce-api-catalog-products-productoption-productoptionvaluesapi.html
index c07da7f5..1653cb49 100644
--- a/docs/files/bigcommerce-api-catalog-products-productoption-productoptionvaluesapi.html
+++ b/docs/files/bigcommerce-api-catalog-products-productoption-productoptionvaluesapi.html
@@ -99,7 +99,7 @@
- ProductOptionValuesApi
- - V3ApiBase
+ - Referred to in the documentation as Product Variant Options Values
diff --git a/docs/indices/files.html b/docs/indices/files.html
index 7c1a5ed6..85d245be 100644
--- a/docs/indices/files.html
+++ b/docs/indices/files.html
@@ -142,7 +142,6 @@ C
ChannelsApi.php
ChannelsResponse.php
Client.php
- Client.php
ComplexRule.php
ComplexRuleConditions.php
ComplexRuleResponse.php
@@ -216,8 +215,8 @@ O
OptionResponse.php
OptionsApi.php
OptionsResponse.php
- Order.php
Order.php
+ Order.php
OrderAddress.php
OrderBillingAddress.php
OrderMetafield.php
@@ -227,8 +226,8 @@ O
OrderProduct.php
OrderRefundItem.php
OrderShippingAddress.php
- OrdersApi.php
OrdersApi.php
+ OrdersApi.php
P
diff --git a/docs/js/searchIndex.js b/docs/js/searchIndex.js
index 5ad56338..80f3a62a 100644
--- a/docs/js/searchIndex.js
+++ b/docs/js/searchIndex.js
@@ -663,7 +663,7 @@ Search.appendIndex(
}, {
"fqsen": "\\BigCommerce\\ApiV3\\Api\\Catalog\\Products\\ProductOption\\ProductOptionValuesApi",
"name": "ProductOptionValuesApi",
- "summary": "V3ApiBase",
+ "summary": "Referred\u0020to\u0020in\u0020the\u0020documentation\u0020as\u0020Product\u0020Variant\u0020Options\u0020Values",
"url": "classes/BigCommerce-ApiV3-Api-Catalog-Products-ProductOption-ProductOptionValuesApi.html"
}, {
"fqsen": "\\BigCommerce\\ApiV3\\Api\\Catalog\\Products\\ProductOption\\ProductOptionValuesApi\u003A\u003AsetProductId\u0028\u0029",
@@ -7820,41 +7820,6 @@ Search.appendIndex(
"name": "features",
"summary": "",
"url": "classes/BigCommerce-ApiV2-ResourceModels-StoreInformation-StoreInformation.html#property_features"
- }, {
- "fqsen": "\\BigCommerce\\ApiV3\\WebDav\\Client",
- "name": "Client",
- "summary": "",
- "url": "classes/BigCommerce-ApiV3-WebDav-Client.html"
- }, {
- "fqsen": "\\BigCommerce\\ApiV3\\WebDav\\Client\u003A\u003A__construct\u0028\u0029",
- "name": "__construct",
- "summary": "",
- "url": "classes/BigCommerce-ApiV3-WebDav-Client.html#method___construct"
- }, {
- "fqsen": "\\BigCommerce\\ApiV3\\WebDav\\Client\u003A\u003AgetFileContents\u0028\u0029",
- "name": "getFileContents",
- "summary": "",
- "url": "classes/BigCommerce-ApiV3-WebDav-Client.html#method_getFileContents"
- }, {
- "fqsen": "\\BigCommerce\\ApiV3\\WebDav\\Client\u003A\u003AuploadFile\u0028\u0029",
- "name": "uploadFile",
- "summary": "",
- "url": "classes/BigCommerce-ApiV3-WebDav-Client.html#method_uploadFile"
- }, {
- "fqsen": "\\BigCommerce\\ApiV3\\WebDav\\Client\u003A\u003AgetUrl\u0028\u0029",
- "name": "getUrl",
- "summary": "",
- "url": "classes/BigCommerce-ApiV3-WebDav-Client.html#method_getUrl"
- }, {
- "fqsen": "\\BigCommerce\\ApiV3\\WebDav\\Client\u003A\u003AgetGuzzleClient\u0028\u0029",
- "name": "getGuzzleClient",
- "summary": "",
- "url": "classes/BigCommerce-ApiV3-WebDav-Client.html#method_getGuzzleClient"
- }, {
- "fqsen": "\\BigCommerce\\ApiV3\\WebDav\\Client\u003A\u003AprintDebug\u0028\u0029",
- "name": "printDebug",
- "summary": "",
- "url": "classes/BigCommerce-ApiV3-WebDav-Client.html#method_printDebug"
}, {
"fqsen": "\\",
"name": "\\",
@@ -8135,11 +8100,6 @@ Search.appendIndex(
"name": "Widget",
"summary": "",
"url": "namespaces/bigcommerce-apiv3-responsemodels-widget.html"
- }, {
- "fqsen": "\\BigCommerce\\ApiV3\\WebDav",
- "name": "WebDav",
- "summary": "",
- "url": "namespaces/bigcommerce-apiv3-webdav.html"
}, {
"fqsen": "\\BigCommerce\\ApiV2\\Api\\Generic",
"name": "Generic",
diff --git a/docs/namespaces/bigcommerce-apiv3-api-catalog-products-productoption.html b/docs/namespaces/bigcommerce-apiv3-api-catalog-products-productoption.html
index 6f1ce08c..65e12703 100644
--- a/docs/namespaces/bigcommerce-apiv3-api-catalog-products-productoption.html
+++ b/docs/namespaces/bigcommerce-apiv3-api-catalog-products-productoption.html
@@ -98,7 +98,7 @@
- ProductOptionValuesApi
- - V3ApiBase
+ - Referred to in the documentation as Product Variant Options Values
diff --git a/docs/namespaces/bigcommerce-apiv3.html b/docs/namespaces/bigcommerce-apiv3.html
index 63f97d3e..a34634ce 100644
--- a/docs/namespaces/bigcommerce-apiv3.html
+++ b/docs/namespaces/bigcommerce-apiv3.html
@@ -94,7 +94,6 @@
- Api
- ResourceModels
- ResponseModels
- - WebDav
diff --git a/docs/packages/BigCommerce.html b/docs/packages/BigCommerce.html
index 60b9da60..87546a22 100644
--- a/docs/packages/BigCommerce.html
+++ b/docs/packages/BigCommerce.html
@@ -141,7 +141,7 @@
+
+
+ Type |
+ Line |
+ Description |
+
+
+
+
+ |
+ 13 |
+ developer.bigcommerce.com/api-reference/store-management/catalog/product-variant-option-values/createoptionvalue |
+
+
Client.php
diff --git a/src/BigCommerce/Api/Catalog/Products/ProductOption/ProductOptionValuesApi.php b/src/BigCommerce/Api/Catalog/Products/ProductOption/ProductOptionValuesApi.php
index e3296b24..5e271d73 100644
--- a/src/BigCommerce/Api/Catalog/Products/ProductOption/ProductOptionValuesApi.php
+++ b/src/BigCommerce/Api/Catalog/Products/ProductOption/ProductOptionValuesApi.php
@@ -7,6 +7,12 @@
use BigCommerce\ApiV3\ResponseModels\Product\ProductOptionValueResponse;
use BigCommerce\ApiV3\ResponseModels\Product\ProductOptionValuesResponse;
+/**
+ * Referred to in the documentation as Product Variant Options Values
+ *
+ * https://developer.bigcommerce.com/api-reference/store-management/catalog/product-variant-option-values/createoptionvalue
+ *
+ */
class ProductOptionValuesApi extends ResourceApi
{
private int $productId;
diff --git a/src/BigCommerce/ResponseModels/OptionsResponse.php b/src/BigCommerce/ResponseModels/OptionsResponse.php
index acd56c4f..cb4841b6 100644
--- a/src/BigCommerce/ResponseModels/OptionsResponse.php
+++ b/src/BigCommerce/ResponseModels/OptionsResponse.php
@@ -7,23 +7,16 @@
class OptionsResponse extends PaginatedResponse
{
- /**
- * @var ProductOption[]
- */
- private array $options;
-
/**
* @return ProductOption[]
*/
public function getOptions(): array
{
- return $this->options;
+ return $this->getData();
}
- protected function addData(array $data): void
+ protected function resourceClass(): string
{
- $this->options = array_map(function (\stdClass $o) {
- return new ProductOption($o);
- }, $data);
+ return ProductOption::class;
}
}
diff --git a/tests/BigCommerce/Api/Catalog/Products/ProductOption/ProductOptionValuesApiTest.php b/tests/BigCommerce/Api/Catalog/Products/ProductOption/ProductOptionValuesApiTest.php
new file mode 100644
index 00000000..3001e4ad
--- /dev/null
+++ b/tests/BigCommerce/Api/Catalog/Products/ProductOption/ProductOptionValuesApiTest.php
@@ -0,0 +1,30 @@
+setReturnData('catalog__products__1__options__2__values__create.json');
+ $productId = 1;
+ $optionId = 2;
+
+ $optionValue = new ProductOptionValue();
+ $optionValue->sort_order = 2;
+ $optionValue->is_default = true;
+ $optionValue->label = 'Colors';
+ $optionValue->value_data = (object)[
+ "colors" => ["#123c91, #FFFF00, #397a44"]
+ ];
+
+ $productOptionValuesApi = $this->getApi()->catalog()->product($productId)->option($optionId)->values();
+ $this->assertEquals($productId, $productOptionValuesApi->getProductId(), 'Product ID not set correctly');
+ $this->assertEquals($optionId, $productOptionValuesApi->getParentResourceId(), 'Option ID not set correctly');
+ $productOptionValuesApi->create($optionValue);
+ $this->assertEquals("catalog/products/{$productId}/options/{$optionId}/values", $this->getLastRequestPath());
+ }
+}
diff --git a/tests/BigCommerce/responses/catalog__products__1__options__2__values__create.json b/tests/BigCommerce/responses/catalog__products__1__options__2__values__create.json
new file mode 100644
index 00000000..e6f301a6
--- /dev/null
+++ b/tests/BigCommerce/responses/catalog__products__1__options__2__values__create.json
@@ -0,0 +1,13 @@
+{
+ "data": {
+ "id": 44,
+ "label": "Pick a color",
+ "sort_order": 9,
+ "value_data": {
+ "colors": [
+ "#123c91, #FFFF00, #397a44"
+ ]
+ },
+ "is_default": false
+ }
+}