# Update a product and options

Update a product and its options.

## Request

### PUT

/accounts/{accountID}/products/{productID}

### Example Request in Shell

```shell
curl -X PUT "https://api.moov.io/accounts/{accountID}/products/{productID}" \
  -H "Authorization: Bearer {token}" \
  -H "X-Moov-Version: v2026.07.00" \
  -d '{\n  "title": "string",\n  "basePrice": {\n    "currency": "USD",\n    "valueDecimal": "12.987654321"\n  }\n}'
```

### Example Request in TypeScript

```typescript
import { Moov } from "@moovio/sdk";

const moov = new Moov({
  security: {
    username: "",
    password: "",
  },
});

async function run() {
  const result = await moov.products.update({
    accountID: "7a7b55ed-d90d-4e83-a8f6-f146eaebd0cc",
    productID: "fa407877-3b46-4484-814e-65b147d76a9e",
    productRequest: {
      title: "<value>",
      basePrice: {
        currency: "USD",
        valueDecimal: "12.987654321",
      },
      optionGroups: [\
        {\
          name: "<value>",\
          minSelect: 328576,\
          maxSelect: 430951,\
          options: [],\
        },\
      ],
    },
  });

console.log(result);
}

run();
```

### Example Request in PHP

```php
declare(strict_types=1);

require 'vendor/autoload.php';

use Moov\MoovPhp;
use Moov\MoovPhp\Models\Components;

$sdk = MoovPhp\Moov::builder()
    ->setSecurity(
        new Components\Security(
            username: '',
            password: '',
        )
    )
    ->build();

$productRequest = new Components\ProductRequest(
    title: '<value>',
    basePrice: new Components\AmountDecimal(
        currency: 'USD',
        valueDecimal: '12.987654321',
    ),
    optionGroups: [\
        new Components\CreateProductOptionGroup(\
            name: '<value>',\
            minSelect: 328576,\
            maxSelect: 430951,\
            options: [],\
        ),\
    ],
);

$response = $sdk->products->update(
    accountID: '7a7b55ed-d90d-4e83-a8f6-f146eaebd0cc',
    productID: 'fa407877-3b46-4484-814e-65b147d76a9e',
    productRequest: $productRequest
);

if ($response->product !== null) {
    // handle response
}
```

### Example Request in Java

```java
package hello.world;

import io.moov.sdk.Moov;
import io.moov.sdk.models.components.*;
import io.moov.sdk.models.errors.GenericError;
import io.moov.sdk.models.errors.ProductRequestValidationError;
import io.moov.sdk.models.operations.UpdateProductResponse;
import java.lang.Exception;
import java.util.List;

public class Application {

public static void main(String[] args) throws GenericError, ProductRequestValidationError, Exception {

Moov sdk = Moov.builder()
                .security(Security.builder()
                    .username("")
                    .password("")
                    .build())
            .build();

UpdateProductResponse res = sdk.products().update()
                .accountID("7a7b55ed-d90d-4e83-a8f6-f146eaebd0cc")
                .productID("fa407877-3b46-4484-814e-65b147d76a9e")
                .productRequest(ProductRequest.builder()
                    .title("<value>")
                    .basePrice(AmountDecimal.builder()
                        .currency("USD")
                        .valueDecimal("12.987654321")
                        .build())
                    .optionGroups(List.of(
                        CreateProductOptionGroup.builder()
                            .name("<value>")
                            .minSelect(328576)
                            .maxSelect(430951)
                            .options(List.of())
                            .build()))
                    .build())
                .call();

if (res.product().isPresent()) {
            System.out.println(res.product().get());
        }
    }
}
```

### Example Request in Python

```python
from moovio_sdk import Moov
from moovio_sdk.models import components

with Moov(
    security=components.Security(
        username="",
        password="",
    ),
) as moov:

res = moov.products.update(account_id="7a7b55ed-d90d-4e83-a8f6-f146eaebd0cc", product_id="fa407877-3b46-4484-814e-65b147d76a9e", title="<value>", base_price={
        "currency": "USD",
        "value_decimal": "12.987654321",
    }, option_groups=[\
        {\
            "name": "<value>",\
            "min_select": 328576,\
            "max_select": 430951,\
            "options": [],\
        },\
    ])

# Handle response
    print(res)
```

### Example Request in Ruby

```ruby
require 'moov_ruby'

Models = ::Moov::Models
s = ::Moov::Client.new(
  security: Models::Components::Security.new(
    username: '',
    password: ''
  )
)
res = s.products.update(account_id: '7a7b55ed-d90d-4e83-a8f6-f146eaebd0cc', product_id: 'fa407877-3b46-4484-814e-65b147d76a9e', product_request: Models::Components::ProductRequest.new(
  title: '<value>',
  base_price: Models::Components::AmountDecimal.new(
    currency: 'USD',
    value_decimal: '12.987654321'
  ),
  option_groups: [\
    Models::Components::CreateProductOptionGroup.new(\
      name: '<value>',\
      min_select: 328_576,\
      max_select: 430_951,\
      options: []\
    ),\
  ]
))

unless res.product.nil?
  # handle response
end
```

### Example Request in C#

```csharp
using Moov.Sdk;
using Moov.Sdk.Models.Components;
using System.Collections.Generic;

var sdk = new MoovClient(security: new Security() {
    Username = "",
    Password = "",
});

var res = await sdk.Products.UpdateAsync(
    accountID: "7a7b55ed-d90d-4e83-a8f6-f146eaebd0cc",
    productID: "fa407877-3b46-4484-814e-65b147d76a9e",
    body: new ProductRequest() {
        Title = "<value>",
        BasePrice = new AmountDecimal() {
            Currency = "USD",
            ValueDecimal = "12.987654321",
        },
        OptionGroups = new List<CreateProductOptionGroup>() {
            new CreateProductOptionGroup() {
                Name = "<value>",
                MinSelect = 328576,
                MaxSelect = 430951,
                Options = new List<CreateProductOption>() {},
            },
        },
    }
);

// handle response
```

## Response

The request completed successfully.
