> ## Documentation Index
> Fetch the complete documentation index at: https://nayax-44d6e37b-docs-marshall-faq-redistribution.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Operator Products

export const EndpointCard = ({method = "API", title, children, href, arrow = true}) => {
  const METHOD_STYLES = {
    GET: {
      bg: "mint-bg-green-400/20 dark:mint-bg-green-400/20",
      text: "mint-text-green-700 dark:mint-text-green-400",
      border: "mint-border-green-300 dark:mint-border-green-700"
    },
    POST: {
      bg: "mint-bg-blue-400/20 dark:mint-bg-blue-400/20",
      text: "mint-text-blue-700 dark:mint-text-blue-400"
    },
    PUT: {
      bg: "mint-bg-yellow-400/20 dark:mint-bg-yellow-400/20",
      text: "mint-text-yellow-700 dark:mint-text-yellow-400"
    },
    PATCH: {
      bg: "mint-bg-orange-400/20 dark:mint-bg-orange-400/20",
      text: "mint-text-orange-700 dark:mint-text-orange-400"
    },
    DELETE: {
      bg: "mint-bg-red-400/20 dark:mint-bg-red-400/20",
      text: "mint-text-red-700 dark:mint-text-red-400"
    },
    API: {
      bg: "mint-bg-black",
      text: "mint-text-white"
    }
  };
  const MethodBadge = ({method}) => {
    const style = METHOD_STYLES[method?.toUpperCase()] ?? METHOD_STYLES.GET;
    return <span className={`
          method-pill rounded-lg font-bold px-1.5 py-0.5 text-xs leading-5 ${style.bg} ${style.text}`}>
        {method?.toUpperCase()}
      </span>;
  };
  const content = <div className="group flex items-center gap-4 border border-gray-200 dark:border-gray-700 rounded-xl p-5 bg-white dark:bg-[#1e1e1e] hover:border-gray-400 dark:hover:border-gray-500 hover:shadow-md transition-all cursor-pointer">
      {}
      <div className="flex-1 min-w-0">
        <p className="font-semibold text-gray-900 dark:text-white text-sm leading-snug">{title}</p>
        {children && <p className="mt-1 text-sm text-gray-500 dark:text-gray-400 line-clamp-2">{children}</p>}
      </div>

      {}
      <div className="shrink-0">
        <MethodBadge method={method} />
      </div>
    </div>;
  if (!href) return content;
  return <a href={href} className="block no-underline border-b-0 mb-2">
      {content}
    </a>;
};

Operator products are the individual items in your catalog, such as "Energy Drink" or "Potato Chips," each with its own pricing, barcode, and group assignment.

In Nayax Core, you can create a product in the following way:

1. Go to **Administration > Products**.
2. Click **Create > Add Product**.
3. Fill in the required fields in the form:
   * **Operator**: Choose which operator the product belongs to.
   * **Group**: Choose the product group from that operator to which this product belongs.
   * **Product Name**: The name of the product.
   * **Status**: Whether the product is active or not.
4. Click **Save** to finish.

<Frame>
  <img src="https://mintcdn.com/nayax-44d6e37b-docs-marshall-faq-redistribution/97AxTUwdTqLzbB-t/images/docs/create-products/image1.png?fit=max&auto=format&n=97AxTUwdTqLzbB-t&q=85&s=8bffb28e44e8e38b8f4e65d89892c5e9" alt="" width="1600" height="824" data-path="images/docs/create-products/image1.png" />
</Frame>

## Create a product via API

Use the [Create New Operator Product](/reference/lynx/products/create-new-operator-product) endpoint to create a product programmatically.

<EndpointCard title="Create New Operator Product" href="/reference/lynx/products/create-new-operator-product" method="post" />

<Warning>
  **Authentication**

  Refer to the [Security & Token](/docs/manage-data-operations/lynx-api/security) page of this documentation to learn how to access your tokens and how to properly use them to authenticate your API requests.
