Back to Website
Show / Hide Table of Contents

Managing PIM product variants

  • Last updated on September 15, 2025
  • •
  • 1 minute to read

You can manage PIM product variants programmatically, including setting their availability, price, and SKU. This article explains how to perform these operations using the BackOffice API.

Using the API

Before you start, ensure your app has the necessary credentials to make API calls:

  1. In your tenant, go to Settings > External apps and register your app.
  2. Implement authentication in your app as described in the Authorization article.

C# API Client

To use the C# API client, initialize it with the required configuration:

var httpClient = new HttpClient();
var backOfficeApiConfiguration = new Aurigma.BackOfficeApi.ApiClientConfiguration()
{
    ApiUrl = BACKOFFICE_API_URL,
    AuthorizationToken = AUTH_TOKEN
};
var productsApiClient = new ProductsManagementApiClient(backOfficeApiConfiguration, httpClient);

Managing PIM Product Variants

To manage PIM product variants:

  1. Retrieve the list of all product variants.
  2. Set the price, availability, and SKU for the variants.

Example

// Get all product variants
var productVariants = await productsApiClient.GetProductVariantsAsync(tenantId: TENANT_ID, id: PRODUCT_ID);

// Set product variants price
await productsApiClient.SetProductVariantPriceAsync(
    tenantId: TENANT_ID,
    id: PRODUCT_ID,
    body: new SetProductVariantPriceDto()
    {
        Items = new List<ProductVariantPriceDto>()
        {
            new ProductVariantPriceDto()
            {
                Price = 10.0,
                VariantUIDs = productVariants.Items.Select(x => x.Uid).ToList()
            }
        }
    });

// Set product variants availability
await productsApiClient.SetProductVariantAvailabilityAsync(
    tenantId: TENANT_ID,
    id: PRODUCT_ID,
    body: new SetProductVariantAvailabilityDto()
    {
        Items = new List<ProductVariantAvailabilityDto>()
        {
            new ProductVariantAvailabilityDto()
            {
                Availability = false,
                VariantUIDs = productVariants.Items.Select(x => x.Uid).ToList()
            }
        }
    });

// Set product variants SKU
await productsApiClient.SetProductVariantSkuAsync(
    tenantId: TENANT_ID,
    id: PRODUCT_ID,
    body: new SetProductVariantSkuDto()
    {
        Items = productVariants.Items
            .Select(x => new ProductVariantSkuDto()
            {
                Sku = $"{x.Sku} v2",
                VariantUIDs = [x.Uid]
            })
            .ToList()
    });
Important

The SetProductVariantPriceAsync, SetProductVariantAvailabilityAsync, and SetProductVariantSkuAsync methods force the product to create a new version. After calling these methods, you need to retrieve the updated variants again if you want to use their IDs.

Was this page helpful?
Thanks for your feedback!
Back to top Copyright © 2001–2025 Aurigma, Inc. All rights reserved.
Loading...
    Thank for your vote
    Your opinion is important to us. To provide details, send feedback.
    Send feedback