> ## Documentation Index
> Fetch the complete documentation index at: https://devzone.nayax.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Machine 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>;
};

Mapping products to machines (planogram setup) assigns specific products to a machine's bins or selections, defining its layout for inventory tracking and restocking.

You can create product maps in Nayax Core by following the steps below:

1. Go to **Administration > Product Maps**.
2. Click **Add New Product Map**.
3. Fill in the required fields for the product map:
   * **Operator Name**: Specify which operator the map belongs to.
   * **Machine Model**: Select which machine the map is for.
   * **Map Name**: The name of the product map.
   * **Status**: Whether the map is active or not.
4. Click **Save**.

<Frame>
  <img src="https://mintcdn.com/nayax-44d6e37b/27KIupf5oHU9adsO/images/docs/machine-products-1/image1.png?fit=max&auto=format&n=27KIupf5oHU9adsO&q=85&s=760c49928c2283334a430d03218acc73" alt="" width="1600" height="824" data-path="images/docs/machine-products-1/image1.png" />
</Frame>

Now, you can add products to this map. Follow the steps below to do so:

1. Select the map from the list.
2. Click on the **Map Items** tab.
3. Add products to the map using one of the following options:
   * **Add BIN**: Adds one product directly to the list.
   * **Add Multiple BINS**: Opens a pop-up window to select multiple products at once.

<Frame>
  <img src="https://mintcdn.com/nayax-44d6e37b/27KIupf5oHU9adsO/images/docs/machine-products-1/image2.png?fit=max&auto=format&n=27KIupf5oHU9adsO&q=85&s=ec1abc552ac346e4faac3c47c7444cb1" alt="" width="1600" height="824" data-path="images/docs/machine-products-1/image2.png" />
</Frame>

## Add a machine product via API

Use the [Create Machine Products](/reference/lynx/machine-products/create-machine-products) endpoint to add one or more products to a machine's product map programmatically.

<EndpointCard title="Create Machine Products" href="/reference/lynx/machine-products/create-machine-products" 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 it to authenticate your API requests.
</Warning>

<br />

Send a POST request with the `MachineID` as a path parameter and an array of product objects in the request body:

```sh Request theme={null}
curl --request POST \
     --url https://qa-lynx.nayax.com/operational/v1/machines/{MachineID}/machineProducts \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
[
  {
    "NayaxProductID": 0,
    "MDBCode": 0,
    "PAR": 0,
    "CashPrice": 0,
    "CreditCardPrice": 0,
    "MachinePrice": 0,
    "RetailPrice": 0,
    "DEXProductName": "string",
    "PACode": "string",
    "PCCode": "string",
    "ProductMinimumPickQTY": 0,
    "VendOutAlertThreshold": 0,
    "PrePaidCardPrice": 0,
    "OperatorButtonCode": "string",
    "CommissionValue": 0,
    "ExternalPrepaidPrice": 0
  }
]
'
```

You can add more than one product object in the array to add multiple products to the map in a single request.

<Note>
  **Path Params**

  Change the `MachineID` with the unique identifier of the machine to map its products.
</Note>

In the body parameters, fill in the following:

| Parameter               | Description                                                                |
| ----------------------- | -------------------------------------------------------------------------- |
| `NayaxProductID`        | A unique identifier for the product in the Nayax system.                   |
| `MDBCode`               | The MDB (Multi-Drop Bus) code associated with the product.                 |
| `PAR`                   | The price adjustment ratio for the product.                                |
| `CashPrice`             | The price of the product when purchased with cash.                         |
| `CreditCardPrice`       | The price of the product when purchased with a credit card.                |
| `MachinePrice`          | The price of the product set directly on the vending machine.              |
| `RetailPrice`           | The suggested retail price of the product.                                 |
| `DEXProductName`        | The product name as it appears in the DEX (Data Exchange) format.          |
| `PACode`                | The PA (Price Adjustment) code associated with the product.                |
| `PCCode`                | The PC (Product Category) code associated with the product.                |
| `ProductMinimumPickQTY` | The minimum quantity of the product required for restocking or picking.    |
| `VendOutAlertThreshold` | The stock level threshold that triggers a vend-out alert.                  |
| `PrePaidCardPrice`      | The price of the product when purchased using a prepaid card.              |
| `OperatorButtonCode`    | The code used by the operator to select the product manually.              |
| `CommissionValue`       | The commission value associated with the product.                          |
| `ExternalPrepaidPrice`  | The price of the product when purchased with an external prepaid solution. |

After mapping products to your machines, you're ready to [generate pick lists](/docs/manage-data-operations/lynx-api/inventory-management/pick-lists).