</Warning>

<br />

Send a POST request with the `OperatorID` as a path parameter and the product details in the request body:

```sh Request theme={null}
curl --request POST \
     --url https://qa-lynx.nayax.com/operational/v1/operators/{OperatorID}/products \
     --header 'Authorization: Bearer <YOUR_ACCESS_TOKEN>' \
     --header 'accept: application/json' \
     --header 'Content-Type: application/json' \
     --data '{
       "NayaxProductID": 12345,
       "ProductGroupID": 1001,
       "ActorID": 67890,
       "ProductManufacturerID": 55,
       "ProductName": "Energy Drink",
       "ProductCatalogNumber": "ED123",
       "ProductBarcode": "0123456789123",
       "ProductPackageQuantity": 24,
       "ProductDescription": "A refreshing energy drink.",
       "ProductVolumeTypeID": 3,
       "DEXProductName": "Energy_Drink",
       "ProductCostPrice": 1.20,
       "ProductDefaultRetailPrice": 2.50,
       "ProductMinimumPickQTY": 5,
       "ProductStatus": 1,
       "ProductCashPrice": 2.40,
       "ProductCreditCardPrice": 2.60,
       "ProductPrepaidCardPrice": 2.50,
       "ProductExternalPrepaidCardPrice": 2.55,
       "ProductMemberTypePriceBit": true,
       "ProductPictureURL": "https://example.com/energy-drink.jpg",
       "CaloriesPer100g": 45.0,
       "CaloriesPerServing": 110.0,
       "EANCode": "0123456789123",
       "ProductCreatedBy": 7890,
       "ProductCreationDate": "2024-11-25T14:00:00Z",
       "ProductUpdatedBy": 7890,
       "ProductLastUpdated": "2024-11-25T14:30:00Z",
       "VatId": 10
     }'
```

<Note>
  **Path Param**

  Ensure that you send the `OperatorID` as a path param to specify what operator the product belongs to.
</Note>

<br />

In the body parameters, send the following details about the product:

| **Parameter**                       | `Type`           | Description                                                              |
| ----------------------------------- | ---------------- | ------------------------------------------------------------------------ |
| **NayaxProductID**                  | `int64/null`     | The unique identifier for the product in the Nayax system.               |
| **ProductGroupID**                  | `int32/null`     | The unique identifier of the product group to which the product belongs. |
| **ActorID**                         | `int64/null`     | The unique identifier of the actor associated with the product.          |
| **ProductManufacturerID**           | `int32/null`     | The unique identifier of the product's manufacturer.                     |
| **ProductName**                     | `string/null`    | The name of the product.                                                 |
| **ProductCatalogNumber**            | `string/null`    | The catalog number assigned to the product.                              |
| **ProductBarcode**                  | `string/null`    | The barcode associated with the product.                                 |
| **ProductPackageQuantity**          | `int32/null`     | The quantity of product units per package.                               |
| **ProductDescription**              | `string/null`    | A description of the product.                                            |
| **ProductVolumeTypeID**             | `int32/null`     | The volume type identifier associated with the product.                  |
| **DEXProductName**                  | `string/null`    | The name of the product in the DEX (Data Exchange) format.               |
| **ProductCostPrice**                | `double/null`    | The cost price of the product.                                           |
| **ProductDefaultRetailPrice**       | `double/null`    | The default retail price of the product.                                 |
| **ProductMinimumPickQTY**           | `int32/null`     | The minimum quantity of the product that can be picked.                  |
| **ProductStatus**                   | `int32/null`     | The status of the product, typically representing availability.          |
| **ProductCashPrice**                | `double/null`    | The price of the product when paid with cash.                            |
| **ProductCreditCardPrice**          | `double/null`    | The price of the product when paid with a credit card.                   |
| **ProductPrepaidCardPrice**         | `double/null`    | The price of the product when paid with a prepaid card.                  |
| **ProductExternalPrepaidCardPrice** | `double/null`    | The price of the product when paid with an external prepaid card.        |
| **ProductMemberTypePriceBit**       | `boolean/null`   | Indicates if the product has member-type-specific pricing.               |
| **ProductPictureURL**               | `string/null`    | The URL of the product's picture.                                        |
| **CaloriesPer100g**                 | `double/null`    | The number of calories per 100 grams of the product.                     |
| **CaloriesPerServing**              | `double/null`    | The number of calories per serving of the product.                       |
| **EANCode**                         | `string/null`    | The European Article Number (EAN) code associated with the product.      |
| **ProductCreatedBy**                | `int64/null`     | The identifier of the user who created the product entry.                |
| **ProductCreationDate**             | `date-time/null` | The date and time when the product was created.                          |
| **ProductUpdatedBy**                | `int64/null`     | The identifier of the user who last updated the product entry.           |
| **ProductLastUpdated**              | `date-time/null` | The date and time when the product was last updated.                     |
| **VatId**                           | `int32/null`     | The VAT (Value Added Tax) identifier associated with the product.        |

