You have to set variable placeholders in the body itself, then set the variable values in the pre-request script. So you request body will be:
{
mode: 'raw',
raw: JSON.stringify({
licenseUsername: '{{username}}',
licensePassword: '{{password}}'
}),
options: {
raw: {
language: 'json'
}
}
}
…and in you pre-request script:
pm.variables.set("licenseUsername", "username-value");
pm.variables.set("licensePassword", "password-value");
This allows the flexibility of changing the body structure down the line without having to mess with the values themselves and/or the script.