function StoreAddFreeLicense( request, callback )
{
	/**
	 * @param {any} response
	 */
	const freeLicenseResponse = ( response ) =>
	{
		if( Array.isArray( response ) )
		{
			// This api returns [] on success
			callback( { success: true } );

			InvalidateCache();

			return;
		}

		const resultCode = response?.purchaseresultdetail ?? null;
		let message;

		switch( resultCode )
		{
			case 5: message = 'Steam says this is an invalid package.'; break;
			case 9: message = 'This product is already available in your Steam library.'; break;
			case 24: message = 'You do not own the required app.'; break;
			case 53: message = 'You got rate limited, try again later.'; break;
			default: message = resultCode === null
				? `There was a problem adding this product to your account. ${response?.error ?? ''}`
				: `There was a problem adding this product to your account. PurchaseResultDetail=${resultCode}`;
		}

		callback( {
			success: false,
			error: message,
			resultCode,
		} );
	};

	if( request.subid )
	{
		const subid = Number.parseInt( request.subid, 10 );
		const formData = new FormData();
		formData.set( 'ajax', 'true' );

		ExecuteStoreApiCall( `freelicense/addfreelicense/${subid}`, formData, freeLicenseResponse, true );
	}
	else if( request.bundleid )
	{
		const bundleid = Number.parseInt( request.bundleid, 10 );
		const formData = new FormData();
		formData.set( 'ajax', 'true' );

		ExecuteStoreApiCall( `freelicense/addfreebundle/${bundleid}`, formData, freeLicenseResponse, true );
	}
}
@param {Record<string, string>} request
@param {(obj: {success: true}|{success: false, error: string, resultCode: number}) => void} callback