### Create Multiple Products at Once

You can create multiple products for a single machine using the [Create Machine Products](/reference/lynx/machine-products/create-machine-products) endpoint. This allows you to add several products in one request, even if they belong to different product groups.

```sh Request theme={null}
curl -X POST "https://qa-lynx.nayax.com/operational/v1/machines/<MACHINE_ID>/machineProducts" \
-H "Authorization: Bearer <YOUR_ACCESS_TOKEN>" \
-H "Content-Type: application/json" \
-d '[
  {
    "MachineID": 5001,
    "ProductName": "Cola Drink",
    "MDBCode": 1,
    "CashPrice": 1.75,
    "CreditCardPrice": 1.80,
    "RetailPrice": 1.85,
    "ProductGroupID": 201,
    "DEXProductName": "Cola Drink",
    "IsActive": true
  },
  {
    "MachineID": 5001,
    "ProductName": "Potato Chips",
    "MDBCode": 2,
    "CashPrice": 2.25,
    "CreditCardPrice": 2.30,
    "RetailPrice": 2.40,
    "ProductGroupID": 202,
    "DEXProductName": "Potato Chips",
    "IsActive": true
  }
]'
```

<Note>
  **Path Params**

  In the example above, replace `<MACHINE_ID>` with the actual machine identifier you need products added.
</Note>

<br />

The response JSON returned from this API call will confirm that the products have been successfully added by returning the objects representing each product in a list.

