# Checkout catalog products with custom prices using the signature in InLine Cart

## Overview

Use the **Product** object to set the custom price and add it to the InLine Cart by calling the click event handler. In order to use the product custom prices, you first need to [generate a signature](/shopping-carts/inline/use-cases/how-to-use-the-signature-with-the-inline-checkout.md) for the InLine Checkout. The generated signature is then used for checkout.

{% hint style="info" icon="lightbulb" %}

#### Recommended resources

Our InLine Checkout enables you to offer a seamless checkout experience for your clients. Download this solution brief to learn how!

<a href="https://www.2checkout.com/lp/2checkout_inline_cart.html" class="button primary" data-icon="book-open-lines">Learn more</a>
{% endhint %}

## Use case

1. Add an HTML link or button on your page, like the one below.
2. Create a JavaScript click handler to execute the Inline Client desired methods.
3. In order to set the currency, use the TwoCoInlineCart.cart.setCurrency(currency-code) method.
4. Use the TwoCoInlineCart.products.add({code, quantity, options, price}) method or the TwoCoInlineCart.products.addMany(products) method to prepare your catalog product(s).
5. Use the "**price"** property within the **Product** object to set the custom price.
6. You can see below a signature token request payload for this example. A success response contains a JSON with the property **“signature“** which needs to be used at the next step to set the signature using the TwoCoInlineCart method.<br>

   ```javascript
   {
     "merchant": "AVLRNG",
     "currency": "USD",
     "products": [
       {
         "code": "74B8E17CC0",
         "custom-price": {
           "EUR": 8,
           "USD": 10
         }
       }
     ]
   }
   ```

   \
   The above payload will generate the signature **ffe213450a70cdf8e45617dde6331a766e184e02b450e1a537e2b52ef0e4d07e**.
7. Use the TwoCoInlineCart.cart.setSignature('ffe213450a70cdf8e45617dde6331a766e184e02b450e1a537e2b52ef0e4d07e') method to set the signature. It is important that you employ TwoCoInlineCart.cart.removeAll() just before the TwoCoInlineCart.products.addMany(products) or TwoCoInlineCart.products.add(product) methods to remove previous products as the signature is based on the products' definition.
8. Use the TwoCoInlineCart.cart.checkout() method to display the cart on your page.

## Sample Request

### HTML

```html
<a href="#" class="btn btn-success" id="buy-button">Buy bundle now!</a>
```

### JavaScript

```javascript
window.document
  .getElementById("buy-button")
  .addEventListener("click", function() {
    // Sign the
    TwoCoInlineCart.products.removeAll();
    TwoCoInlineCart.products.addMany([\
      {\
        code: "74B8E17CC0",\
        price: {\
          EUR: 8,\
          USD: 10\
        }\
      }\
    ]);
    TwoCoInlineCart.cart.setCurrency('USD');
    TwoCoInlineCart.cart.setSignature('ffe213450a70cdf8e45617dde6331a766e184e02b450e1a537e2b52ef0e4d07e');
    TwoCoInlineCart.cart.checkout();
  });
```

## Demo

{% embed url="<https://codepen.io/2checkout-documentation/pen/zYGJmPO>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.2checkout.com/shopping-carts/inline/use-cases/checkout-catalog-products-with-custom-prices-using-the-signature-in-inline-cart.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
