Update a product and options
curl -X PUT "https://api.moov.io/accounts/{accountID}/products/{productID}" \
-H "Authorization: Bearer {token}" \
--data '{
"basePrice": {
"currency": "USD",
"valueDecimal": "15.05"
},
"title": "Monday lunch special 1",
"description": "Sandwich, chips, latte",
"images": [
{
"imageID": "bbdcb050-2e05-43cb-812a-e1296cd0c01a"
}
],
"optionGroups": [
{
"description": "Alternative milk options",
"name": "Milk options",
"options": [
{
"description": "Fancy brand soy milk",
"images": [
{
"imageID": "bbdcb050-2e05-43cb-812a-e1296cd0c01a"
}
],
"name": "Oat milk",
"priceModifier": {
"currency": "USD",
"valueDecimal": "1.05"
}
},
{
"description": "Fancy brand coffee milk",
"images": [
{
"imageID": "bbdcb050-2e05-43cb-812a-e1296cd0c01b"
}
],
"name": "Almond milk",
"priceModifier": {
"currency": "USD",
"valueDecimal": "1.05"
}
}
]
}
]
}'\
using Moov.Sdk;
using Moov.Sdk.Models.Components;
using System.Collections.Generic;
var sdk = new MoovClient(xMoovVersion: "<value>");
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 responsepackage 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()
.xMoovVersion("v2024.01.00")
.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()) {
// handle response
}
}
}require 'moov_ruby'
Models = ::Moov::Models
s = ::Moov::Client.new(
x_moov_version: 'v2024.01.00',
)
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
endimport { Moov } from "@moovio/sdk";
const moov = new Moov({
xMoovVersion: "v2024.01.00",
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();declare(strict_types=1);
require 'vendor/autoload.php';
use Moov\MoovPhp;
use Moov\MoovPhp\Models\Components;
$sdk = MoovPhp\Moov::builder()
->setXMoovVersion('v2024.01.00')
->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
}from moovio_sdk import Moov
from moovio_sdk.models import components
with Moov(
x_moov_version="v2024.01.00",
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){
"productID": "string",
"title": "string",
"description": "string",
"basePrice": {
"currency": "USD",
"valueDecimal": "12.987654321"
},
"optionGroups": [
{
"name": "string",
"description": "string",
"minSelect": 0,
"maxSelect": 1,
"options": [
{
"name": "string",
"description": "string",
"priceModifier": {
"currency": "USD",
"valueDecimal": "12.987654321"
},
"images": [
{
"imageID": "string",
"altText": "string",
"link": "https://api.moov.io/images/q7lKWleAy9fUNhEGezQ1g",
"publicID": "q7lKWleAy9fUNhEGezQ1g"
}
]
}
]
}
],
"images": [
{
"imageID": "string",
"altText": "string",
"link": "https://api.moov.io/images/q7lKWleAy9fUNhEGezQ1g",
"publicID": "q7lKWleAy9fUNhEGezQ1g"
}
],
"createdOn": "2019-08-24T14:15:22Z",
"updatedOn": "2019-08-24T14:15:22Z",
"disabledOn": "2019-08-24T14:15:22Z"
}Response headers
x-request-id
string
required
{
"error": "string"
}Response headers
x-request-id
string
required
Response headers
x-request-id
string
required
Response headers
x-request-id
string
required
Response headers
x-request-id
string
required
{
"error": "string"
}Response headers
x-request-id
string
required
{
"title": "string",
"description": "string",
"basePrice": {
"currency": "string",
"valueDecimal": "string"
},
"images": {
"property1": {
"imageID": "string"
},
"property2": {
"imageID": "string"
}
},
"optionGroups": {
"property1": {
"name": "string",
"description": "string",
"minSelect": "string",
"maxSelect": "string",
"options": {
"property1": {
"name": "string",
"description": "string",
"priceModifier": {
"currency": "string",
"valueDecimal": "string"
},
"images": {
"property1": {
"imageID": "string"
},
"property2": {
"imageID": "string"
}
}
},
"property2": {
"name": "string",
"description": "string",
"priceModifier": {
"currency": "string",
"valueDecimal": "string"
},
"images": {
"property1": {
"imageID": "string"
},
"property2": {
"imageID": "string"
}
}
}
}
},
"property2": {
"name": "string",
"description": "string",
"minSelect": "string",
"maxSelect": "string",
"options": {
"property1": {
"name": "string",
"description": "string",
"priceModifier": {
"currency": "string",
"valueDecimal": "string"
},
"images": {
"property1": {
"imageID": "string"
},
"property2": {
"imageID": "string"
}
}
},
"property2": {
"name": "string",
"description": "string",
"priceModifier": {
"currency": "string",
"valueDecimal": "string"
},
"images": {
"property1": {
"imageID": "string"
},
"property2": {
"imageID": "string"
}
}
}
}
}
}
}Response headers
x-request-id
string
required
Response headers
x-request-id
string
required
Response headers
x-request-id
string
required
Response headers
x-request-id
string
required
Headers
X-Moov-Version
string
Specify an API version.
API versioning follows the format vYYYY.QQ.BB, where
YYYYis the yearQQis the two-digit month for the first month of the quarter (e.g., 01, 04, 07, 10)BBis the build number, starting at.01, for subsequent builds in the same quarter.- For example,
v2024.01.00is the initial release of the first quarter of 2024.
- For example,
The latest version represents the most recent development state. It may include breaking changes and should be treated as a beta release.
When no version is specified, the API defaults to v2024.01.00.
Path parameters
accountID
string
required
productID
string
required
Body
basePrice
object
required
Show child attributes
currency
string
required
Pattern
valueDecimal
string
required
Pattern
A decimal-formatted numerical string that represents up to 9 decimal place precision.
For example, $12.987654321 is '12.987654321'.
title
string
<=150 characters
required
description
string
<=5000 characters
A detailed description of the product.
- Must be valid UTF-8 text
- Supports Markdown for formatting
- HTML is not permitted and will be rejected
images
array<object>
Show child attributes
imageID
string
optionGroups
array<object>
Show child attributes
description
string
<=500 characters
A detailed description of the option group.
- Must be valid UTF-8 text
- Supports Markdown for formatting
- HTML is not permitted and will be rejected
maxSelect
integer<int32>
minSelect
integer<int32>
The minimum number of options that must be selected from this group.
A value of 0 indicates that no selection from this group is required.
name
string
<=100 characters
options
array<object>
Show child attributes
description
string
<=500 characters
A detailed description of the option.
- Must be valid UTF-8 text
- Supports Markdown for formatting
- HTML is not permitted and will be rejected
images
array<object>
name
string
[1 to 100] characters
priceModifier
object
Show child attributes
currency
string
required
Pattern
valueDecimal
string
required
Pattern
A decimal-formatted numerical string that represents up to 9 decimal place precision.
For example, $12.987654321 is '12.987654321'.
Response
basePrice
object
required
Show child attributes
currency
string
required
Pattern
valueDecimal
string
required
Pattern
A decimal-formatted numerical string that represents up to 9 decimal place precision.
For example, $12.987654321 is '12.987654321'.
createdOn
string<date-time>
required
productID
string
required
title
string
<=150 characters
required
updatedOn
string<date-time>
required
description
string
<=5000 characters
A detailed description of the product.
- Must be valid UTF-8 text
- Supports Markdown for formatting
- HTML is not permitted and will be rejected
disabledOn
string<date-time>
images
array<object>
optionGroups
array<object>
Show child attributes
description
string
<=500 characters
A detailed description of the option group.
- Must be valid UTF-8 text
- Supports Markdown for formatting
- HTML is not permitted and will be rejected
maxSelect
integer<int32>
minSelect
integer<int32>
The minimum number of options that must be selected from this group.
A value of 0 indicates that no selection from this group is required.
name
string
<=100 characters
options
array<object>
Show child attributes
description
string
<=500 characters
A detailed description of the option.
- Must be valid UTF-8 text
- Supports Markdown for formatting
- HTML is not permitted and will be rejected
images
array<object>
Show child attributes
altText
string
<=125 characters
imageID
string
link
string<uri>
publicID
string
name
string
[1 to 100] characters
priceModifier
object
Show child attributes
currency
string
required
Pattern
valueDecimal
string
required
Pattern
A decimal-formatted numerical string that represents up to 9 decimal place precision.
For example, $12.987654321 is '12.987654321'.