```json Response theme={null}
[
  {
    "DexPrice": 1.75,
    "ProductRef": "PROD001",
    "MachineProductRef": "MACH001-A1",
    "ProductGroupRef": "BEVERAGES",
    "MachineRef": "MACH001",
    "MachineProductID": 101,
    "NayaxProductID": 1001,
    "MachineID": 5001,
    "MDBCode": 1,
    "PAR": 10,
    "CashPrice": 1.75,
    "CreditCardPrice": 1.80,
    "MachinePrice": 1.70,
    "RetailPrice": 1.85,
    "DEXProductName": "Cola Drink",
    "PACode": "PA001",
    "PCCode": "PC001",
    "ProductMinimumPickQTY": 5,
    "VendOutAlertThreshold": 2,
    "LastUpdated": "2024-10-10T17:30:00.000Z",
    "MissingStockByDEX": 0,
    "DEXMissingStockLastUpdated": "2024-10-10T17:30:00.000Z",
    "PrePaidCardPrice": 1.65,
    "OperatorButtonCode": "BTN001",
    "LastUpdatedByMobile": "2024-10-10T17:30:00.000Z",
    "ProductGroupID": 201,
    "MissingStockByMDB": 0,
    "MDBMissingStockLastUpdated": "2024-10-10T17:30:00.000Z",
    "SelectionVendOutBit": false,
    "CommissionValue": 0.05,
    "ExternalPrepaidPrice": 1.60,
    "product_mark_for_alerts": 1,
    "last_sale_dt": "2024-10-09T16:30:00.000Z",
    "last_sale_mdb_dt": "2024-10-09T16:30:00.000Z",
    "slow_mover": false
  },
  {
    "DexPrice": 2.25,
    "ProductRef": "PROD002",
    "MachineProductRef": "MACH001-B2",
    "ProductGroupRef": "SNACKS",
    "MachineRef": "MACH001",
    "MachineProductID": 102,
    "NayaxProductID": 1002,
    "MachineID": 5001,
    "MDBCode": 2,
    "PAR": 15,
    "CashPrice": 2.25,
    "CreditCardPrice": 2.30,
    "MachinePrice": 2.20,
    "RetailPrice": 2.40,
    "DEXProductName": "Potato Chips",
    "PACode": "PA002",
    "PCCode": "PC002",
    "ProductMinimumPickQTY": 3,
    "VendOutAlertThreshold": 1,
    "LastUpdated": "2024-10-10T17:30:00.000Z",
    "MissingStockByDEX": 0,
    "DEXMissingStockLastUpdated": "2024-10-10T17:30:00.000Z",
    "PrePaidCardPrice": 2.10,
    "OperatorButtonCode": "BTN002",
    "LastUpdatedByMobile": "2024-10-10T17:30:00.000Z",
    "ProductGroupID": 202,
    "MissingStockByMDB": 1,
    "MDBMissingStockLastUpdated": "2024-10-10T17:30:00.000Z",
    "SelectionVendOutBit": true,
    "CommissionValue": 0.10,
    "ExternalPrepaidPrice": 2.05,
    "product_mark_for_alerts": 1,
    "last_sale_dt": "2024-10-08T15:00:00.000Z",
    "last_sale_mdb_dt": "2024-10-08T15:00:00.000Z",
    "slow_mover": true
  }
]
```

Where:

| **Parameter**      | **Description**                                   |
| ------------------ | ------------------------------------------------- |
| `DexPrice`         | The DEX protocol price of the product.            |
| `ProductRef`       | Reference identifier for the product.             |
| `MachineProductID` | Unique identifier for the product in the machine. |
| `MachineID`        | Identifier of the associated machine.             |
| `MDBCode`          | MDB protocol code for the product.                |
| `CashPrice`        | Price of the product for cash payments.           |
| `CreditCardPrice`  | Price for credit card payments.                   |
| `RetailPrice`      | The retail price set for the product.             |
| `DEXProductName`   | Name of the product as recorded by DEX.           |
| `ProductGroupID`   | Identifier for the product group.                 |
| `LastUpdated`      | Timestamp of the last update.                     |
| `IsActive`         | Indicates if the product is active.               |

### Update Product

You can use the [Update Specific Product](/reference/lynx/products/update-specific-product) endpoint to change a product's details by adding the product's `NayaxProductID` in the path params and the information to change in the body request. As in the example request below:

```sh Request theme={null}
curl --request PUT \
     --url https://qa-lynx.nayax.com/operational/v1/products/{NayaxProductID} \
     --header 'Authorization: Bearer <YOUR_ACCESS_TOKEN>' \
     --header 'accept: application/json' \
     --header 'Content-Type: application/json' \
     --data '{
       "ProductName": "Updated Chocolate Bar",
       "ProductGroupID": 1002,
       "ProductDefaultRetailPrice": 3.00,
       "ProductCashPrice": 2.90,
       "ProductCreditCardPrice": 3.10,
       "ProductDescription": "Updated description for the chocolate bar.",
       "IsActive": true
     }'
```

The body parameters are the same as in the Create Product request. If the request is successful, the response will contain the updated details of the product.

After creating your products, you're ready to [map them to machines](/docs/manage-data-operations/lynx-api/inventory-management/machine-products-1).
