# Product catalog

Build a product catalog to use across transfers and payment links.

Use the [product API](/api/tools/products/) to create a product catalog for transfers and payment links. For each product, you can specify an image, title, description, and base price. You can also set additional option groups like size and color, each with their own images and additional price modifiers.

For example, a cafe has a product catalog that contains each of the drinks on their menu. Each drink product has an option group set up for alternative milk choices which adds a price modifier to the overall cost.

## [Create a product](#create-a-product)

To create a new product for the catalog, pass the `accountID` and specify a title and base price. Additionally, you can specify a description, an image, and option groups. The example below creates a lunch special with an option group that has price modifications for alternative milks.

You can [upload and store](#upload-and-store-images) images with Moov.

[cURL](#tab-921635784-1-0)

```zsh
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"
            }
          }
        ]
      }
    ]
  }'\
```

If you want to use a product you've created, you'll need to use the [product API](/api/tools/products/) to retrieve product data and map it to `lineItems` when creating transfers and payment links. You can, however, create freeform line items when initiating a transfer or payment link.

## [Manage products](#manage-products)

Once a product catalog has been created, you can retrieve, update, and disable products.

### [List products](#list-products)

You can list all active products, or retrieve a single active or disabled product.

[cURL - Get active product list](#tab-347956281-2-0) [cURL - Get a product](#tab-347956281-2-1)

This endpoint will only return active products.

```zsh
curl -X GET "https://api.moov.io/accounts/{accountID}/products" \
  -H "Authorization: Bearer {token}" \
```

This endpoint will retrieve an active or disabled product.

```zsh
curl -X GET "https://api.moov.io/accounts/{accountID}/products/{productID}" \
  -H "Authorization: Bearer {token}" \
```

### [Update a product](#update-a-product)

Every part of a product and its options can be updated. Updating a product initiates a complete replacement of the product model, so while only the title and base price are required, any omitted fields will be removed from the model if not included in the update request.

```zsh
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"
            }
          }
        ]
      }
    ]
  }'\
```

### [Disable a product](#disable-a-product)

A disabled product remains in the system for historical and reporting purposes. To disable a product, pass the `accountID` and `productID`.

[cURL](#tab-126743589-4-0)

```zsh
curl -X DELETE "https://api.moov.io/accounts/{accountID}/products/{productID}" \
  -H "Authorization: Bearer {token}" \
```

## [Upload and store images](#upload-and-store-images)

Use the [images API](/api/tools/images/) to upload a PNG, JPG, or WebP image. You can supply alt-text through the `metadata` field. Duplicate images and images larger than 16MB will be rejected.

When you upload an image, you'll receive a `imageID`, which can be used to point to the image when you create or update a product.

[cURL](#tab-548291367-5-0)

```zsh
curl -X POST "https://api.moov.io/accounts/{accountID}/images" \
  -H "Authorization: Bearer {token}" \
  --data '{
    "image": "00010101011111000101010110",
    "metadata": {
      "altText": "Blue oat milk carton by Fancy Brand"
    }
  }'\
```

View the [images](/guides/accounts/image-collection) guide for more information.
