Creating line items in Ubercart 3
I've done exactly this before; I'll dump the code I used. Hopefully, it'll give you an idea.

/**
 * Implements hook_menu().
 */
function uc_giftwrap_menu() {
  $items['admin/store/settings/giftwrap'] = array(
    'title' =&gt; 'Gift Wrapping',
    'access arguments' =&gt; array('administer gift wrap'),
    'page callback' =&gt; 'drupal_get_form',
    'page arguments' =&gt; array('uc_giftwrap_admin_form')
  );

  return $items;
}

/**
 * Implements hook_permission().
 */
function uc_giftwrap_permission() {
  return array(
    'administer gift wrap' =&gt; array(
      'title' =&gt; 'Administer Gift Wrap Settings'
    )
  );
}

/**
 * Form builder for the gift wrap settings.
 */
function uc_giftwrap_admin_form($form, &amp;$form_state) {
  $form['uc_giftwrap_cost'] = array(
    '#type' =&gt; 'textfield',
    '#title' =&gt; t('Gift Wrap Cost'),
    '#description' =&gt; t('Total cost of gift wrapping for an order.'),
    '#default_value' =&gt; round(variable_get('uc_giftwrap_cost', '0.00'), 2),
    '#field_prefix' =&gt; '&amp;pound;',
    '#size' =&gt; 10
  );

  return system_settings_form($form);
}

/**
 * Implements hook_uc_checkout_pane().
 */
function uc_giftwrap_uc_checkout_pane() {
  $panes['gift_wrap'] = array(
    'callback' =&gt; 'uc_giftwrap_uc_checkout_pane_callback',
    'title' =&gt; 'Gift Wrapping',
    'desc' =&gt; 'Provide gift wrapping options for the checkout.',
    'weight' =&gt; 5
  );

  return $panes;
}

/**
 * Callback for the checkout pane.
 */
function uc_giftwrap_uc_checkout_pane_callback($op, $order, $form = NULL, &amp;$form_state = NULL) {
  if ($op == 'view') {
    $description = t('Please check this box if you wish your order to be gift wrapped.');

    $contents['gift_wrap'] = array(
      '#type' =&gt; 'checkbox',
      '#title' =&gt; t('Add Gift Wrapping') . ' (' . uc_currency_format(variable_get('uc_giftwrap_cost', 0)) . ')',
      '#default_value' =&gt; isset($_SESSION['uc_giftwrap_checkout']) ? 1 : 0,
      '#ajax' =&gt; array(
        'callback' =&gt; 'uc_giftwrap_update_line_items',
        'effect' =&gt; 'slide'
      )
    );

    return array('description' =&gt; $description, 'contents' =&gt; $contents);
  }
  else if ($op == 'process') {
    if ($form_state['values']['panes']['gift_wrap']['gift_wrap'] == 1) {
      if (!isset($_SESSION['uc_giftwrap_checkout'])) {
        uc_order_line_item_add($order-&gt;order_id, 'gift_wrap', 'Gift Wrapping', variable_get('uc_giftwrap_cost', 0));
        $id = db_query('SELECT MAX(line_item_id) FROM {uc_order_line_items}')-&gt;fetchField();
        $_SESSION['uc_giftwrap_checkout'] = $id;
      }
    }
    else {
      if (isset($_SESSION['uc_giftwrap_checkout'])) {
        uc_order_delete_line_item($_SESSION['uc_giftwrap_checkout']);
        unset($_SESSION['uc_giftwrap_checkout']);
      }
    }
  }
}

/**
 * AJAX callback for the checkout form (allows instant updating of total when gift wrap option is chosen).
 */
function uc_giftwrap_update_line_items($form, $form_state) {
  $commands = array();
  if (isset($form['panes']['payment']['line_items'])) {
    $commands[] = ajax_command_replace('#line-items-div', drupal_render($form['panes']['payment']['line_items']));
    $commands[] = ajax_command_prepend('#line-items-div', theme('status_messages'));
  }

  return array('#type' =&gt; 'ajax', '#commands' =&gt; $commands);
}

/**
 * Implements hook_uc_line_item().
 */
function uc_giftwrap_uc_line_item() {
  $items[] = array(
    'id' =&gt; 'gift_wrap',
    'title' =&gt; t('Gift Wrapping'),
    'weight' =&gt; 2,
    'default' =&gt; FALSE,
    'stored' =&gt; TRUE,
    'add_list' =&gt; TRUE,
    'calculated' =&gt; TRUE,
    'callback' =&gt; 'uc_giftwrap_uc_line_item_gift_wrap',
    'display_only' =&gt; FALSE
  );

  return $items;
}

/**
 * Callback for line item type.
 */
function uc_giftwrap_uc_line_item_gift_wrap($op, $arg1) {
  // Required callback for hook_uc_line_item()
}

/**
 * Implements hook_uc_checkout_complete().
 */
function uc_giftwrap_uc_checkout_complete($order, $account) {
  if (isset($_SESSION['uc_giftwrap_checkout'])) {
    unset($_SESSION['uc_giftwrap_checkout']);
  }
}