Create new product | Moov Documentation
Create new product
Creates a new product for the specified account.
Request Format
POST /accounts/{accountID}/products
Example Request
curl -X POST "https://api.moov.io/accounts/{accountID}/products" \
-H "Authorization: Bearer {token}" \
-H "X-Moov-Version: v2026.04.00" \
-d '{
"title": "World'\'s best lemonade",
"description": "Really, the best.",
"basePrice": {
"valueDecimal": "4.99",
"currency": "USD"
},
"images": [
{"imageID": "fed91252-6f48-4b70-885e-520bf53a52ff"},
{"imageID": "eb466644-0a58-4b87-af1e-94d03e223ad2"}
],
"optionGroups": [
{
"name": "Flavor add-ins",
"description": "Choose up to 3 flavor add-ins to enhance your lemonade.",
"minSelect": 0,
"maxSelect": 3,
"options": [
{
"name": "Strawberry puree",
"description": "Fresh and fruity.",
"priceModifier": {"valueDecimal": "0.99", "currency": "USD"},
"images": [{"imageID": "d359808d-9896-4414-8d17-dac43f35842d"}]
},
{"name": "Passionfruit syrup", "priceModifier": {"valueDecimal": "0.49", "currency": "USD"}},
{"name": "Cherry syrup", "priceModifier": {"valueDecimal": "0.49", "currency": "USD"}}
]
},
{
"name": "Sweetener",
"description": "Choose a sweetener for your lemonade.",
"minSelect": 1,
"maxSelect": 1,
"options": [
{"name": "Cane Sugar"},
{"name": "Honey", "priceModifier": {"valueDecimal": "0.99", "currency": "USD"}},
{"name": "Stevia", "description": "Natural, zero-calorie sweetener."}
]
}
]
}'
Example Code Snippets
TypeScript
import { Moov } from "@moovio/sdk";
const moov = new Moov({
security: {
username: "",
password: "",
},
});
async function run() {
const result = await moov.products.create({
accountID: "27cd3181-7c1c-4d81-b020-e7d55c33941f",
productRequest: {
title: "World's best lemonade",
description: "Really, the best.",
basePrice: {
currency: "USD",
valueDecimal: "4.99",
},
images: [{imageID: "fed91252-6f48-4b70-885e-520bf53a52ff"}, {imageID: "eb466644-0a58-4b87-af1e-94d03e223ad2"}],
optionGroups: [{
name: "Flavor add-ins",
description: "Choose up to 3 flavor add-ins to enhance your lemonade.",
minSelect: 0,
maxSelect: 3,
options: [{
name: "Strawberry puree",
description: "Fresh and fruity.",
priceModifier: { currency: "USD", valueDecimal: "0.99" },
images: [{ imageID: "d359808d-9896-4414-8d17-dac43f35842d" }]
},
{name: "Passionfruit syrup", priceModifier: { currency: "USD", valueDecimal: "0.49"}},
{name: "Cherry syrup", priceModifier: { currency: "USD", valueDecimal: "0.49"}}]
},
{
name: "Sweetener",
description: "Choose a sweetener for your lemonade.",
minSelect: 1,
maxSelect: 1,
options: [{name: "Cane Sugar"}, {name: "Honey", priceModifier: { currency: "USD", valueDecimal: "0.99" }}, {name: "Stevia", description: "Natural, zero-calorie sweetener."}]
}]
},
});
console.log(result);
}
run();
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: 'World\'s best lemonade',
description: 'Really, the best.',
basePrice: new Components\AmountDecimal(
currency: 'USD',
valueDecimal: '4.99',
),
images: [new Components\AssignProductImage(imageID: 'fed91252-6f48-4b70-885e-520bf53a52ff'), new Components\AssignProductImage(imageID: 'eb466644-0a58-4b87-af1e-94d03e223ad2')],
optionGroups: [new Components\CreateProductOptionGroup(
name: 'Flavor add-ins',
description: 'Choose up to 3 flavor add-ins to enhance your lemonade.',
minSelect: 0,
maxSelect: 3,
options: [new Components\CreateProductOption(
name: 'Strawberry puree',
description: 'Fresh and fruity.',
priceModifier: new Components\AmountDecimal(currency: 'USD', valueDecimal: '0.99'),
images: [new Components\AssignProductImage(imageID: 'd359808d-9896-4414-8d17-dac43f35842d')],
), new Components\CreateProductOption(
name: 'Passionfruit syrup',
priceModifier: new Components\AmountDecimal(currency: 'USD', valueDecimal: '0.49'),
), new Components\CreateProductOption(
name: 'Cherry syrup',
priceModifier: new Components\AmountDecimal(currency: 'USD', valueDecimal: '0.49'),
)]
), new Components\CreateProductOptionGroup(
name: 'Sweetener',
description: 'Choose a sweetener for your lemonade.',
minSelect: 1,
maxSelect: 1,
options: [new Components\CreateProductOption(name: 'Cane Sugar'), new Components\CreateProductOption(name: 'Honey', priceModifier: new Components\AmountDecimal(currency: 'USD', valueDecimal: '0.99')), new Components\CreateProductOption(name: 'Stevia', description: 'Natural, zero-calorie sweetener.')]
),],
);
$response = $sdk->products->create(accountID: '27cd3181-7c1c-4d81-b020-e7d55c33941f', productRequest: $productRequest);
if ($response->product !== null) {
// handle response
}
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.CreateProductResponse;
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();
CreateProductResponse res = sdk.products().create()
.accountID("27cd3181-7c1c-4d81-b020-e7d55c33941f")
.productRequest(ProductRequest.builder()
.title("World's best lemonade")
.basePrice(AmountDecimal.builder()
.currency("USD")
.valueDecimal("4.99")
.build())
.description("Really, the best.")
.images(List.of(
AssignProductImage.builder()
.imageID("fed91252-6f48-4b70-885e-520bf53a52ff")
.build(),
AssignProductImage.builder()
.imageID("eb466644-0a58-4b87-af1e-94d03e223ad2")
.build()))
.optionGroups(List.of(
CreateProductOptionGroup.builder()
.name("Flavor add-ins")
.minSelect(0)
.maxSelect(3)
.options(List.of(
CreateProductOption.builder()
.name("Strawberry puree")
.description("Fresh and fruity.")
.priceModifier(AmountDecimal.builder()
.currency("USD")
.valueDecimal("0.99")
.build())
.images(List.of(
AssignProductImage.builder()
.imageID("d359808d-9896-4414-8d17-dac43f35842d")
.build()))
.build(),
CreateProductOption.builder()
.name("Passionfruit syrup")
.priceModifier(AmountDecimal.builder()
.currency("USD")
.valueDecimal("0.49")
.build())
.build(),
CreateProductOption.builder()
.name("Cherry syrup")
.priceModifier(AmountDecimal.builder()
.currency("USD")
.valueDecimal("0.49")
.build())
.build()))
.description("Choose up to 3 flavor add-ins to enhance your lemonade.")
.build(),
CreateProductOptionGroup.builder()
.name("Sweetener")
.minSelect(1)
.maxSelect(1)
.options(List.of(
CreateProductOption.builder()
.name("Cane Sugar")
.build(),
CreateProductOption.builder()
.name("Honey")
.priceModifier(AmountDecimal.builder()
.currency("USD")
.valueDecimal("0.99")
.build())
.build(),
CreateProductOption.builder()
.name("Stevia")
.description("Natural, zero-calorie sweetener.")
.build()))
.description("Choose a sweetener for your lemonade.")
.build()))
.build())
.call();
if (res.product().isPresent()) {
System.out.println(res.product().get());
}
}
}
Python
from moovio_sdk import Moov
from moovio_sdk.models import components
with Moov(
security=components.Security(
username="",
password="",
),
) as moov:
res = moov.products.create(account_id="27cd3181-7c1c-4d81-b020-e7d55c33941f", title="World's best lemonade", base_price={
"currency": "USD",
"value_decimal": "4.99",
}, description="Really, the best.", images=[
{"image_id": "fed91252-6f48-4b70-885e-520bf53a52ff"},
{"image_id": "eb466644-0a58-4b87-af1e-94d03e223ad2"},
], option_groups=[
{
"name": "Flavor add-ins",
"description": "Choose up to 3 flavor add-ins to enhance your lemonade.",
"min_select": 0,
"max_select": 3,
"options": [
{
"name": "Strawberry puree",
"description": "Fresh and fruity.",
"price_modifier": {
"currency": "USD",
"value_decimal": "0.99",
},
"images": [{"image_id": "d359808d-9896-4414-8d17-dac43f35842d"}],
},
{"name": "Passionfruit syrup", "price_modifier": {"currency": "USD", "value_decimal": "0.49"}},
{"name": "Cherry syrup", "price_modifier": {"currency": "USD", "value_decimal": "0.49"}},
],
},
{
"name": "Sweetener",
"description": "Choose a sweetener for your lemonade.",
"min_select": 1,
"max_select": 1,
"options": [
{"name": "Cane Sugar"},
{"name": "Honey", "price_modifier": {"currency": "USD", "value_decimal": "0.99"}},
{"name": "Stevia", "description": "Natural, zero-calorie sweetener."},
],
},
])
# Handle response
print(res)
Ruby
require 'moov_ruby'
Models = ::Moov::Models
s = ::Moov::Client.new(
security: Models::Components::Security.new(
username: '',
password: ''
)
)
res = s.products.create(account_id: '27cd3181-7c1c-4d81-b020-e7d55c33941f', product_request: Models::Components::ProductRequest.new(
title: 'World\'s best lemonade',
description: 'Really, the best.',
base_price: Models::Components::AmountDecimal.new(
currency: 'USD',
value_decimal: '4.99'
),
images: [Models::Components::AssignProductImage.new(image_id: 'fed91252-6f48-4b70-885e-520bf53a52ff'), Models::Components::AssignProductImage.new(image_id: 'eb466644-0a58-4b87-af1e-94d03e223ad2')],
option_groups: [Models::Components::CreateProductOptionGroup.new(
name: 'Flavor add-ins',
description: 'Choose up to 3 flavor add-ins to enhance your lemonade.',
min_select: 0,
max_select: 3,
options: [Models::Components::CreateProductOption.new(
name: 'Strawberry puree',
description: 'Fresh and fruity.',
price_modifier: Models::Components::AmountDecimal.new(currency: 'USD', value_decimal: '0.99'),
images: [Models::Components::AssignProductImage.new(image_id: 'd359808d-9896-4414-8d17-dac43f35842d')],
), Models::Components::CreateProductOption.new(
name: 'Passionfruit syrup',
price_modifier: Models::Components::AmountDecimal.new(currency: 'USD', value_decimal: '0.49')
), Models::Components::CreateProductOption.new(
name: 'Cherry syrup',
price_modifier: Models::Components::AmountDecimal.new(currency: 'USD', value_decimal: '0.49')
)],
), Models::Components::CreateProductOptionGroup.new(
name: 'Sweetener',
description: 'Choose a sweetener for your lemonade.',
min_select: 1,
max_select: 1,
options: [Models::Components::CreateProductOption.new(
name: 'Cane Sugar'
), Models::Components::CreateProductOption.new(
name: 'Honey',
price_modifier: Models::Components::AmountDecimal.new(currency: 'USD', value_decimal: '0.99')
), Models::Components::CreateProductOption.new(
name: 'Stevia',
description: 'Natural, zero-calorie sweetener.'
)]
)]
))
unless res.product.nil?
# handle response
end
C#
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.CreateAsync(
accountID: "27cd3181-7c1c-4d81-b020-e7d55c33941f",
body: new ProductRequest() {
Title = "World's best lemonade",
Description = "Really, the best.",
BasePrice = new AmountDecimal() {
Currency = "USD",
ValueDecimal = "4.99",
},
Images = new List<AssignProductImage>() {
new AssignProductImage() {
ImageID = "fed91252-6f48-4b70-885e-520bf53a52ff",
},
new AssignProductImage() {
ImageID = "eb466644-0a58-4b87-af1e-94d03e223ad2",
},
},
OptionGroups = new List<CreateProductOptionGroup>() {
new CreateProductOptionGroup() {
Name = "Flavor add-ins",
Description = "Choose up to 3 flavor add-ins to enhance your lemonade.",
MinSelect = 0,
MaxSelect = 3,
Options = new List<CreateProductOption>() {
new CreateProductOption() {
Name = "Strawberry puree",
Description = "Fresh and fruity.",
PriceModifier = new AmountDecimal() {
Currency = "USD",
ValueDecimal = "0.99",
},
Images = new List<AssignProductImage>() {
new AssignProductImage() {
ImageID = "d359808d-9896-4414-8d17-dac43f35842d",
},
},
},
new CreateProductOption() {
Name = "Passionfruit syrup",
PriceModifier = new AmountDecimal() {
Currency = "USD",
ValueDecimal = "0.49",
},
},
new CreateProductOption() {
Name = "Cherry syrup",
PriceModifier = new AmountDecimal() {
Currency = "USD",
ValueDecimal = "0.49",
},
},
},
},
new CreateProductOptionGroup() {
Name = "Sweetener",
Description = "Choose a sweetener for your lemonade.",
MinSelect = 1,
MaxSelect = 1,
Options = new List<CreateProductOption>() {
new CreateProductOption() {
Name = "Cane Sugar",
},
new CreateProductOption() {
Name = "Honey",
PriceModifier = new AmountDecimal() {
Currency = "USD",
ValueDecimal = "0.99",
},
},
new CreateProductOption() {
Name = "Stevia",
Description = "Natural, zero-calorie sweetener.",
},
},
},
},
}
);
// handle response