Create new product
curl -X POST "https://api.moov.io/accounts/{accountID}/products" \
-H "Authorization: Bearer {token}" \
--data '{
"basePrice": {
"currency": "USD",
"valueDecimal": "14.95"
},
"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 oat milk",
"images": [
{
"imageID": "bbdcb050-2e05-43cb-812a-e1296cd0c01a"
}
],
"name": "Oat milk",
"priceModifier": {
"currency": "USD",
"valueDecimal": "1.00"
}
},
{
"description": "Fancy brand almond milk",
"images": [
{
"imageID": "bbdcb050-2e05-43cb-812a-e1296cd0c01b"
}
],
"name": "Almond milk",
"priceModifier": {
"currency": "USD",
"valueDecimal": "1.00"
}
}
]
}
]
}'\
using Moov.Sdk;
using Moov.Sdk.Models.Components;
using System.Collections.Generic;
var sdk = new MoovClient(xMoovVersion: "<value>");
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 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.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()
.xMoovVersion("v2024.01.00")
.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()) {
// handle response
}
}
}require 'moov_ruby'
Models = ::Moov::Models
s = ::Moov::Client.new(
x_moov_version: 'v2024.01.00',
)
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
endimport { Moov } from "@moovio/sdk";
const moov = new Moov({
xMoovVersion: "v2024.01.00",
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();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: '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
}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.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){
"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
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'.