import json


def serialize_product_id_and_amount(product_id: str, amount: int) -> str:
    """
    Convert information about product and its amount into JSON string.

    Used to pass it as a callback query data.
    """
    return json.dumps({'id': product_id, 'amount': amount})