Help with Creating Card Filters from the API

Hello,
I'm using the API I want to create a Filter variable and the corresponding Filter selection Widget (i.e. parameter) for an existing Card in Metabase.
Below are the json elements I created for the new filter variable and its widget/parameter. I then pass this JSON information to the /api/card/card_id endpoint.

filter_json = {
    'id':'aa1',
    'name': 'customer_name',
    'display-name': 'Customer Name',
    'type': 'dimension',
    'dimension': ['field', 29815, None],
    'widget-type': 'string/='}

#Update card info with the filter template
card_3848_info['dataset_query']['native']['template-tags']['customer_name']=filter_json 
response = mb.put('/api/card/{}'.format(3848), json=card_3848_info)


#Similarily I update the Parameter information for the card. 
#Here is the parameter json
parameter_json = {'id':'aa1','type': 'string/=', 'target': ['dimension', ['template-tag', 'customer']], 'name': 'Customer Name', 'slug': 'customer_name'}

#Update card info with the filter parameter
card_3848_info['parameters'].append(parameter_json)
response = mb.put('/api/card/{}'.format(3848), json=card_3848_info)

This code creates the Filter variable and the Filter widget for the card in the Metabase UI. The filter works as expected.

My question is how do I determine the Filter Variable id ?
For now I've assigned a random string as the id, but I need to create filter variables across multiple cards. I cannot leave the id blank it gives me an error in UI (confirmed from browser Network tab).
Can I just assign random id's to all the variables I create?